> ## 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

> أعد التحقق من صحة تقرير goAML XML وإنشاء ملف PDF الخاص به، ثم ارفع الملفين وحدّد تنبيهات SAR/STR/TFR كمُقدَّمة. تقدّمه Didit.



موجّه API لإنهاء التقرير
        نسخ الموجّه إلى الحافظة



      
      

\<pre>

\`Finalize a FIU report through the Management API.

Endpoint:
POST https://verification.didit.me/v3/organization/{organization_id}/application/{application_id}/regulatory-reports/{report_uuid}/finalize/

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

Goal:
\- Re-validate the report, then render the goAML XML and a PDF, upload both to S3, and mark the report FINALIZED (irreversible for edits; deleting it later requires an explicit confirmation).
\- On SAR, STR, and TFR reports, this also moves the case's transaction alerts from Pending SAR to SAR filed.

Example call:
curl -X POST "https://verification.didit.me/v3/organization/{organization_id}/application/{application_id}/regulatory-reports/{report_uuid}/finalize/" \
-H "x-api-key: YOUR_API_KEY"

Response 200: RegulatoryReportDetail with status "FINALIZED", finalized_at set. Fetch files via GET .../download-url/?file=xml|pdf.

Failure modes:
\- 400 - validation failed: {"detail": "Report failed validation.", "errors": [{"field": "rentity_id", "message": "Reporting entity ID is required."}, ...]}. errors is an array of {field, message} objects.
\- 409 - report is not in a finalizable state (e.g. already finalized).
\- 401/403 - auth/permission errors (requires write:cases).

Side effects: generates and stores XML + PDF in S3; updates linked transaction alerts' SAR-filed marking; irreversible for edits. A finalized report can still be deleted with confirm_delete: true; see Delete Report.

For the full integration shape, see /integration/integration-prompt.`

\</pre>



      
      

الصق في

إنهاء التقرير. هذه نقطة اللاعودة للتعديلات: لا يمكن تعديل التقرير الذي تم إنهاؤه، ويمكن تنزيله فقط. ومع ذلك، ما زال بالإمكان حذفه باستخدام `confirm_delete: true`؛ راجع [حذف التقرير](https://docs.didit.me/ar/management-api/regulatory-reports/delete.md).## ذات صلة- [تنزيل التقرير](https://docs.didit.me/ar/management-api/regulatory-reports/download-url.md)
- [حذف التقرير](https://docs.didit.me/ar/management-api/regulatory-reports/delete.md)
- [التحقق من صحة التقرير](https://docs.didit.me/ar/management-api/regulatory-reports/validate.md)
- [طباعة الحالة](https://docs.didit.me/ar/management-api/cases/print.md)


## OpenAPI

````yaml ar/openapi-25.json POST /v3/organization/{organization_id}/application/{application_id}/regulatory-reports/{report_uuid}/finalize/
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/organization/{organization_id}/application/{application_id}/regulatory-reports/{report_uuid}/finalize/:
    post:
      tags:
        - Regulatory Reports
      summary: إنهاء التقرير
      description: >-
        إعادة التحقق، ثم إنشاء ملفي goAML بصيغة XML وPDF ورفعهما إلى S3. في
        تقارير SAR/STR/TFR، يؤدي هذا أيضاً إلى نقل تنبيهات معاملات الحالة من
        Pending SAR إلى SAR filed.
      operationId: finalize_regulatory_report
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: UUID الخاص بالمؤسسة.
        - name: application_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: معرّف UUID للتطبيق.
        - name: report_uuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
            example: 5ec00000-0000-4000-8000-000000000007
          description: معرّف UUID للتقرير.
      responses:
        '200':
          description: تم إنهاء التقرير؛ تم تعيين xml_s3_key وpdf_s3_key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegulatoryReportDetail'
        '400':
          description: فشل التقرير في التحقق من الصحة.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                        message:
                          type: string
        '409':
          description: التقرير ليس في حالة قابلة للإنهاء.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X POST
            'https://verification.didit.me/v3/organization/11111111-2222-3333-4444-555555555555/application/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/regulatory-reports/5ec00000-0000-4000-8000-000000000007/finalize/'
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID
            # and DIDIT_APPLICATION_ID.
            client = Didit()

            result = client.regulatory_reports.finalize(
                "5ec00000-0000-4000-8000-000000000007",
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: >-
            import Didit from "@didit-protocol/sdk-node";


            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            const didit = new Didit();


            const result = await
            didit.regulatoryReports.finalize("5ec00000-0000-4000-8000-000000000007");

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID\n// and DIDIT_APPLICATION_ID.\nclient := didit.NewClient()\n\nresult, err := client.RegulatoryReports.Finalize(ctx, \"5ec00000-0000-4000-8000-000000000007\")\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_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            Didit client = new Didit();


            var result =
            client.regulatoryReports().finalize_("5ec00000-0000-4000-8000-000000000007");

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


            require 'vendor/autoload.php';


            use Didit\DiditClient;


            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            $didit = new DiditClient();


            $result =
            $didit->regulatoryReports->finalize('5ec00000-0000-4000-8000-000000000007');

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


            # Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            # and DIDIT_APPLICATION_ID.

            didit = Didit::Client.new


            result =
            didit.regulatory_reports.finalize("5ec00000-0000-4000-8000-000000000007")

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

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            using var client = new DiditClient();


            var result = await
            client.RegulatoryReports.FinalizeAsync("5ec00000-0000-4000-8000-000000000007");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    RegulatoryReportDetail:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
        case_uuid:
          type: string
          format: uuid
        case_number:
          type: string
          nullable: true
        report_type:
          type: string
          enum:
            - SAR
            - STR
            - CTR
            - TTR
            - UTR
            - IFT
            - CBR
            - TFR
        report_type_display:
          type: string
        report_code:
          type: string
          description: رمز تقرير goAML المشتق من report_type، مثل STR، وCTR، وBCR.
        report_number:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - DRAFT
            - VALIDATED
            - FINALIZED
        status_display:
          type: string
        jurisdiction:
          type: string
          minLength: 2
          maxLength: 2
        rentity_id:
          type: string
          nullable: true
          description: معرّف الجهة المُبلِغة الصادر عن وحدة الاستخبارات المالية (FIU).
        rentity_branch:
          type: string
          nullable: true
        submission_code:
          type: string
          enum:
            - E
            - M
        entity_reference:
          type: string
          nullable: true
        fiu_ref_number:
          type: string
          nullable: true
        currency_code_local:
          type: string
          minLength: 3
          maxLength: 3
          nullable: true
        submission_date:
          type: string
          format: date-time
          nullable: true
        reporting_person:
          type: object
        location:
          type: object
        reason:
          type: string
          nullable: true
        action:
          type: string
          nullable: true
        activity:
          type: string
          nullable: true
        narrative:
          type: object
          description: أقسام السرد للأسئلة الخمسة (Five Ws).
          properties:
            who:
              type: string
            what:
              type: string
            when:
              type: string
            where:
              type: string
            why:
              type: string
            how:
              type: string
        report_indicators:
          type: array
          items:
            type: string
        included_fields:
          type: array
          items:
            type: string
        transactions:
          type: array
          items:
            type: string
            format: uuid
        validation_errors:
          type: array
          description: نتيجة آخر عملية تحقق من الصحة؛ كل إدخال هو كائن {field, message}.
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
        validated_at:
          type: string
          format: date-time
          nullable: true
        finalized_at:
          type: string
          format: date-time
          nullable: true
        created_by_email:
          type: string
          nullable: true
        created_by_name:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  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.