> ## 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 API 创建充值发票，并在 45 天内以银行转账付款：额度 $1,000 至 $20,000，附银行信息和 PDF。

Didit 的充值发票 API 会签发一张美元发票。您的财务团队可在 45 天内从任何银行通过银行转账支付该发票，付款后发票会为您的余额增加额度。
它与用户在控制台的“充值”对话框中创建的发票相同。

创建充值发票提示
        将提示词复制到剪贴板



      
      

\<pre>

\`Goal: Create a Didit top-up invoice that the organization's finance team pays by bank transfer, so the balance is topped up without a card.

Endpoint: POST https://verification.didit.me/v3/billing/top-up-invoices/
Auth header: x-api-key: <DIDIT_API_KEY>
Idempotency-Key header: REQUIRED, 1 to 255 characters. One new key per invoice you intend to create; store it and reuse it ONLY to retry that same request.
Content-Type: application/json

Request body:
\- amount_in_dollars (number, REQUIRED): the credit to add, in USD, from 1,000 to 20,000, at most two decimals. Tax is added to the invoice when it applies.
\- po_number (string, optional, up to 140 characters): printed on the invoice.

curl:
curl -X POST 'https://verification.didit.me/v3/billing/top-up-invoices/' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: 0b8e6f4a-3c2d-4e1f-9a7b-5d6c8e2f1a30' \
-d '{"amount_in_dollars": 5000, "po_number": "PO-88213"}'

Response 201: the invoice { id, lane: "bank_transfer", status, credit_amount, total, tax, currency, amount_received, amount_credited, amount_open, invoice_number, hosted_invoice_url, invoice_pdf, po_number, due_at, confirmed_at, closed_at, created_at, bank_details: { currency, amount_due, account_holder_name, bank_name, account_number, routing_number, swift_code, reference } or null }

Before telling anyone to pay, read status and amount_open: a retry with the same key returns the same invoice in its CURRENT state, even paid, cancelled or expired. Give payment instructions ONLY while status is open or part_paid and amount_open is above 0.
To pay: transfer amount_open (not credit_amount: total includes tax) to bank_details, with invoice_number as the reference. routing_number is for ACH and US wires, swift_code for international wires. If bank_details is null, use hosted_invoice_url. The billing contacts also receive the invoice by email.
Credit: only what arrives is added, when it arrives. A part payment adds credit in proportion to the share of total it pays; the rest stays open with the same reference until due_at (45 days after issue). After due_at the status is expired; a transfer that still arrives with the reference is added for what it pays.
Follow it with GET /v3/billing/top-up-invoices/{top_up_id}/ and stop once status is paid, expired, cancelled or failed. Use due_at as returned (45 days after issue for new invoices). Settle on status and the amounts, never on confirmed_at (also set by a part payment) or closed_at (null for a paid invoice).

Errors (objects with code and detail, except field errors, which name the field):
\- 400 field error on amount_in_dollars (below 1,000, above 20,000, more than two decimals); idempotency_key_required (missing, blank or longer than 255 characters); a body that is not valid JSON (detail only); billing_details_required (missing lists the fields a person saves once in the console's billing details)
\- 404 billing_not_available
\- 409 top_up_invoice_open (open_invoice is the invoice still open or part paid: pay what it owes or wait for it to expire; it can be cancelled in the console only while nothing has arrived), idempotency_key_conflict (same key with another amount or from another API key), top_up_not_completed (an earlier request with this key could not issue its invoice: nothing was issued, create it again with a NEW key), top_up_not_allowed (annual Enterprise contract), billing_customer_missing
\- 502 payment_provider_error (the state could not be confirmed): retry with the SAME key. It returns the invoice if it was issued, or 409 top_up_not_completed if not; only then use a NEW key.`

\</pre>



      
      

粘贴到

