> ## 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 لتغذية تغييرات المعاملات البنكية: المضافة والمعدلة والمحذوفة

> تُرجع نقطة Sync Transactions في Didit التغييرات في معاملات الاتصال البنكي منذ مؤشر معين: المضافة والمعدلة والمحذوفة.

يعيد endpoint Sync Transactions لدى Didit التغييرات التي طرأت على معاملات الاتصال منذ المؤشر المحدد: `added` و`modified` و`removed`.
إذا كان المؤشر فارغًا، يعيد كل المعاملات مع `reset: true`.
لا تخزّن `next_cursor` إلا بعد استجابة تحتوي على `has_more: false`.
اطّلع على [التدفق البنكي المستمر للمحاسبة](https://docs.didit.me/ar/use-cases/bank-data-for-accounting.md).


## OpenAPI

````yaml ar/openapi-25.json GET /v3/bank/connections/{id}/transactions/sync/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: واجهة برمجة تطبيقات التحقق من الهوية. صادِق باستخدام الترويسة x-api-key.
servers:
  - url: https://verification.didit.me
security: []
tags:
  - name: Bank Data
    description: >-
      Bank Link والاتصالات والحسابات والأرصدة والمعاملات والمؤسسات والتغطية.
      بيانات البنك متاحة للتطبيقات التجريبية. ترد استدعاءات التطبيق الحي بـ
      `404` إلى أن يُعلن الوصول الحي. لا تُحتسب أي رسوم في البيئة التجريبية.
      يحتاج الاستدعاء الذي يتم بمفتاح API إلى مفتاح يتضمن إذن بيانات البنك
      (`bank-data`): القراءة للقراءات، والكتابة للعمليات التي تغيّر شيئاً. فحص
      الحساب هو الاستثناء: يحتاج إلى صلاحية الكتابة على الجلسات، أو الوصول
      الكامل، وليس إذن بيانات البنك. بيانات البنك غير مشمولة بالوصول الكامل:
      يُرفض مفتاح الوصول الكامل، ويرد الاستدعاء بـ `403 bank_data_access_denied`
      إلى أن تنشئ مفتاحاً يتضمن الإذن. ترفض بيانات البنك الخام (الحسابات
      والأرصدة والمعاملات وموجز التغييرات) أيضاً الطلب الذي لا يتضمن مفتاح API.


      تحمل كل حالات الرفض ضمن `/v3/bank/`، باستثناء رفض فحص الحساب، جسم JSON
      نفسه (`code`، `message`، `request_id`، `field`، `next_action`،
      `retry_after`). يرد مسار ليس عملية، أو معرّف ليس UUID، أو مورد فرعي غير
      معروف، بـ `404 not_found` لكل طريقة، ويرد أي خطأ غير متوقع بـ `500
      internal_error` مع `request_id`. حيثما لا تكون بيانات البنك متاحة، ترد كل
      عملية بـ `404` القياسي للمنصة، تماماً كما يرد المسار غير المعروف.
paths:
  /v3/bank/connections/{id}/transactions/sync/:
    get:
      tags:
        - Bank Data
      summary: مزامنة المعاملات (موجز التغييرات)
      description: >-
        يُرجع التغييرات التي طرأت على معاملات الاتصال منذ `cursor` معيّن:
        `added` و`modified` و`removed` (مع `reason`)، عبر جميع حساباته. عند
        تمرير مؤشر فارغ، يُرجع كل معاملة حالية على أنها `added` ويضبط `reset:
        true`: استبدل نسختك بها بدلاً من إضافتها إليها.


        القراءة الأولى لقطة حقيقية. تُرجع القراءة الأولى (بدون cursor، أو
        القراءة التي تلي `reset`) كل معاملة كانت لدى الاتصال عند بدء القراءة، كل
        واحدة مرة واحدة فقط على أنها `added`، بحالتها الحالية، حتى لو جرت مزامنة
        أثناء التصفح. تصل التغييرات التي تحدث أثناء تصفحك في القراءة التالية من
        `next_cursor`: فالمعاملة التي استلمتها سابقاً تعود على أنها `modified`،
        والمعاملة الجديدة على أنها `added`. طبّق `modified` كعملية تحديث أو
        إدراج (upsert) بحسب `id`، وتجاهل معرّف `removed` الذي لا تملكه. تعكس
        جميع صفحات القراءة الواحدة النقطة الزمنية نفسها. واصل التصفح باستخدام
        `page_token` ما دام `has_more` يساوي `true`، ولا تخزّن `next_cursor` إلا
        بعد استجابة تحمل `has_more: false`. إذا فشل التصفح في منتصفه، فأعد البدء
        من المؤشر الذي خزّنته.


        سجل التغييرات قابل لإعادة التشغيل لمدة 90 يوماً. يُعيد المؤشر الأقدم
        الخطأ `410 cursor_expired` مع `bootstrap: true`: ابدأ من جديد بمؤشر
        فارغ. لا يُحذف السجل المخزّن أبداً ما دام الاتصال قائماً. تظهر المعاملة
        المعلّقة التي تم قيدها في `added`، والمعاملة المعلّقة الأصلية في
        `removed` مع `reason: pending_booked`. يُخبرك حدث `bank.data.updated` في
        webhook متى تستدعي.


        يتطلب مفتاح API بصلاحية بيانات البنك (`bank-data`): قراءة لهذه العملية.
        لا يشمل المفتاح ذو الوصول الكامل هذه الصلاحية: امنحها صراحةً عند إنشاء
        المفتاح، وإلا أعاد الاستدعاء `403 bank_data_access_denied`. يقرأ تطبيق
        البيئة التجريبية بيانات البنك التجريبي باستخدام المفتاح وحده. يُرفض
        الطلب الذي لا يحمل مفتاح API (بيانات اعتماد العميل) عند طلب البيانات
        الخام بالخطأ `403` نفسه.
      operationId: syncBankTransactions
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: معرّف الاتصال.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: >-
            قيمة `next_cursor` التي خزّنتها. إذا كانت فارغة أو لم تُذكر، تبدأ من
            البداية.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
            minimum: 1
            maximum: 500
          description: حجم الصفحة، من 1 إلى 500. القيمة الافتراضية 100.
        - name: page_token
          in: query
          required: false
          schema:
            type: string
          description: يستمر في القراءة نفسها ما دام `has_more` يساوي `true`.
      responses:
        '200':
          description: صفحة من التغييرات.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankTransactionChanges'
              examples:
                Changes:
                  summary: سُجّلت معاملة معلقة، وأُضيفت معاملة جديدة
                  value:
                    added:
                      - id: 8f2b6d41-9c3a-4e57-b0d8-1a7e5c4f2963
                        account_id: a71f0c2e-5d38-4b96-a1c4-3e9f8d2b7a10
                        status: booked
                        pending_id: null
                        reverses_id: null
                        booking_date: '2026-11-19'
                        value_date: '2026-11-20'
                        transaction_date: null
                        effective_date: '2026-11-19'
                        amount: '-1210.00'
                        currency: EUR
                        direction: debit
                        description: RECIBO SEGURIDAD SOCIAL
                        counterparty:
                          name: ENTIDAD PUBLICA DE EJEMPLO
                          iban: ES0000000000000000005766
                          bic: null
                        remittance:
                          unstructured:
                            - RECIBO SEGURIDAD SOCIAL 10/2026
                          structured: null
                          reference: '0028123456789'
                        bank_transaction_code: PMNT-RDDT-ESDD
                        bank_reference: '2026111900012345'
                        identity_quality: bank_reference
                        end_to_end_id: NOTPROVIDED
                        mandate_id: ES-SS-000123
                        creditor_id: ES00ZZZ00000000
                        merchant_category_code: null
                        exchange: null
                        balance_after: '18250.34'
                        category: taxes_and_social_security
                        first_seen_at: '2026-11-20T06:00:12Z'
                        updated_at: '2026-11-20T06:00:12Z'
                    modified: []
                    removed:
                      - id: e5b1f8a3-0d47-4c92-a6e0-7f3c2d9b1845
                        reason: pending_booked
                    has_more: false
                    next_page_token: null
                    next_cursor: cur_01HZX9K4M2W7B3T8
                    reset: false
                Bootstrap:
                  summary: القراءة من مؤشر فارغ
                  value:
                    added:
                      - id: 8f2b6d41-9c3a-4e57-b0d8-1a7e5c4f2963
                        account_id: a71f0c2e-5d38-4b96-a1c4-3e9f8d2b7a10
                        status: booked
                        pending_id: null
                        reverses_id: null
                        booking_date: '2026-11-19'
                        value_date: '2026-11-20'
                        transaction_date: null
                        effective_date: '2026-11-19'
                        amount: '-1210.00'
                        currency: EUR
                        direction: debit
                        description: RECIBO SEGURIDAD SOCIAL
                        counterparty:
                          name: ENTIDAD PUBLICA DE EJEMPLO
                          iban: ES0000000000000000005766
                          bic: null
                        remittance:
                          unstructured:
                            - RECIBO SEGURIDAD SOCIAL 10/2026
                          structured: null
                          reference: '0028123456789'
                        bank_transaction_code: PMNT-RDDT-ESDD
                        bank_reference: '2026111900012345'
                        identity_quality: bank_reference
                        end_to_end_id: NOTPROVIDED
                        mandate_id: ES-SS-000123
                        creditor_id: ES00ZZZ00000000
                        merchant_category_code: null
                        exchange: null
                        balance_after: '18250.34'
                        category: taxes_and_social_security
                        first_seen_at: '2026-11-20T06:00:12Z'
                        updated_at: '2026-11-20T06:00:12Z'
                      - id: 2c9e7a05-6b14-4d38-8f2a-b3d51e0c9a67
                        account_id: a71f0c2e-5d38-4b96-a1c4-3e9f8d2b7a10
                        status: booked
                        pending_id: null
                        reverses_id: null
                        booking_date: '2026-11-18'
                        value_date: '2026-11-18'
                        transaction_date: null
                        effective_date: '2026-11-18'
                        amount: '3450.00'
                        currency: EUR
                        direction: credit
                        description: TRANSFERENCIA FACTURA 2026-0418
                        counterparty:
                          name: CLIENTE DE EJEMPLO SL
                          iban: ES0000000000000000007891
                          bic: null
                        remittance:
                          unstructured:
                            - FRA 2026-0418
                          structured: null
                          reference: null
                        bank_transaction_code: PMNT-RCDT-ESCT
                        bank_reference: '2026111800009876'
                        identity_quality: bank_reference
                        end_to_end_id: 2026-0418
                        mandate_id: null
                        creditor_id: null
                        merchant_category_code: null
                        exchange: null
                        balance_after: '19460.34'
                        category: income
                        first_seen_at: '2026-11-19T06:00:10Z'
                        updated_at: '2026-11-19T06:00:10Z'
                    modified: []
                    removed: []
                    has_more: false
                    next_page_token: null
                    next_cursor: cur_01HZX9K4M2W7B3T8
                    reset: true
          headers:
            Cache-Control:
              description: '`no-store`.'
              schema:
                type: string
        '400':
          description: >-
            المؤشر أو رمز الصفحة غير صالح، أو أن أحد المعاملات خارج النطاق
            المسموح. يحدد `field` المعامل المقصود.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankDataError'
              examples:
                Invalid cursor:
                  summary: مؤشر الصفحة غير صالح
                  value:
                    code: invalid_cursor
                    message: The cursor or page token is not valid.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: cursor
                    next_action: null
                    retry_after: null
                Token for another read:
                  summary: token لقراءة أخرى
                  value:
                    code: page_token_mismatch
                    message: >-
                      The page token belongs to a different read. Restart with
                      the same filters.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: page_token
                    next_action: null
                    retry_after: null
                Invalid request:
                  summary: طلب غير صالح
                  value:
                    code: invalid_request
                    message: The request is not valid.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: limit
                    next_action: null
                    retry_after: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/BankDataAccessDenied'
        '404':
          description: المورد غير موجود في هذا التطبيق وهذه البيئة.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankDataError'
              examples:
                Not found:
                  summary: غير موجود
                  value:
                    code: not_found
                    message: The resource does not exist.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: null
                    next_action: null
                    retry_after: null
        '409':
          description: >-
            الاتصال لا يحتوي على بيانات قابلة للقراءة: إما أنه حُذف أو انتهت مدة
            الاحتفاظ به (`connection_not_active`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankDataError'
              examples:
                Not active:
                  summary: غير نشط
                  value:
                    code: connection_not_active
                    message: This connection is not active.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: null
                    next_action: create_link
                    retry_after: null
        '410':
          description: >-
            المؤشر أقدم من مدة الاحتفاظ بسجل التغييرات البالغة 90 يومًا، أو
            انتهت صلاحية رمز الصفحة. في حالة `cursor_expired` يتضمن النص
            `bootstrap: true`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankDataCursorError'
              examples:
                Cursor expired:
                  summary: ابدأ من جديد بمؤشر فارغ
                  value:
                    code: cursor_expired
                    message: >-
                      The cursor is older than the change log. Read again from
                      an empty cursor.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: cursor
                    next_action: restart_from_cursor
                    retry_after: null
                    bootstrap: true
                Page expired:
                  summary: أعد بدء القراءة من آخر مؤشر مخزّن
                  value:
                    code: page_expired
                    message: The page token expired. Restart the read.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: page_token
                    next_action: restart_read
                    retry_after: null
        '429':
          $ref: '#/components/responses/RateLimitedRead'
        '500':
          $ref: '#/components/responses/BankDataInternalError'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl
            'https://verification.didit.me/v3/bank/connections/5e1d2a70-3b94-4c1f-8a6e-d2f07b9c1e35/transactions/sync/?cursor=cur_01HZX9K4M2W7B3T8'
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.bank.sync_transactions(
                "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.bank.syncTransactions("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.Bank.SyncTransactions(ctx, \"11111111-2222-3333-4444-555555555555\", didit.BankSyncTransactionsParams{})\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.bank().syncTransactions("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->bank->syncTransactions('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.bank.sync_transactions("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.Bank.SyncTransactionsAsync("11111111-2222-3333-4444-555555555555");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    BankTransactionChanges:
      type: object
      description: >-
        التغييرات في معاملات الاتصال منذ مؤشر معيّن. المؤشر الفارغ يُرجع كل
        المعاملات الحالية بوصفها `added`. تعكس جميع صفحات القراءة الواحدة اللقطة
        نفسها، وتظهر التغييرات التي تحدث في الأثناء في القراءة التالية.
      properties:
        added:
          type: array
          items:
            $ref: '#/components/schemas/BankTransaction'
          description: >-
            المعاملات المطلوب إضافتها. في القراءة الأولى (بدون مؤشر، أو بعد
            `reset`) تشمل كل معاملة كانت موجودة في الربط عند بدء القراءة، مرة
            واحدة فقط وبحالتها الحالية، حتى إن جرت مزامنة أثناء التصفح. وفي
            القراءات اللاحقة تتضمن المعاملات الجديدة منذ مؤشرك، والمعاملة
            المسجّلة التي تحل محل معاملة معلّقة.
        modified:
          type: array
          items:
            $ref: '#/components/schemas/BankTransaction'
          description: >-
            المعاملات التي تغيّرت منذ مؤشرك، بحالتها الحالية. طبّق كل معاملة
            كعملية إدراج أو تحديث (upsert) بحسب `id`: المعاملة التي استلمتها
            بالفعل أثناء التصفح في القراءة الأولى تعود هنا إذا تغيّرت في
            الأثناء، ويصل هنا أيضاً تصحيح البنك.
        removed:
          type: array
          items:
            $ref: '#/components/schemas/BankRemovedTransaction'
          description: >-
            المعاملات التي لم تعد موجودة، مع `reason`. تجاهل `id` غير الموجود
            لديك: المعاملة التي حُذفت أثناء تصفح القراءة الأولى سُلّمت مرة واحدة
            بوصفها `added`، وتصل هنا في القراءة التالية.
        has_more:
          type: boolean
          description: >-
            `true` ما دامت هناك صفحات إضافية. لا تخزّن `next_cursor` إلا بعد
            استجابة تحمل `has_more: false`؛ وإذا فشل التصفح في منتصفه، فأعد
            البدء من المؤشر الذي خزّنته سابقاً.
        next_page_token:
          type: string
          description: يستمر في هذه القراءة ما دام `has_more` يساوي `true`.
          nullable: true
        next_cursor:
          type: string
          description: >-
            نقطة التحقق الدائمة لتدفق البيانات، وتُعاد فقط في الصفحة الأخيرة.
            قيمة غير شفافة ومرتبطة بالتطبيق والبيئة والاتصال. يمكن إعادة تشغيلها
            لمدة 90 يومًا. عند القراءة الأولى تمثل لحظة بدء القراءة، فيصل ما
            تغيّر في الأثناء مع القراءة التالية.
          nullable: true
        reset:
          type: boolean
          description: >-
            `true` في كل عملية تهيئة أولية، أي كل قراءة تبدأ من مؤشر فارغ:
            استبدل نسختك بالنتيجة بدلاً من الإضافة إليها.
      required:
        - added
        - modified
        - removed
        - has_more
        - next_page_token
        - next_cursor
        - reset
    BankDataError:
      type: object
      description: جسم الخطأ لكل عملية من عمليات بيانات البنك. جميع الحقول موجودة دائماً.
      properties:
        code:
          type: string
          enum:
            - ongoing_access_not_available
            - segment_not_available
            - window_not_available
            - history_window_ambiguous
            - redirect_url_not_registered
            - link_origin_not_allowed
            - bank_data_access_denied
            - connection_not_active
            - consent_expired
            - renewal_not_needed
            - renewal_window_expired
            - access_removed
            - refresh_limit_reached
            - cursor_expired
            - page_expired
            - invalid_cursor
            - page_token_mismatch
            - contract_rate_missing
            - insufficient_credits
            - invalid_request
            - not_found
            - internal_error
          description: >-
            رمز الخطأ بصيغة يمكن للآلة قراءتها. اعتمد على هذا الرمز في التفريع،
            ولا تعتمد على `message` أبداً.
        message:
          type: string
          description: شرح بلغة بسيطة للمطوّر. قد تتغير الصياغة؛ لا تحلّلها برمجياً.
        request_id:
          type: string
          description: معرّف هذا الطلب. اذكره عند التواصل مع الدعم.
        field:
          type: string
          description: >-
            حقل الطلب المطلوب تصحيحه، إذا كان الخطأ متعلقاً بحقل واحد. وإلا
            فتكون القيمة `null`.
          nullable: true
        next_action:
          type: string
          enum:
            - retry_later
            - renew_connection
            - create_link
            - restart_from_cursor
            - restart_read
            - top_up_balance
            - enable_bank_data_access
            - contact_support
            - null
          description: >-
            ما الذي ينبغي فعله تاليًا، حتى يتمكن العميل من التصرف دون تخمين.
            القيمة `null` عندما لا توجد خطوة تالية قياسية.
          nullable: true
        retry_after:
          type: integer
          description: >-
            عدد الثواني التي تنتظرها قبل إعادة المحاولة. يُضبط عند أخطاء حد
            المعدل والأخطاء المؤقتة، وإلا فهو `null`.
          nullable: true
      required:
        - code
        - message
        - request_id
        - field
        - next_action
        - retry_after
      example:
        code: ongoing_access_not_available
        message: >-
          This bank cannot keep access open. Use access one_time or choose
          another bank.
        request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
        field: institution_id
        next_action: create_link
        retry_after: null
    BankDataCursorError:
      allOf:
        - $ref: '#/components/schemas/BankDataError'
        - type: object
          properties:
            bootstrap:
              type: boolean
              description: >-
                يظهر مع `cursor_expired` وقيمته دائما `true`: ابدأ من جديد بقيمة
                `cursor` فارغة، واستبدل نسختك المخزنة بالنتيجة.
      description: >-
        نص استجابة `410` لخلاصة التغييرات. مع `cursor_expired` يتضمن `bootstrap:
        true`: أعد قراءة الخلاصة من مؤشر فارغ، واستبدل نسختك من معاملات الاتصال
        بهذه النتيجة بدلاً من إضافتها إليها. مع `page_expired` لا يوجد
        `bootstrap`: ابدأ من آخر مؤشر خزّنته.
    BankTransaction:
      type: object
      description: >-
        حركة واحدة على الحساب. أي حقل لا يرسله البنك يكون `null`؛ وتسرد إمكانات
        المؤسسة الحقول التي يُعرف أن البنك يرسلها.
      properties:
        id:
          type: string
          description: >-
            معرّف Didit مُبهم، يُخزَّن عند أول ظهور. تحتفظ الحركة نفسها بمعرّفها
            عبر القراءات والمزامنات والتجديدات. يبيّن `identity_quality` مدى قوة
            هذا الضمان.
          format: uuid
        account_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - booked
            - pending
          description: >-
            للمعاملة المعلقة معرّف خاص بها. عندما يسجّلها البنك، تحمل المعاملة
            المسجّلة `pending_id` حيث يربط البنك بينهما، وتظهر المعاملة المعلقة
            في `removed` مع `reason: pending_booked`.
        pending_id:
          type: string
          description: >-
            المعاملة المعلّقة التي حلّت محل هذه المعاملة. تُحدد فقط عندما
            يربطهما البنك، ولا تُخمَّن أبدًا.
          format: uuid
          nullable: true
        reverses_id:
          type: string
          description: >-
            المعاملة التي تعكسها هذه المعاملة، عندما يربط البنك بينهما.
            والمعاملة العكسية معاملة جديدة.
          format: uuid
          nullable: true
        booking_date:
          type: string
          format: date
          nullable: true
        value_date:
          type: string
          format: date
          nullable: true
        transaction_date:
          type: string
          format: date
          nullable: true
        effective_date:
          type: string
          description: >-
            التاريخ الذي تستخدمه مرشحات التاريخ كما يعرضه البنك بتوقيته الخاص
            دون أي تحويل: بالنسبة للمعاملة المُرحّلة فهو تاريخ ترحيلها، وإلا
            فتاريخ القيمة، وإلا فتاريخ رصدها لأول مرة؛ وبالنسبة للمعاملة
            المعلّقة فهو تاريخ المعاملة، وإلا فتاريخ رصدها لأول مرة.
          format: date
        amount:
          type: string
          description: مبلغ موقّع كسلسلة عشرية. السالب يعني مبلغاً خارجاً.
          pattern: ^-?\d+(\.\d+)?$
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: رمز العملة وفق ISO 4217.
        direction:
          type: string
          enum:
            - credit
            - debit
          description: يكرر إشارة `amount`.
        description:
          type: string
          nullable: true
        counterparty:
          $ref: '#/components/schemas/BankTransactionCounterparty'
        remittance:
          $ref: '#/components/schemas/BankTransactionRemittance'
        bank_transaction_code:
          type: string
          nullable: true
        bank_reference:
          type: string
          description: >-
            مرجع القيد الثابت لدى المصرف حيثما يوفره. تكون القيمة `null` بخلاف
            ذلك، ولا تُختلق أبدًا.
          nullable: true
        identity_quality:
          type: string
          enum:
            - bank_reference
            - route_id
            - derived
          description: >-
            كيفية مطابقة `id`. `bank_reference` و`route_id` ثابتان. يُطابَق
            `derived` حسب المحتوى: يبقى ثابتاً طالما يواصل البنك الإبلاغ عن
            القيد دون تغيير، وقد يظهر تصحيح من البنك كعنصر `removed` وعنصر
            `added`.
        end_to_end_id:
          type: string
          nullable: true
        mandate_id:
          type: string
          nullable: true
        creditor_id:
          type: string
          nullable: true
        merchant_category_code:
          type: string
          nullable: true
        exchange:
          type: object
          nullable: true
          description: تفاصيل تحويل العملات حيث يوفرها البنك.
          properties:
            source_amount:
              type: string
              pattern: ^-?\d+(\.\d+)?$
              nullable: true
            source_currency:
              type: string
              nullable: true
            rate:
              type: string
              pattern: ^-?\d+(\.\d+)?$
              nullable: true
        balance_after:
          type: string
          description: الرصيد بعد المعاملة، عندما يوفره البنك.
          pattern: ^-?\d+(\.\d+)?$
          nullable: true
        category:
          type: string
          description: تصنيف Didit الخاص، عند انطباقه.
          nullable: true
        first_seen_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - account_id
        - status
        - pending_id
        - reverses_id
        - booking_date
        - value_date
        - transaction_date
        - effective_date
        - amount
        - currency
        - direction
        - description
        - counterparty
        - remittance
        - bank_transaction_code
        - bank_reference
        - identity_quality
        - end_to_end_id
        - mandate_id
        - creditor_id
        - merchant_category_code
        - exchange
        - balance_after
        - category
        - first_seen_at
        - updated_at
    BankRemovedTransaction:
      type: object
      properties:
        id:
          type: string
          description: معرّف المعاملة التي لم تعد هي الحالية.
          format: uuid
        reason:
          type: string
          enum:
            - pending_booked
            - pending_expired
            - bank_removed
            - access_removed
          description: >-
            `pending_booked`: رحّله البنك، والمعاملة المرحَّلة موجودة في
            `added`. `pending_expired`: معاملة معلقة توقف البنك عن الإبلاغ عنها.
            `bank_removed`: أزالها البنك. `access_removed`: خرج الحساب من
            الموافقة.
      required:
        - id
        - reason
    RateLimitBudgetError:
      type: object
      description: >-
        تُرجع فقط عند رفض ميزانية وسيط تحديد المعدل. أخطاء 429 الأخرى، بما في
        ذلك تعارضات idempotency والحدود الخاصة بنقطة النهاية، لا تضمن هذه الحقول
        الوصفية.
      required:
        - detail
        - reference
        - limit
        - remaining
        - reset
        - window_seconds
      properties:
        detail:
          type: string
          description: رسالة رفض الميزانية الحالية المقروءة للإنسان.
        reference:
          type: string
          pattern: ^RL-[0-9a-f]{32}$
          description: >-
            مرجع الدعم المعتم: RL- متبوعة بـ 32 حرفًا سداسيًا عشريًا صغيرًا من
            UUID.
        limit:
          type: integer
          description: الميزانية للنطاق الذي تجاوز الحد؛ تساوي X-RateLimit-Limit.
        remaining:
          type: integer
          minimum: 0
          description: >-
            الميزانية المتبقية، محدودة بحيث لا تقل عن الصفر؛ تساوي
            X-RateLimit-Remaining.
        reset:
          type: integer
          format: int64
          description: >-
            وقت إعادة تعيين النافذة بالثواني منذ حقبة Unix، ويساوي
            X-RateLimit-Reset.
        window_seconds:
          type: integer
          description: >-
            مدة النافذة الثابتة بالثواني، وليست الفترة المتبقية للانتظار. يجب
            احترام Retry-After قبل إعادة المحاولة.
      example:
        detail: >-
          Write request rate limit exceeded. You can make up to 300 requests per
          minute.
        reference: RL-00000000000040008000000000000001
        limit: 300
        remaining: 0
        reset: 1794358860
        window_seconds: 60
    BankTransactionCounterparty:
      type: object
      properties:
        name:
          type: string
          nullable: true
        iban:
          type: string
          nullable: true
        bic:
          type: string
          nullable: true
      required:
        - name
        - iban
        - bic
    BankTransactionRemittance:
      type: object
      properties:
        unstructured:
          type: array
          items:
            type: string
        structured:
          type: string
          nullable: true
        reference:
          type: string
          nullable: true
      required:
        - unstructured
        - structured
        - reference
  responses:
    Unauthorized:
      description: غير مُصرَّح به
      content:
        application/json:
          examples:
            Invalid API Key:
              summary: مفتاح API غير صالح
              value:
                detail: Invalid API Key.
    BankDataAccessDenied:
      description: >-
        لا يملك مفتاح API صلاحية بيانات البنك (`bank-data`)، أو، بالنسبة
        للبيانات الخام في تطبيق إنتاجي، يكون الإعداد "Bank data in the API"
        متوقفا. بيانات البنك ليست جزءا من الوصول الكامل: يُرفض بهذا النص مفتاح
        الوصول الكامل، ومفتاح مقيّد بموارد أخرى، وطلب مصادق عليه دون مفتاح API
        (بيانات اعتماد العميل عند طلب البيانات الخام)، لذا أنشئ مفتاحا وامنحه
        الصلاحية صراحة. يحدث الرفض قبل أي بحث، لذا لا يدل على وجود الكائن أو
        عدمه.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BankDataError'
          examples:
            Bank data not allowed:
              summary: بيانات البنك غير مسموح بها
              value:
                code: bank_data_access_denied
                message: >-
                  Bank data calls need an API key that carries the Bank data
                  permission.
                request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                field: null
                next_action: enable_bank_data_access
                retry_after: null
    RateLimitedRead:
      description: >-
        تجاوزت ميزانية القراءة الخاصة بالوسيط. التزم بالرأس Retry-After قبل
        إعادة المحاولة.
      headers:
        Retry-After:
          $ref: '#/components/headers/BudgetRetryAfter'
        X-RateLimit-Scope:
          $ref: '#/components/headers/BudgetXRateLimitScope'
        X-RateLimit-Limit:
          $ref: '#/components/headers/BudgetXRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/BudgetXRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/BudgetXRateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitBudgetError'
          example:
            detail: >-
              GET request rate limit exceeded. You can make up to 600 requests
              per minute.
            reference: RL-00000000000040008000000000000001
            limit: 600
            remaining: 0
            reset: 1794358860
            window_seconds: 60
    BankDataInternalError:
      description: >-
        حدث خطأ من جهة Didit. أي خطأ غير متوقع تحت `/v3/bank/` يُعاد بصيغة خطأ
        Bank، وليس بصفحة HTML أبداً: أرفق `request_id` عند التواصل مع الدعم.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BankDataError'
          examples:
            Internal error:
              summary: خطأ غير متوقع
              value:
                code: internal_error
                message: >-
                  Something went wrong on our side. Quote the request_id to
                  support.
                request_id: 3f6a1c8e92b54d07a1e38c4b7f0d2e59
                field: null
                next_action: contact_support
                retry_after: null
  headers:
    BudgetRetryAfter:
      description: >-
        عدد الثواني للانتظار، مقرّباً إلى أعلى حتى بداية النافذة التالية. يظهر
        في حالات رفض ميزانية الوسيط.
      schema:
        type: integer
    BudgetXRateLimitScope:
      description: النطاق الذي تجاوز ميزانيته. يظهر في حالات رفض ميزانية الوسيط.
      schema:
        type: string
    BudgetXRateLimitLimit:
      description: >-
        الميزانية المخصصة للنطاق الذي تم تجاوزه؛ وتساوي حد جسم الطلب. تظهر في
        حالات الرفض الصادرة عن ميزانية البرمجية الوسيطة.
      schema:
        type: integer
    BudgetXRateLimitRemaining:
      description: >-
        الميزانية المتبقية، محدودة بحيث لا تقل عن الصفر؛ تساوي remaining في
        الجسم. تظهر في حالات رفض الميزانية من الوسيط.
      schema:
        type: integer
    BudgetXRateLimitReset:
      description: >-
        وقت إعادة التعيين بالثواني منذ حقبة Unix؛ يساوي قيمة reset في جسم
        الاستجابة. يظهر في حالات رفض ميزانية الوسيط.
      schema:
        type: integer
  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، ويتلقى المفتاح الذي لا
        يملك صلاحية كتابة الجلسات روابط الجلسات والرموز بقيمة null. راجع
        https://docs.didit.me/console/api-keys.

````

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