> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# تفاصيل قاعدة مراقبة المعاملات عبر API

> استرجع قاعدة KYT من Didit مع إعداداتها الكاملة وعدادات التنفيذ: عدد مرات التشغيل، ونسب الموافقة والمراجعة والرفض، وآخر تشغيل.

موجّه API لجلب القاعدة
نسخ الموجّه إلى الحافظة

<pre>
  \`Fetch one transaction-monitoring rule by uuid.

  Endpoint:
  GET [https://verification.didit.me/v3/transactions/rules/\{rule\_uuid}/](https://verification.didit.me/v3/transactions/rules/\{rule_uuid}/)

  Authentication:
  Use the x-api-key header with my Didit API key.

  Behavior:

  * Returns the full configuration (scope, conditions, aggregation, actions, mode, evaluation\_mode) plus execution counters: run\_count, approved/reviewed/declined/awaiting\_user counts and percentages, latest\_triggered\_at.
  * Read the rule back after a create or update to confirm what is actually stored.
  * 404 when the uuid does not belong to this application's non-deleted rules.\`
</pre>

الصق في


## OpenAPI

````yaml ar/openapi-25.json GET /v3/transactions/rules/{rule_uuid}/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: API التحقق من الهوية. قم بالمصادقة باستخدام الرأس x-api-key.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/transactions/rules/{rule_uuid}/:
    parameters:
      - name: rule_uuid
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: المعرّف الفريد العالمي (uuid) للقاعدة من القائمة أو الإنشاء.
    get:
      tags:
        - Transactions
      summary: الحصول على القاعدة
      description: استرداد قاعدة واحدة مع تكوينها الكامل وعدّادات التنفيذ الخاصة بها.
      operationId: getTransactionRule
      responses:
        '200':
          description: القاعدة.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionRuleDetail'
        '404':
          description: لا توجد قاعدة كهذه في هذا التطبيق.
          content:
            application/json:
              schema:
                type: object
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X GET
            'https://verification.didit.me/v3/transactions/rules/RULE_UUID/' \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.transactions.rules.retrieve(
                "11111111-2222-3333-4444-555555555555",
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: >-
            import Didit from "@didit-protocol/sdk-node";


            // Reads DIDIT_API_KEY.

            const didit = new Didit();


            const result = await
            didit.transactions.rules.retrieve("11111111-2222-3333-4444-555555555555");

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Transactions.Rules.Retrieve(ctx, \"11111111-2222-3333-4444-555555555555\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.transactions().rules().retrieve("11111111-2222-3333-4444-555555555555");

            System.out.println(result);
        - lang: php
          label: PHP
          source: >-
            <?php


            require 'vendor/autoload.php';


            use Didit\DiditClient;


            // Reads DIDIT_API_KEY.

            $didit = new DiditClient();


            $result =
            $didit->transactions->rules->retrieve('11111111-2222-3333-4444-555555555555');

            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: >-
            require "didit"


            # Reads DIDIT_API_KEY.

            didit = Didit::Client.new


            result =
            didit.transactions.rules.retrieve("11111111-2222-3333-4444-555555555555")

            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await
            client.Transactions.Rules.RetrieveAsync("11111111-2222-3333-4444-555555555555");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    TransactionRuleDetail:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
        title:
          type: string
          description: >-
            اسم القاعدة. فريد لكل تطبيق بين القواعد غير المحذوفة؛ وترجع الأسماء
            المكررة الرمز 400.
        description:
          type: string
          nullable: true
        category:
          type: string
          description: >-
            موضوع المخاطر المستخدم للتجميع وإعداد التقارير، مثل finance،
            وaml_ctf، وanomaly_detection، وfatf، وdevice_intelligence،
            وcrypto_monitoring، وtravel_rule، وresponsible_gaming، وe_commerce.
        mode:
          type: string
          enum:
            - ACTIVE
            - DISABLED
            - TEST
          description: >-
            يقوم ACTIVE بالتقييم المباشر. يقوم TEST بالتقييم وتسجيل عمليات تشغيل
            القواعد ولكنه لا يؤثر أبدًا في الدرجة أو الحالة - وهو وضع البدء
            الموصى به. يتم تخطي DISABLED.
        evaluation_mode:
          type: string
          enum:
            - ALL
            - ANY
          default: ALL
          description: >-
            ما إذا كان يجب أن يتطابق كل شرط (ALL) أو شرط واحد على الأقل (ANY).
            يتم تجاهله عندما تستخدم الشروط group_index.
        scope:
          $ref: '#/components/schemas/TransactionRuleScope'
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/TransactionRuleCondition'
        aggregation:
          type: array
          items:
            $ref: '#/components/schemas/TransactionRuleAggregation'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/TransactionRuleAction'
        metadata:
          type: object
          description: بيانات وصفية بصيغة حرة مخزنة في القاعدة.
        severity:
          type: string
          enum:
            - UNKNOWN
            - LOW
            - MEDIUM
            - HIGH
            - CRITICAL
          nullable: true
          description: >-
            مستوى خطورة معلوماتي تحمله قواعد المكتبة؛ لا يمكن تعيينه في القواعد
            المخصصة.
        source:
          type: string
          enum:
            - PRESET
            - CUSTOM
          description: >-
            تأتي قواعد PRESET من المكتبة (تثبيت/إلغاء تثبيت، تعديلات على الوضع
            فقط)؛ أما قواعد CUSTOM فهي ملكك بالكامل.
        library_key:
          type: string
          nullable: true
          description: معرّف مكتبة ثابت؛ تكون القيمة null للقواعد المخصصة.
        latest_triggered_at:
          type: string
          format: date-time
          nullable: true
        run_count:
          type: integer
          description: عدد المعاملات التي تطابقت مع هذه القاعدة.
        approved_count:
          type: integer
        reviewed_count:
          type: integer
        declined_count:
          type: integer
        awaiting_user_count:
          type: integer
        approved_pct:
          type: number
        reviewed_pct:
          type: number
        declined_pct:
          type: number
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    TransactionRuleScope:
      type: object
      properties:
        transaction_types:
          type: array
          items:
            type: string
          description: >-
            التقييد بأنواع المعاملات، مثل finance أو kyc أو travel_rule أو
            user_event. فارغ أو مفقود = لا يوجد تقييد.
        directions:
          type: array
          items:
            type: string
            enum:
              - INBOUND
              - OUTBOUND
          description: التقييد باتجاهات المعاملات (غير حساس لحالة الأحرف عند الكتابة).
        action_types:
          type: array
          items:
            type: string
          description: التقييد بقيم action_type الخاصة بك، مثل withdrawal أو deposit.
      description: أي معاملات تنطبق عليها القاعدة. يتم قبول هذه المفاتيح الثلاثة فقط.
    TransactionRuleCondition:
      type: object
      required:
        - field
        - operator
      properties:
        field:
          type: string
          description: >-
            مسار حقل المعاملة للتقييم. الحقول الأساسية: amount، currency،
            direction، action_type، score، severity، transaction_type،
            payment_details، preferred_currency_amount (يرجع كبديل إلى
            amount_in_default_currency)، default_currency_code، subject_country،
            counterparty_country، subject_vendor_data، counterparty_vendor_data،
            subject_device_fingerprint، counterparty_device_fingerprint،
            subject_browser_family، subject_browser_version، subject_platform،
            subject_accept_language، subject_session_age_ms، subject_ip_country،
            counterparty_ip_country، subject_ip_address،
            counterparty_ip_address، subject_payment_method_type،
            subject_payment_method_country، subject_payment_method_fingerprint،
            subject_payment_method_account_id (وما يعادلها من
            counterparty_payment_method_*)، travel_rule_status،
            travel_rule_required، travel_rule_obligations_count،
            counterparty_dd_status (قرارك بشأن الطرف المقابل لـ Travel Rule:
            APPROVED أو RESTRICTED أو BLOCKED، وهو كيان يتبع علامته التجارية)،
            counterparty_risk_level (LOW أو MEDIUM أو HIGH؛ ويكون HIGH طالما كان
            فحص الطرف المقابل الخاص بك مُعلَّماً)، counterparty_jurisdiction
            (دولة VASP للطرف المقابل)، counterparty_responsiveness (RESPONSIVE
            أو UNRESPONSIVE أو UNKNOWN)،
            subject_days_since_previous_transaction، tags، و custom_values.<key>
            لأي مفتاح تم إرساله في custom_properties عند إنشاء المعاملة. تقبل
            حقول رموز الدول كلاً من ISO-2 أو ISO-3؛ وتتم تسوية كلا الجانبين إلى
            ISO-3 قبل المقارنة.
        operator:
          type: string
          enum:
            - eq
            - ne
            - gt
            - gte
            - lt
            - lte
            - in
            - not_in
            - contains
            - not_contains
            - contains_any
            - regex
            - fuzzy_match
            - exists
            - is_not_empty
            - is_not_null
            - not_exists
            - is_empty
            - is_null
          description: >-
            معامل المقارنة. يختبر in/not_in الانتماء (قد تكون القيمة قائمة أو
            قيمة فردية واحدة). يُعد contains/not_contains فحصاً لسلسلة فرعية غير
            حساس لحالة الأحرف مقابل قيمة نصية. يقبل contains_any قائمة من النصوص
            ويتطابق عندما يكون أي منها سلسلة فرعية غير حساسة لحالة الأحرف من
            قيمة الحقل. يطابق regex نمط القيمة مع الحقل. يقارن fuzzy_match مع
            سلسلة القيمة وفقاً لحد `score` المطلوب (0-100). لا تتطابق
            gt/gte/lt/lte أبداً عند فقدان أي من الطرفين. تُعد
            exists/is_not_empty/is_not_null (أسماء مستعارة)
            وnot_exists/is_empty/is_null (أسماء مستعارة) فحوصات وجود تتجاهل
            `value`.
        value:
          description: >-
            قيمة المقارنة. يعتمد شكلها على المعامل وvalue_type؛ احذفها لمعاملات
            فحص الوجود. يحتاج كل معامل آخر إلى قيمة ليست `null` أو قائمة فارغة،
            وإلا فسيتم رفض القاعدة بالرمز `400`. يحتاج `contains_any` إلى قائمة
            نصوص، بينما يحتاج كل من `contains` و`not_contains` و`regex` إلى نص
            فردي.
        value_type:
          type: string
          enum:
            - list
            - field
            - relative_date
          description: >-
            تفسير اختياري للقيمة. `list`: القيمة هي UUID لقائمة وتصبح مدخلات
            القائمة هي قيمة المقارنة. `field`: القيمة هي مسار حقل آخر، وتتم
            المقارنة حقلاً بحقل. `relative_date`: القيمة هي كائن تاريخ نسبي، مثل
            {"direction": "past", "unit": "days", "amount": 30}.
        score:
          type: number
          minimum: 0
          maximum: 100
          description: 'مطلوب عندما يكون المشغّل هو fuzzy_match: حد التشابه بين 0 و100.'
        group_index:
          type: integer
          description: >-
            منطق مجمّع اختياري. عندما يحمل أي شرط group_index، فإن الشروط التي
            تشترك في نفس الفهرس تشكّل مجموعة، ويحل التقييم المجمّع محل
            evaluation_mode.
        group_logic:
          type: string
          enum:
            - AND
            - OR
          default: AND
          description: كيفية دمج الشروط داخل المجموعة الواحدة.
        groups_logic:
          type: string
          enum:
            - AND
            - OR
          default: OR
          description: >-
            كيفية دمج نتائج المجموعات عبر المجموعات المختلفة. تُقرأ من الشرط
            الأول.
      description: >-
        يقرأ الشرط فقط المعاملة التي تخضع للتقييم - ولا يصفّي أبداً نافذة
        التجميع.
    TransactionRuleAggregation:
      type: object
      required:
        - value
      properties:
        metric:
          type: string
          enum:
            - count
            - sum
            - max
            - min
            - avg
            - distinct_count
          default: count
          description: >-
            كيفية تجميع المعاملات السابقة المتطابقة. يتم قبول unique_count كاسم
            بديل لـ distinct_count.
        field:
          type: string
          default: amount
          description: >-
            الحقل المجمّع حسب sum/max/min/avg/distinct_count. يُتجاهل بالنسبة لـ
            count.
        operator:
          type: string
          enum:
            - eq
            - ne
            - gt
            - gte
            - lt
            - lte
          default: eq
          description: المقارنة المطبقة على المقياس المحسوب.
        value:
          type: number
          description: الحد الذي تتم مقارنة المقياس المحسوب به.
        window:
          type: string
          pattern: ^\d+(m|h|d)$
          default: 1d
          description: >-
            نافذة الرجوع التي تنتهي عند txn_date الخاص بالمعاملة: <N>m (دقائق،
            وليس شهوراً)، أو <N>h (ساعات)، أو <N>d (أيام)، مثل 30m، أو 24h، أو
            7d، أو 30d.
        filters:
          type: object
          additionalProperties: true
          description: >-
            يُضيّق نطاق المعاملات السابقة التي يتم تجميعها. المفاتيح هي مسارات
            الحقول من كتالوج حقول الشروط؛ تشير القيمة "__current__" إلى قيمة
            الحقل نفسه في المعاملة الجاري تقييمها (على سبيل المثال، يحدد
            {"subject_vendor_data": "__current__"} نطاق النافذة لنفس الموضوع)،
            وتشير قيمة القائمة إلى الانتماء. لا يتم تجميع السجلات التي لا تحتوي
            على القيمة المجمعة معًا أبدًا: عندما لا تحتوي المعاملة الجاري
            تقييمها على قيمة لحقل "__current__" (لا يوجد طرف مقابل، ولا توجد
            بصمة للجهاز)، فإن التجميع لا يتطابق، أياً كان معامله. تقارن عوامل
            التصفية بالمساواة أو الانتماء فقط - لا توجد تصفية lt/gte، لذا لا
            يمكن التعبير عن نطاق مثل "المعاملات السابقة الأقل من 10,000" هنا. ضع
            النطاق في المقياس بدلاً من ذلك (المقياس max مع المعامل lt يحتفظ بكل
            معاملة في النافذة أقل من الحد).
      description: >-
        فحص معدل التكرار (velocity check) عبر المعاملات التاريخية للتطبيق داخل
        النافذة الزمنية. يجب أن يتطابق كل إدخال تجميعي حتى تتطابق القاعدة، بغض
        النظر عن evaluation_mode. يقيد التجميع النافذة الزمنية فقط؛ أما المعاملة
        قيد التقييم فتُقيّد بواسطة النطاق والشروط، لذا كرر direction أو currency
        أو transaction_type في كلا النصفين عندما تقتضي القاعدة ذلك.
    TransactionRuleAction:
      oneOf:
        - $ref: '#/components/schemas/TransactionRuleActionAddScore'
        - $ref: '#/components/schemas/TransactionRuleActionChangeStatus'
        - $ref: '#/components/schemas/TransactionRuleActionAddTags'
        - $ref: '#/components/schemas/TransactionRuleActionAddNote'
        - $ref: '#/components/schemas/TransactionRuleActionAddToList'
        - $ref: '#/components/schemas/TransactionRuleActionOpenCase'
      discriminator:
        propertyName: type
        mapping:
          add_score: '#/components/schemas/TransactionRuleActionAddScore'
          change_status: '#/components/schemas/TransactionRuleActionChangeStatus'
          add_tags: '#/components/schemas/TransactionRuleActionAddTags'
          add_note: '#/components/schemas/TransactionRuleActionAddNote'
          add_to_list: '#/components/schemas/TransactionRuleActionAddToList'
          open_case: '#/components/schemas/TransactionRuleActionOpenCase'
      description: >-
        إجراء قاعدة واحد. يمكن أن تحمل القاعدة عدة إجراءات؛ وتُطبّق جميعها معاً
        عند تطابقها. تسجل القواعد في وضع TEST ما كانت ستفعله دون تطبيق أي إجراء.
    TransactionRuleActionAddScore:
      type: object
      required:
        - type
        - value
      properties:
        type:
          type: string
          enum:
            - add_score
        value:
          type: integer
          description: النقاط المضافة إلى درجة المخاطر للمعاملة. قد تكون سالبة.
      description: >-
        أضف نقاطاً إلى درجة المخاطر التراكمية للمعاملة؛ يحدد الإجمالي الحالة عبر
        حدود المراجعة/الرفض الخاصة بالتطبيق.
    TransactionRuleActionChangeStatus:
      type: object
      required:
        - type
        - value
      properties:
        type:
          type: string
          enum:
            - change_status
        value:
          type: string
          enum:
            - APPROVED
            - IN_REVIEW
            - DECLINED
            - AWAITING_USER
          description: >-
            الحالة المطلوب تعيينها على الفور، بغض النظر عن النتيجة. المفتاح
            البديل: status.
        workflow_id:
          type: string
          format: uuid
          description: >-
            مطلوب عندما تكون القيمة AWAITING_USER: سير عمل التحقق الذي يُطلب من
            المعني إكماله. مفتاح الاسم المستعار: remediation_workflow_id. تُنشئ
            Didit جلسة تصحيح مستضافة للمعني عند تفعيل القاعدة.
      description: >-
        تعيين حالة المعاملة مباشرةً. تحظى DECLINED دائماً بالأولوية عبر القواعد
        المطابقة.
    TransactionRuleActionAddTags:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - add_tags
        tag_uuid:
          type: string
          format: uuid
          description: علامة تطبيق موجودة لإرفاقها.
        tag_name:
          type: string
          description: >-
            اسم العلامة المراد إرفاقها؛ يتم إنشاؤها عند الاستخدام الأول (وتُخزّن
            بأحرف كبيرة). قدّم tag_uuid أو tag_name.
        tag_color:
          type: string
          description: >-
            لون سداسي عشري يُستخدم عندما ينشئ tag_name وسماً جديداً، مثل
            #007AFE.
      description: إرفاق علامة تطبيق بالمعاملة المتطابقة.
    TransactionRuleActionAddNote:
      type: object
      required:
        - type
        - note
      properties:
        type:
          type: string
          enum:
            - add_note
        note:
          type: string
          description: >-
            نص الملاحظة المرفق بالمعاملة (المؤلف: محرك القواعد). المفتاح البديل:
            القيمة.
      description: إرفاق ملاحظة محلل مؤتمتة بالمعاملة المتطابقة.
    TransactionRuleActionAddToList:
      type: object
      required:
        - type
        - list_id
      properties:
        type:
          type: string
          enum:
            - add_to_list
        list_id:
          type: string
          format: uuid
          description: القائمة المراد إضافة vendor_data الخاص بالشخص المستهدف إليها.
      description: >-
        أضف vendor_data الخاصة بالشخص الخاضع للفحص إلى قائمة الحظر، أو قائمة
        السماح، أو قائمة مخصصة.
    TransactionRuleActionOpenCase:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - open_case
        blueprint:
          type: string
          format: uuid
          description: UUID لمخطط الحالة؛ يُعيّن افتراضياً إلى المخطط الافتراضي للتطبيق.
        grouping:
          type: string
          enum:
            - by_applicant
            - by_rule_and_applicant
          description: >-
            ما إذا كانت التطابقات المتكررة تنضم إلى حالة واحدة لكل متقدم أو حالة
            واحدة لكل قاعدة + متقدم.
        attach_matched_transaction:
          type: boolean
          description: إرفاق المعاملة المتطابقة بالحالة.
      description: >-
        فتح حالة تحقيق (أو الإضافة إليها). يتم تطبيق أول إجراء open_case فقط على
        القاعدة.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        مفتاح API الخاص بتطبيقك، من Developers -> API keys في Business Console.
        يمتلك المفتاح الأساسي وصولاً كاملاً. يمكن تحديد نطاق المفتاح المسمى: لا
        شيء، أو قراءة، أو كتابة لكل مورد، ومحدوداً ببعض مسارات العمل أو بالجلسات
        المقبولة، وبقائمة من عناوين IP، وبتاريخ انتهاء الصلاحية. يشير 401 إلى أن
        المفتاح غير صحيح أو ملغى أو منتهي الصلاحية؛ ويشير 403 إلى أنه لم يتم
        إرسال أي مفتاح، أو أن المفتاح ليس لديه حق الوصول إلى هذا المورد أو
        الإجراء، أو أن الطلب جاء من عنوان خارج قائمة عناوين IP الخاصة به؛ ويشير
        404 في مسار جلسة إلى أن الجلسة خارج مسارات العمل أو الحالات الخاصة
        بالمفتاح. يتلقى المفتاح الذي لا يمتلك حق الوصول إلى الوسائط عناوين URL
        للصور ومقاطع الفيديو وملفات PDF كـ null، ويتلقى المفتاح الذي لا يمتلك
        إذن كتابة للجلسات روابط الجلسة وtoken كـ null. راجع
        https://docs.didit.me/console/api-keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.