## 工作原理1) 通过 [获取额度余额](https://docs.didit.me/zh/management-api/billing/balance.md) 查看您的余额。
2) 为所需额度创建发票，金额范围为 $1,000 至 $20,000，并附带新的 `Idempotency-Key`。
3) 向 `bank_details` 中的账户转账 `amount_open` 金额，并将 `invoice_number` 填写为汇款备注。
4) 随后通过 [获取充值发票](https://docs.didit.me/zh/management-api/billing/get-top-up-invoice.md) 跟踪该发票，直至其 `status` 变为 `paid`，或发票以 `expired` 或 `cancelled` 状态关闭。## 您支付的费用与获得的内容- `amount_in_dollars` 是您增加的额度。适用时，税费会加到发票中，因此您需要转账的 `total` 可能高于 `credit_amount`。
- 只有实际到账的金额才会在到账时计入您的余额。
- 部分付款会按其支付的 `total` 占比增加相应额度，其余未付金额保持同一参考号，直至 `due_at`。
- `due_at` 是发票上载明的到期日，即开具之日起 45 天。请使用返回的值；按早期条款开具的发票保留其自身的日期。
- 如果 `total` 在 `due_at` 之前未全部到账，发票将变为 `expired` 状态。之后带有参考号到账的转账，仍会按其支付金额计入额度。
- `routing_number` 适用于 ACH 和美国电汇，`swift_code` 适用于国际电汇。当 `bank_details` 为 null 时，`hosted_invoice_url` 会显示相同的银行信息。
- 您的计费联系人也会通过电子邮件收到发票。## 首次开具发票之前- 需要有人在控制台的账单详情中保存贵公司的法定名称和地址，且只需保存一次。在此之前，请求返回 `400 billing_details_required`，并附带 `missing` 字段。
- 充值发票适用于 Free、Growth 和 Scale 套餐。年度 Enterprise 合同会返回 `409 top_up_not_allowed`。## 幂等性与重试- 为您打算创建的每张发票使用一个 `Idempotency-Key`，将其保存下来，并且仅在重试该请求时重复使用。
- 缺少、为空或超过 255 个字符的密钥会返回 `400 idempotency_key_required`。
- 同一凭证使用相同的密钥和金额时，会返回该发票的当前状态，即使发票已支付、已取消或已过期。仅当 `status` 为 `open` 或 `part_paid`，且 `amount_open` 大于零时，才提供付款说明。
- 同一密钥若对应不同金额，或来自其他凭证，会返回 `409 idempotency_key_conflict`。
- `502 payment_provider_error` 表示无法确认发票的状态。请使用相同的密钥重试：若发票已签发，则返回该发票；若未签发任何发票，则返回 `409 top_up_not_completed`。只有在这种情况下，才可以使用新密钥创建新发票。## 同一时间只能存在一张发票当发票处于 `open` 或 `part_paid` 状态时，再次创建发票会返回 `409 top_up_invoice_open`，并附带 `open_invoice`。
请支付该发票仍需支付的金额，或等待其过期。
只有在尚未收到任何款项时，用户才能在控制台中取消发票。## 错误| HTTP | `code` | 含义 |
| - | - | - |
| 400 | `amount_in_dollars` 的字段错误 | 金额低于 $1,000、高于 $20,000，或小数位超过两位。 |
| 400 | `idempotency_key_required` | 缺少 `Idempotency-Key` 请求头，或其值为空，或长度超过 255 个字符。 |
| 400 | 无（仅 `detail`） | 请求体不是有效的 JSON。 |
| 400 | `billing_details_required` | 开具发票需要贵公司的法定名称和地址；`missing` 列出仍缺少的信息。 |
| 404 | `billing_not_available` | 您的组织暂不支持计费功能。 |
| 409 | `top_up_invoice_open` | 另一张发票处于未结清或部分支付状态；`open_invoice` 会指明该发票。 |
| 409 | `idempotency_key_conflict` | 该密钥曾用于其他金额，或被其他 API 密钥使用。 |
| 409 | `top_up_not_completed` | 之前使用此密钥的请求未能开具发票。未开具任何发票：请使用新密钥创建新发票。 |
| 409 | `top_up_not_allowed` | 年度 Enterprise 合同不能充值。 |
| 409 | `billing_customer_missing` | 您的组织尚无计费账户；需由相关人员在控制台中设置计费。 |
| 502 | `payment_provider_error` | 无法确认发票的状态。请使用相同的密钥重试。 |若要改用银行卡充值，请参阅[充值额度](https://docs.didit.me/zh/management-api/billing/top-up.md)。


## OpenAPI

````yaml zh/openapi-25.json POST /v3/billing/top-up-invoices/
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:
  - name: Bank Data
    description: >-
      Bank
      Link、连接、账户、余额、交易、机构和覆盖范围。对真实银行的一次性读取已向生产环境中的应用开放。与真实银行的持续访问目前尚未向生产环境中的应用开放：它可用于沙盒应用，通过
      Didit Test Bank 提供，并将按国家/地区逐步开放。沙盒中不收费。使用 API
      密钥发起的调用需要能够访问银行数据的密钥：完全访问密钥可以访问，而限定范围的密钥需要在 scopes 中包含 `bank-data`（读取类请求需要
      read，改变数据的操作需要 write）。缺少该范围的限定范围密钥会被拒绝，调用返回 `403
      bank_data_access_denied`。账户检查是例外：它需要对会话的写入权限或完全访问权限，而不需要 Bank data
      范围。原始银行数据（账户、余额、交易和变更信息流）同样会拒绝未携带 API 密钥的请求。


      除账户检查外，`/v3/bank/` 下的所有拒绝响应都具有相同的 JSON
      响应体（`code`、`message`、`request_id`、`field`、`next_action`、`retry_after`）。不是操作的路径、不是
      UUID 的 ID 或未知的子资源，对所有方法都返回 `404 not_found`。任何意外错误都返回 `500 internal_error`
      并附带 `request_id`。在银行数据不可用的情况下，每个操作都会返回平台的标准 `404`，与未知路由的返回完全相同。
paths:
  /v3/billing/top-up-invoices/:
    post:
      tags:
        - Billing
      summary: 创建充值发票
      description: >-
        以美元开具发票，用户通过银行转账付款即可为组织余额充值（任何银行均可），须在 **45
        天**内完成付款。这与用户在控制台的充值对话框中创建的发票相同。专为自动化充值的财务团队设计：监控 `GET
        /v3/billing/balance/`，创建发票，完成付款，然后通过 `GET
        /v3/billing/top-up-invoices/{top_up_id}/` 跟踪发票。


        - **金额。** `amount_in_dollars` 即额度，范围为 **\$1,000 至
        \$20,000**，最多保留两位小数。适用时会在发票中加收税费，因此 `total`（即您需要转账的金额）可能高于
        `credit_amount`。

        - **付款。** 当 `status` 为 `open` 或 `part_paid` 且 `amount_open` 大于零时，请将
        `amount_open` 转入 `bank_details` 中的账户，并以 `invoice_number` 作为付款参考（ACH
        和美国电汇使用 `routing_number`，国际电汇使用
        `swift_code`）。组织的计费联系人也会通过电子邮件收到发票，`hosted_invoice_url` 和 `invoice_pdf`
        显示的信息相同。当 `bank_details` 为 null 时，请使用 `hosted_invoice_url`。

        - **入账。** 仅对已到账的部分入账额度，并在到账时入账。全额转入 `total` 将入账
        `credit_amount`；部分付款则按其所付 `total` 的比例入账，剩余部分在
        `due_at`（发票上标注的日期）之前仍保持开放状态，并使用相同的付款参考。若到期时 `total` 仍未全部到账，状态将变为
        `expired`；之后仍以付款参考到账的转账，将按其支付金额入账。

        - **同一时间只能有一张。** 发票处于待支付或部分支付状态时，再次创建会返回 `409` `top_up_invoice_open` 以及
        `open_invoice`：请支付其剩余应付金额，或等待其过期。仅当尚未收到任何款项时，用户才能在控制台取消发票。

        - **计费信息。** 发票以公司的法定名称和地址开具，用户需在控制台的计费信息中保存一次；在此之前，请求将返回 `400`
        `billing_details_required` 以及 `missing` 字段。

        - **套餐。** 凡支持充值的套餐均可使用：Free、Growth 和 Scale 套餐。年度 Enterprise 合同将返回 `409`
        `top_up_not_allowed`。


        **幂等性。** `Idempotency-Key` 请求头为必填项：缺失、为空或超过 255 个字符的密钥将返回 `400`
        `idempotency_key_required`。每张拟创建的发票请使用一个密钥，妥善保存，且仅在重试同一请求时复用：同一凭证使用相同密钥和金额，将返回该发票（`201`），无论其当前状态如何（即使已付款、已取消或已过期），因此仅当
        `status` 为 `open` 或 `part_paid` 且 `amount_open`
        大于零时才提供付款信息。相同密钥若金额不同，或来自其他凭证，将返回 `409` `idempotency_key_conflict`。


        **请求失败时。** `502` `payment_provider_error`
        表示无法确认发票的状态。请使用相同密钥重试：若发票已签发，重试将返回该发票；若未签发任何发票，则返回 `409`
        `top_up_not_completed`。只有在收到 `top_up_not_completed` 之后，才可使用新密钥创建新发票；仅因
        `502` 而使用新密钥，可能会找到仍处于待支付状态的第一张发票（`409` `top_up_invoice_open`）。
      operationId: billing_top_up_invoices_create
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            每张拟创建的发票使用一个密钥，长度为 1 至 255
            个字符，仅在重试该请求时复用。同一凭证使用相同密钥和金额，将返回同一张发票，且永远不会签发两张。缺失、为空或超过 255
            个字符的密钥将返回 `400` `idempotency_key_required`。
          schema:
            type: string
            minLength: 1
            maxLength: 255
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount_in_dollars
              properties:
                amount_in_dollars:
                  type: number
                  minimum: 1000
                  maximum: 20000
                  description: 要添加的额度，以美元计，**范围为 1,000 至 20,000**，最多保留两位小数。适用时，税款会加到发票中。
                  multipleOf: 0.01
                po_number:
                  type: string
                  maxLength: 140
                  description: 您的采购订单号，印在发票上。
            examples:
              Invoice for $5,000 of credit:
                value:
                  amount_in_dollars: 5000
                  po_number: PO-88213
      responses:
        '201':
          description: 发票：新建的，或此密钥已创建的那张，以其当前状态返回。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingTopUpInvoice'
              examples:
                Issued:
                  value:
                    id: 9a4f2c1e-7b3d-4e8a-a1c5-6f0d2b9e8c47
                    lane: bank_transfer
                    status: open
                    credit_amount: '5000.00'
                    total: '5000.00'
                    tax: '0.00'
                    currency: usd
                    amount_received: '0.00'
                    amount_credited: '0.00'
                    amount_open: '5000.00'
                    presented: null
                    method:
                      type: customer_balance
                      name: Bank transfer
                    invoice_number: 7F3A2C1B-0012
                    hosted_invoice_url: https://invoice.example.com/i/7F3A2C1B-0012
                    invoice_pdf: https://invoice.example.com/i/7F3A2C1B-0012/pdf
                    po_number: PO-88213
                    due_at: '2027-01-14T10:00:00Z'
                    confirmed_at: null
                    closed_at: null
                    failure_reason: null
                    created_at: '2026-11-30T10:00:00Z'
                    bank_details:
                      currency: USD
                      amount_due: '5000.00'
                      account_holder_name: Didit
                      bank_name: Example Bank, N.A.
                      account_number: '000123456789'
                      routing_number: '000000000'
                      swift_code: EXAMUS33XXX
                      reference: 7F3A2C1B-0012
        '400':
          description: >-
            字段错误（例如 `amount_in_dollars` 低于 \$1,000、高于 \$20,000，或小数位数超过两位），或带有
            `code` 的对象：`idempotency_key_required`（缺少、为空或超过 255 个字符的
            `Idempotency-Key`），或
            `billing_details_required`（尚未保存法定名称和地址；`missing` 列出缺失项）。请求体不是有效 JSON
            时，仅返回包含 `detail` 的对象。
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/TopUpInvoiceFieldErrors'
                  - $ref: '#/components/schemas/TopUpInvoiceError'
                  - $ref: '#/components/schemas/TopUpInvoiceDetailError'
              examples:
                Amount below the minimum:
                  value:
                    amount_in_dollars:
                      - A bank transfer top-up must be at least $1,000
                Billing details missing:
                  value:
                    code: billing_details_required
                    detail: >-
                      Add your billing details (legal name and address) before
                      creating an invoice.
                    missing:
                      - legal_name
                      - address.line1
                Body not valid JSON:
                  value:
                    detail: >-
                      JSON parse error - Expecting value: line 1 column 1 (char
                      0)
        '401':
          description: API 密钥或应用的访问令牌已过期或被撤销：请更换凭证。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopUpInvoiceDetailError'
              examples:
                Expired key:
                  value:
                    detail: This API key has expired.
        '403':
          description: 未发送任何凭证，或该凭证无法在此组织中使用充值发票。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopUpInvoiceDetailError'
              examples:
                No credential:
                  value:
                    detail: Authentication credentials were not provided.
        '404':
          description: '`billing_not_available`：该组织暂时无法使用账单功能。'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopUpInvoiceError'
              examples:
                Billing not available:
                  value:
                    code: billing_not_available
                    detail: Plans and billing settings are not available yet.
        '409':
          description: >-
            `top_up_invoice_open`（另一张发票处于待支付或部分支付状态；`open_invoice`
            会指明该发票）、`idempotency_key_conflict`（该密钥已用于其他金额，或已被其他 API
            密钥使用）、`top_up_not_completed`（此前使用该密钥的请求未能开具发票：未开具任何发票；请使用新的密钥创建新发票）、`top_up_not_allowed`（年度
            Enterprise 合同）或
            `billing_customer_missing`（该组织尚未创建账单账户；需由用户在控制台中设置账单）。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopUpInvoiceError'
              examples:
                Invoice already open:
                  value:
                    code: top_up_invoice_open
                    detail: >-
                      An invoice is already open. Pay it or cancel it before
                      creating another.
                    open_invoice:
                      id: 9a4f2c1e-7b3d-4e8a-a1c5-6f0d2b9e8c47
                      lane: bank_transfer
                      status: open
                      credit_amount: '5000.00'
                      total: '5000.00'
                      tax: '0.00'
                      currency: usd
                      amount_received: '0.00'
                      amount_credited: '0.00'
                      amount_open: '5000.00'
                      presented: null
                      method:
                        type: customer_balance
                        name: Bank transfer
                      invoice_number: 7F3A2C1B-0012
                      hosted_invoice_url: https://invoice.example.com/i/7F3A2C1B-0012
                      invoice_pdf: https://invoice.example.com/i/7F3A2C1B-0012/pdf
                      po_number: PO-88213
                      due_at: '2027-01-14T10:00:00Z'
                      confirmed_at: null
                      closed_at: null
                      failure_reason: null
                      created_at: '2026-11-30T10:00:00Z'
                Open invoice closed meanwhile:
                  value:
                    code: top_up_invoice_open
                    detail: >-
                      An invoice is already open. Pay it or cancel it before
                      creating another.
                    open_invoice: null
                Key used for another invoice:
                  value:
                    code: idempotency_key_conflict
                    detail: This idempotency key was used for another top-up.
                Invoice not issued:
                  value:
                    code: top_up_not_completed
                    detail: >-
                      An earlier request with this Idempotency-Key failed before
                      the invoice was issued. Nothing is owed: create a new
                      invoice with a new key.
        '429':
          description: 超出速率限制；请退避，并在 `Retry-After` 指示的时间间隔后重试。
          content:
            application/json:
              examples:
                Throttled:
                  value:
                    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
              schema:
                $ref: '#/components/schemas/RateLimitBudgetError'
          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'
        '502':
          description: >-
            `payment_provider_error`：无法向支付服务商确认该发票的状态。请使用相同的 `Idempotency-Key`
            重试：如果发票已开具，将返回该发票；如果未开具任何发票，将返回 `409`
            `top_up_not_completed`。只有在这种情况下，才能使用新的密钥创建新发票。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopUpInvoiceError'
              examples:
                Not issued:
                  value:
                    code: payment_provider_error
                    detail: The payment provider is not available. Try again later.
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X POST
            'https://verification.didit.me/v3/billing/top-up-invoices/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -H 'Idempotency-Key: 0b8e6f4a-3c2d-4e1f-9a7b-5d6c8e2f1a30' \
              -d '{
                "amount_in_dollars": 5000,
                "po_number": "PO-88213"
              }'
components:
  schemas:
    BillingTopUpInvoice:
      type: object
      description: 通过银行转账支付的充值发票，与控制台“充值”对话框签发的发票相同。请通过 `status` 和金额了解其当前状态；时间戳仅记录事件。
      required:
        - id
        - lane
        - status
        - credit_amount
        - total
        - tax
        - currency
        - amount_received
        - amount_credited
        - amount_open
        - created_at
      properties:
        id:
          type: string
          format: uuid
          description: 发票标识符：请使用 `GET /v3/billing/top-up-invoices/{top_up_id}/` 重新读取。
        lane:
          type: string
          enum:
            - bank_transfer
          description: 始终为 `bank_transfer`。
        status:
          type: string
          enum:
            - open
            - part_paid
            - paid
            - expired
            - cancelled
            - failed
          description: >-
            `open`：等待转账。`part_paid`：已收到部分 `total`，并已将对应比例的额度计入账户；请在 `due_at`
            之前使用相同的备注发送 `amount_open`。`paid`：已收到全部 `total`，并已计入
            `credit_amount`。`expired`：在收到全部 `total` 之前已超过
            `due_at`；已收到的金额仍会计入账户，之后带有该备注的转账仍会按其金额计入。`cancelled`：在收到任何款项之前，有人通过控制台取消了该发票（款项到账后，发票无法再取消）。`failed`：发票未能开具；未开具任何发票。
        credit_amount:
          type: string
          description: '`total` 全额付清时添加到余额中的金额，以美元计，不含税。'
          example: '5000.00'
        total:
          type: string
          description: 发票要求支付的金额，以美元计，含税。可能高于 `credit_amount`。
          example: '5000.00'
        tax:
          type: string
          description: 发票上的税款，以美元计。无适用税款时为 `0.00`。
          example: '5000.00'
        currency:
          type: string
          enum:
            - usd
          description: 始终为 `usd`。
        amount_received:
          type: string
          description: 目前已到账的金额，以美元计。
          example: '5000.00'
        amount_credited:
          type: string
          description: >-
            截至目前已计入余额的金额（以美元计）。部分付款会按其支付的 `total` 所占比例增加额度：对于 1,100.00 的发票，支付
            550.00，对应 1,000.00 的额度，会增加 500.00。
          example: '5000.00'
        amount_open:
          type: string
          description: >-
            当 `status` 为 `open` 或 `part_paid` 时仍需支付的金额，以美元计：请严格转入此金额，并以
            `invoice_number` 作为备注。发票结清后忽略此字段。
          example: '5000.00'
        presented:
          type: object
          nullable: true
          description: 充值发票中始终为 null。
          properties:
            amount:
              type: string
            currency:
              type: string
        method:
          type: object
          nullable: true
          description: 付款方式，与计费历史中的名称一致。
          properties:
            type:
              type: string
              example: customer_balance
            name:
              type: string
              example: Bank transfer
        invoice_number:
          type: string
          nullable: true
          description: 发票编号。请将其作为备注填入转账中：没有该编号的转账无法与发票匹配。
        hosted_invoice_url:
          type: string
          format: uri
          nullable: true
          description: 发票页面，含银行信息。
        invoice_pdf:
          type: string
          format: uri
          nullable: true
          description: PDF 格式的发票。
        po_number:
          type: string
          nullable: true
          description: 发票上印制的采购订单号（若已提交）。
        due_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            发票上列明的到期日。请使用该值，切勿自行计算。新发票自开具之日起 45 天到期；按早期条款开具的发票保留其开具时的到期日。若到期时
            `total` 未全部到账，状态变为 `expired`；已付清的发票保持 `paid`。
        confirmed_at:
          type: string
          format: date-time
          nullable: true
          description: 最近一笔转账得到确认的时间，包括部分付款。这并不表示发票已结清：请查看 `status` 和 `amount_open`。
        closed_at:
          type: string
          format: date-time
          nullable: true
          description: 发票失败、过期或被取消的时间。对于未付款、部分付款或已付清的发票，为 null。
        failure_reason:
          type: string
          nullable: true
          description: 失败或过期的原因，以及失败或过期的时间。
        created_at:
          type: string
          format: date-time
          description: 签发时间。
        bank_details:
          type: object
          nullable: true
          description: >-
            用于接收转账的收款信息，在发票可以接收转账（`open` 或
            `part_paid`）期间提供。发票关闭后为空；当前无法读取银行信息时也为空，此时请使用
            `hosted_invoice_url`，其中同样会显示银行信息。出错时不包含在 `open_invoice` 中。
          required:
            - currency
            - amount_due
            - account_holder_name
            - bank_name
            - account_number
            - routing_number
            - swift_code
            - reference
          properties:
            currency:
              type: string
              description: 始终为 `USD`。
            amount_due:
              type: string
              description: 需支付的金额，以美元计：与 `amount_open` 相同。
            account_holder_name:
              type: string
              description: 收款账户。
            bank_name:
              type: string
              description: 收款银行。
            account_number:
              type: string
              description: 收款账号。
            routing_number:
              type: string
              description: 适用于 ACH 和美国电汇。
            swift_code:
              type: string
              description: 适用于国际电汇。
            reference:
              type: string
              description: 发票编号。必须包含在转账中。
    TopUpInvoiceFieldErrors:
      type: object
      description: 字段错误：每个无效请求字段及其错误信息，例如金额低于 \$1,000。
      additionalProperties:
        type: array
        items:
          type: string
      example:
        amount_in_dollars:
          - A bank transfer top-up must be at least $1,000
    TopUpInvoiceError:
      type: object
      description: 充值发票请求的错误响应体。
      required:
        - code
        - detail
      properties:
        code:
          type: string
          enum:
            - idempotency_key_required
            - billing_details_required
            - top_up_invoice_open
            - idempotency_key_conflict
            - top_up_not_allowed
            - top_up_not_completed
            - billing_customer_missing
            - billing_not_available
            - top_up_not_found
            - payment_provider_error
          description: 稳定的错误代码。
        detail:
          type: string
          description: 供人阅读的说明。
        missing:
          type: array
          items:
            type: string
          description: >-
            对于 `billing_details_required`：仍需保存的计费信息，例如 `legal_name` 或
            `address.line1`。
        open_invoice:
          description: >-
            对于 `top_up_invoice_open`：处于 open 或 part paid 状态的发票，不含
            `bank_details`（请读取该发票以获取付款信息）。若在回答写入前已关闭，则为 null：请重新创建发票。
          oneOf:
            - $ref: '#/components/schemas/BillingTopUpInvoice'
            - $ref: '#/components/schemas/TopUpInvoiceNoOpenInvoice'
    TopUpInvoiceDetailError:
      type: object
      description: 拒绝响应，仅包含 `detail`：凭据已过期或已撤销（401）、缺少密钥或凭据缺少相应权限（403），或请求体不是有效 JSON（400）。
      required:
        - detail
      additionalProperties: false
      properties:
        detail:
          type: string
          description: 供人阅读的说明。
    RateLimitBudgetError:
      type: object
      description: 仅在速率限制中间件预算拒绝时返回。其他 429 错误（包括幂等性冲突和端点特定上限）不保证返回这些元数据字段。
      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
    TopUpInvoiceNoOpenInvoice:
      description: 没有发票：处于 open 状态的发票在回答写入前已关闭。
      enum:
        - null
      nullable: true
  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 密钥，可在 Business Console 的开发者 -> API
        密钥中获取。主密钥拥有完全访问权限。命名密钥可以设置范围：可按资源设置无权限、只读或读写，可限定为部分工作流或已批准的会话，可限定为一组 IP
        地址，并可设置过期日期。401 表示密钥错误、已被撤销或已过期；403 表示未发送密钥、密钥无权访问该资源或执行该操作，或请求来自其 IP
        列表之外的地址；会话相关路由返回 404，表示该会话不在密钥的工作流或状态范围内。没有媒体访问权限的密钥会将图片、视频和 PDF 的 URL
        返回为 null；没有会话写入权限的密钥会将会话链接和令牌返回为 null。请参阅
        https://docs.didit.me/console/api-keys。
    BearerAuth:
      type: http
      scheme: bearer
      description: 应用的客户端凭证访问令牌。

````

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