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

> 使用 Didit 可通过 UUID 永久删除受监控的交易，也可清空应用中的全部交易；已定稿的报告会阻止删除。



批量删除交易 API 提示词
        将提示词复制到剪贴板



      
      

\<pre>

\`Delete monitored transactions through the Management API.

Endpoint:
DELETE https://verification.didit.me/v3/organization/{organization_id}/application/{application_id}/transactions/delete/

Authentication:
Use the x-api-key header with my Didit API key. The key must carry write:transactions.

Request body — provide one selector:
\{"transaction_uuids": ["abcdef12-3456-7890-abcd-ef1234567890"]}
or
\{"delete_all": true}

Example call:
curl -X DELETE "https://verification.didit.me/v3/organization/{organization_id}/application/{application_id}/transactions/delete/" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"transaction_uuids": ["abcdef12-3456-7890-abcd-ef1234567890"]}'

Response 204: the selected transactions are deleted.

What is deleted with each transaction:
\- Its parties, tags, notes, payment method links, documents and every stored version of their files.
\- Its rule runs, alerts, provider results, network snapshot and Travel Rule data.
Cases, people and companies stay; their link to the deleted transaction is cleared. Draft regulatory reports stop listing it and are rebuilt without it. Deletion is permanent and cannot be undone.

Failure modes:
\- 400 - no selector supplied: {"transaction_uuids": ["This field is required unless delete_all is true."]}.
\- 409 - at least one selected transaction is listed in a finalized regulatory report. Nothing is deleted. The body has code: in_filed_report and transactions[] with uuid, transaction_id and reports[].
\- 403 - the key cannot delete transactions (requires write:transactions).

After deletion:
Delete the reports named in the 409 response, then repeat this request. See Delete Report.

WARNING — delete_all: true: deletes every transaction in the application with no confirmation and no undo.

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

\</pre>



      
      

粘贴到

按 UUID 永久删除受监控的交易，或一次性删除全部交易。## 删除范围被删除的交易会连同仅属于它的记录一起删除：其当事方、标签、备注、支付方式关联、证件及其文件的每个已存储版本、规则运行记录、警报、服务商结果、网络快照和 Travel Rule 数据。案件、人员和企业会保留，但它们与被删除交易之间的关联会被清除。草稿状态的监管报告会停止列出被删除的交易，并在不含该交易的情况下重新生成。删除是永久性的，且无法撤销。## 选择要删除的交易只能发送一个选择器：| 字段 | 类型 | 描述 |
| - | - | - |
| `transaction_uuids` | UUID\[] | 要删除的 Didit 交易 UUID。除非 `delete_all` 为 `true`，否则必填。 |
| `delete_all` | boolean | 删除应用中的每笔交易。`transaction_uuids` 将被忽略。 |> [!WARNING]
>
> `delete_all: true` 会删除应用中的每笔交易。没有确认步骤，也无法撤销。## 受已定稿报告阻止如果所选的任一交易被列入已定稿的监管报告，整个请求将返回 `409`，且不会删除任何交易：```json theme={null}
{
  "detail": "Transactions included in a filed regulatory report cannot be deleted.",
  "code": "in_filed_report",
  "transactions": [
    {
      "uuid": "abcdef12-3456-7890-abcd-ef1234567890",
      "transaction_id": "your-txn-2026-05-17-001",
      "reports": [
        {
          "uuid": "5ec00000-0000-4000-8000-000000000007",
          "report_number": "SAR-0001",
          "report_type": "SAR",
          "case_uuid": "c1a5e000-0000-4000-8000-000000000001"
        }
      ]
    }
  ]
}
```使用 [删除报告](https://docs.didit.me/zh/management-api/regulatory-reports/delete.md) 删除每份报告，然后重新发起此请求。如果您选择了多笔交易，请移除被阻止的交易，或先删除其所在的报告。## 相关内容- [列出交易](https://docs.didit.me/zh/management-api/transactions/list.md)
- [获取交易](https://docs.didit.me/zh/management-api/transactions/get.md)
- [删除报告](https://docs.didit.me/zh/management-api/regulatory-reports/delete.md)


## OpenAPI

````yaml zh/openapi-25.json DELETE /v3/organization/{organization_id}/application/{application_id}/transactions/delete/
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}/transactions/delete/:
    delete:
      tags:
        - Transactions
      summary: 批量删除交易
      description: >-
        永久删除一笔或多笔交易。使用 `transaction_uuids` 进行选择，或使用 `delete_all: true`
        删除应用中的所有交易。


        删除交易时，仅属于该交易的记录也会一并删除：包括其交易方、标签、备注、支付方式关联、证件及其实体文件存储的所有版本、规则运行记录、警报、提供商结果、网络快照和
        Travel Rule
        数据。案件、人员和企业将予以保留；它们与已删除交易的关联将被清除。法规报告草稿将不再列出该交易，并会在不包含该交易的情况下重新生成。删除操作是永久且不可逆的；没有撤销
        endpoint。


        如果所选交易中有任何一笔已列入已定稿的法规报告中，整个请求将被拒绝并返回 `409`，且不会删除任何内容。响应体使用 `code:
        in_filed_report`，并指明每笔交易以及列出该交易的报告。请删除这些报告，然后重试该请求。
      operationId: batch_delete_transactions
      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。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              oneOf:
                - title: Selected transactions
                  required:
                    - transaction_uuids
                  properties:
                    transaction_uuids:
                      type: array
                      items:
                        type: string
                        format: uuid
                      description: 要删除的 Didit 交易 UUID。除非 `delete_all` 为 true，否则为必填项。
                      minItems: 1
                    delete_all:
                      type: boolean
                      enum:
                        - false
                      default: false
                      description: 当您使用 `transaction_uuids` 选择交易时，请省略此参数或传入 `false`。
                - title: All transactions
                  required:
                    - delete_all
                  properties:
                    delete_all:
                      type: boolean
                      enum:
                        - true
                      description: 删除应用中的所有交易。`transaction_uuids` 会被忽略。
                    transaction_uuids:
                      type: array
                      items:
                        type: string
                        format: uuid
                      description: 当 `delete_all` 为 true 时被忽略。
            examples:
              Selected transactions:
                value:
                  transaction_uuids:
                    - abcdef12-3456-7890-abcd-ef1234567890
                    - 12345678-90ab-cdef-1234-567890abcdef
              All transactions:
                value:
                  delete_all: true
      responses:
        '204':
          description: 所选交易已删除。
        '400':
          description: 未提供交易选择器。
          content:
            application/json:
              schema:
                type: object
                properties:
                  transaction_uuids:
                    type: array
                    items:
                      type: string
              example:
                transaction_uuids:
                  - This field is required unless delete_all is true.
        '403':
          description: 该 API 密钥无法删除交易。该 endpoint 需要 `write:transactions` 权限。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
        '409':
          description: 所选交易中至少有一笔列在已定稿的监管报告中。未删除任何内容。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InFiledReportError'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl (selected transactions)
          source: >-
            curl -X DELETE
            'https://verification.didit.me/v3/organization/11111111-2222-3333-4444-555555555555/application/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/transactions/delete/'
            \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"transaction_uuids": ["abcdef12-3456-7890-abcd-ef1234567890"]}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

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

            client.transactions.batch_delete(
                body={
                    "transaction_uuids": ["abcdef12-3456-7890-abcd-ef1234567890", "12345678-90ab-cdef-1234-567890abcdef"],
                },
            )
        - 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();

            await didit.transactions.batchDelete({
              transaction_uuids: ["abcdef12-3456-7890-abcd-ef1234567890", "12345678-90ab-cdef-1234-567890abcdef"],
            });
        - lang: java
          label: Java
          source: >-
            import java.util.List;

            import me.didit.Didit;

            import me.didit.types.TransactionsBatchDeleteParams;


            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            Didit client = new Didit();


            client.transactions().batchDelete(TransactionsBatchDeleteParams.builder()
                    .putAdditionalProperty("transaction_uuids", List.of("abcdef12-3456-7890-abcd-ef1234567890", "12345678-90ab-cdef-1234-567890abcdef"))
                    .build());
        - 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();

            $didit->transactions->batchDelete([
                'transaction_uuids' => ['abcdef12-3456-7890-abcd-ef1234567890', '12345678-90ab-cdef-1234-567890abcdef'],
            ]);
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID
            # and DIDIT_APPLICATION_ID.
            didit = Didit::Client.new

            didit.transactions.batch_delete(
              body: {
                transaction_uuids: ["abcdef12-3456-7890-abcd-ef1234567890", "12345678-90ab-cdef-1234-567890abcdef"],
              }
            )
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using Didit;


            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            using var client = new DiditClient();


            await client.Transactions.BatchDeleteAsync(new
            TransactionsBatchDeleteParams

            {
                TransactionUuids = new string[] { "abcdef12-3456-7890-abcd-ef1234567890", "12345678-90ab-cdef-1234-567890abcdef" },
            });
components:
  schemas:
    InFiledReportError:
      type: object
      description: 由于所选数据包含在已定稿的监管报告中，删除被拒绝。没有任何内容被删除。请删除该报告，然后重试请求。
      required:
        - detail
        - code
      properties:
        detail:
          type: string
        code:
          type: string
          enum:
            - in_filed_report
          description: 因最终监管报告阻止删除的稳定错误代码。
        reports:
          type: array
          items:
            $ref: '#/components/schemas/FiledRegulatoryReport'
          description: 阻止删除个人、企业、案件或会话的报告。
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/FiledReportTransaction'
          description: 阻止删除该交易的交易列表，每笔均附带列出它的报告。
    FiledRegulatoryReport:
      type: object
      description: 已定稿的监管报告，阻止了请求的删除操作。
      required:
        - uuid
        - report_number
        - report_type
        - case_uuid
      properties:
        uuid:
          type: string
          format: uuid
          description: 报告 UUID。
        report_number:
          type: string
          description: 在控制台中显示的报告编号（例如 SAR-0001）。
        report_type:
          type: string
          enum:
            - SAR
            - STR
            - CTR
            - TTR
            - UTR
            - IFT
            - CBR
            - TFR
          description: 监管报告类型。
        case_uuid:
          type: string
          format: uuid
          description: 该报告所属的案件。
    FiledReportTransaction:
      type: object
      description: 因已定稿的监管报告列出而无法删除的交易。
      required:
        - uuid
        - transaction_id
        - reports
      properties:
        uuid:
          type: string
          format: uuid
          description: Didit 交易 UUID。
        transaction_id:
          type: string
          description: 创建交易时提供的交易标识符。
        reports:
          type: array
          items:
            $ref: '#/components/schemas/FiledRegulatoryReport'
          description: 列出此交易的已定稿报告。
  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.