> ## 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 从案件创建 FIU 报告

> 基于案件生成 SAR、STR、CTR 或其他 FIU 报告草稿，并根据模板及案件的主体和交易自动填充内容。Didit 提供相关 API。



从案件创建报告 API 提示
        将提示词复制到剪贴板



      
      

\<pre>

\`Create a draft FIU report from a case through the Management API.

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

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

Request body (all optional if a template is given):
\{
"template": "<report-template-uuid>",   // seeds rentity_id, submission_code, currency_code_local, etc.
"report_type": "SAR",                     // required if no template
"jurisdiction": "US",                     // required if no template
"transactions": ["<transaction-uuid>"]    // optional - defaults to the case's linked transactions
}

Behavior:
\- Draft is auto-populated from the template (if given) plus the case's subject, linked transactions, and a narrative structured around the five Ws (who/what/when/where/why/how) for SAR/STR/TFR.
\- Status starts as DRAFT. Call validate then finalize next.

Example call:
curl -X POST "https://verification.didit.me/v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/regulatory-reports/" \
-H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"template": "<uuid>"}'

Response 201: RegulatoryReportDetail with status "DRAFT".

Failure modes:
\- 400 - the referenced template was not found.
\- 401/403 - auth/permission errors (requires write:cases).

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

\</pre>



      
      

粘贴到

为某个案件创建一份草稿报告。如果您已打开该案件，请优先使用此接口，而不是独立的创建 endpoint：它可以省略 `template`，并直接推导 `report_type` 和 `jurisdiction`。## 相关内容- [列出报告](https://docs.didit.me/zh/management-api/regulatory-reports/list.md)
- [验证报告](https://docs.didit.me/zh/management-api/regulatory-reports/validate.md)
- [定稿报告](https://docs.didit.me/zh/management-api/regulatory-reports/finalize.md)
- [删除报告](https://docs.didit.me/zh/management-api/regulatory-reports/delete.md)


## OpenAPI

````yaml zh/openapi-25.json POST /v3/organization/{organization_id}/application/{application_id}/cases/{case_uuid}/regulatory-reports/
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}/cases/{case_uuid}/regulatory-reports/:
    post:
      tags:
        - Regulatory Reports
      summary: 从案件创建报告
      description: >-
        为案件创建 FIU 报告草稿：状态为 DRAFT，根据可选模板以及案件的主体、关联交易和叙述自动填充。先验证后定稿，以生成 goAML XML
        和 PDF。
      operationId: create_case_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: case_uuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
            example: c1a5e000-0000-4000-8000-000000000001
          description: 案件 UUID。
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                report_type:
                  type: string
                  enum:
                    - SAR
                    - STR
                    - CTR
                    - TTR
                    - UTR
                    - IFT
                    - CBR
                    - TFR
                  description: 除非提供了模板，否则为必填项；否则使用模板的 report_type。
                jurisdiction:
                  type: string
                  minLength: 2
                  maxLength: 2
                  description: 除非提供了模板，否则为必填项。
                template:
                  type: string
                  format: uuid
                  nullable: true
                  description: 报告模板 UUID；在合并案件衍生数据之前，其 field_config 用于初始化草稿。
                transactions:
                  type: array
                  items:
                    type: string
                    format: uuid
                  nullable: true
                  description: 要附加的交易；默认为该案件关联的交易。
                rentity_id:
                  type: string
                  nullable: true
                rentity_branch:
                  type: string
                  nullable: true
                submission_code:
                  type: string
                  enum:
                    - E
                    - M
                  default: E
                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
                  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
            example:
              template: 7ec00000-0000-4000-8000-000000000006
      responses:
        '201':
          description: 草稿报告已创建。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegulatoryReportDetail'
        '400':
          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/cases/c1a5e000-0000-4000-8000-000000000001/regulatory-reports/'
            \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"template": "7ec00000-0000-4000-8000-000000000006"}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

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

            result = client.cases.regulatory_reports.create(
                "c1a5e000-0000-4000-8000-000000000001",
                template="7ec00000-0000-4000-8000-000000000006",
            )
            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.cases.regulatoryReports.create("c1a5e000-0000-4000-8000-000000000001",
            {
              template: "7ec00000-0000-4000-8000-000000000006",
            });

            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.Cases.RegulatoryReports.Create(ctx, \"c1a5e000-0000-4000-8000-000000000001\", didit.CasesRegulatoryReportsCreateParams{\n\tTemplate: didit.String(\"7ec00000-0000-4000-8000-000000000006\"),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;

            import me.didit.types.CasesRegulatoryReportsCreateParams;


            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            Didit client = new Didit();


            var result =
            client.cases().regulatoryReports().create("c1a5e000-0000-4000-8000-000000000001",
            CasesRegulatoryReportsCreateParams.builder()
                    .template("7ec00000-0000-4000-8000-000000000006")
                    .build());
            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->cases->regulatoryReports->create('c1a5e000-0000-4000-8000-000000000001',
            [
                'template' => '7ec00000-0000-4000-8000-000000000006',
            ]);

            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.cases.regulatory_reports.create(
              "c1a5e000-0000-4000-8000-000000000001",
              template: "7ec00000-0000-4000-8000-000000000006"
            )
            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.Cases.RegulatoryReports.CreateAsync("c1a5e000-0000-4000-8000-000000000001",
            new CasesRegulatoryReportsCreateParams

            {
                Template = "7ec00000-0000-4000-8000-000000000006",
            });

            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: 从 report_type 派生的 goAML 报告代码，例如 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 签发的报告实体 ID。
        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: 5W 叙述部分。
          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 密钥，可在 Business Console 的“开发者 -> API
        密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域：针对每个资源设为无权限、只读或读写，限定于特定工作流或已通过的会话、限定于
        IP 地址列表，以及设置到期日期。401 表示密钥错误、已撤销或已过期；403 表示未发送密钥、密钥无权访问该资源或操作，或请求来自其 IP
        列表之外的地址；在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF
        URL 将为 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.