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

# Create Top-Up Invoice API: Pay by Bank Transfer

> Create a Didit top-up invoice from the API and pay it by bank transfer within 45 days: $1,000 to $20,000 of credit, with bank details and a PDF.

Didit's top-up invoice API issues a USD invoice that adds credit to your balance when your finance team pays it by bank transfer, from any bank, within 45 days.
It is the same invoice a person creates in the console's Top up dialog.

Create Top-Up Invoice Prompt
        Copy prompt to clipboard



      
      

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



      
      

Paste into

## How it works1) Watch your balance with [Get credit balance](https://docs.didit.me/management-api/billing/balance.md).
2) Create an invoice for the credit you need, from $1,000 to $20,000, with a new `Idempotency-Key`.
3) Transfer `amount_open` to the account in `bank_details`, with `invoice_number` as the reference.
4) Follow it with [Get top-up invoice](https://docs.didit.me/management-api/billing/get-top-up-invoice.md) until its `status` is `paid`, or it closes as `expired` or `cancelled`.## What you pay and what you get- `amount_in_dollars` is the credit you add. Tax is added to the invoice when it applies, so `total`, what you transfer, can be higher than `credit_amount`.
- Only what arrives is added to your balance, when it arrives.
- A part payment adds credit in proportion to the share of `total` it pays, and the rest stays open with the same reference until `due_at`.
- `due_at` is the due date stated on the invoice: 45 days after it was issued. Use the returned value; an invoice issued under earlier terms keeps its own date.
- If `total` has not all arrived by `due_at`, the invoice is `expired`. A transfer that still arrives with its reference is added for what it pays.
- `routing_number` is for ACH and US wires, and `swift_code` for international wires. When `bank_details` is null, `hosted_invoice_url` shows the same details.
- Your billing contacts also receive the invoice by email.## Before the first invoice- A person saves your company's legal name and address once in the console's billing details. Until then, the request returns `400 billing_details_required` with the `missing` fields.
- Top-up invoices are available on the Free, Growth and Scale plans. Annual Enterprise contracts return `409 top_up_not_allowed`.## Idempotency and retries- Use one `Idempotency-Key` per invoice you intend to create, store it, and reuse it only to retry that request.
- A missing, blank or longer-than-255-character key returns `400 idempotency_key_required`.
- The same key and amount from the same credential returns that 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 zero.
- The same key with another amount, or from another credential, returns `409 idempotency_key_conflict`.
- A `502 payment_provider_error` means the invoice's 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 nothing was issued, and only then create a new invoice with a new key.## One invoice at a timeWhile an invoice is `open` or `part_paid`, creating another returns `409 top_up_invoice_open` with `open_invoice`.
Pay what it still owes, or wait for it to expire.
A person can cancel an invoice in the console only while nothing has arrived.## Errors| HTTP | `code` | Meaning |
| - | - | - |
| 400 | field error on `amount_in_dollars` | The amount is below $1,000, above $20,000 or has more than two decimals. |
| 400 | `idempotency_key_required` | The `Idempotency-Key` header is missing, blank or longer than 255 characters. |
| 400 | none (`detail` only) | The body is not valid JSON. |
| 400 | `billing_details_required` | The invoice needs your company's legal name and address; `missing` lists what is still missing. |
| 404 | `billing_not_available` | Billing is not available for your organization yet. |
| 409 | `top_up_invoice_open` | Another invoice is open or part paid; `open_invoice` names it. |
| 409 | `idempotency_key_conflict` | The key was used with another amount or by another API key. |
| 409 | `top_up_not_completed` | An earlier request with this key could not issue its invoice. Nothing was issued: create a new invoice with a new key. |
| 409 | `top_up_not_allowed` | Annual Enterprise contracts cannot top up. |
| 409 | `billing_customer_missing` | Your organization has no billing account yet; a person sets up billing in the console. |
| 502 | `payment_provider_error` | The invoice's state could not be confirmed. Retry with the same key. |To top up by card instead, see [Top up credits](https://docs.didit.me/management-api/billing/top-up.md).


## OpenAPI

````yaml openapi-25.json POST /v3/billing/top-up-invoices/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: Identity verification API. Authenticate with x-api-key header.
servers:
  - url: https://verification.didit.me
security: []
tags:
  - name: Bank Data
    description: >-
      Bank Link, connections, accounts, balances, transactions, institutions and
      coverage. One-time reads of real banks are open to live applications.
      Ongoing access with real banks is not open yet for live applications: it
      is available for sandbox applications with the Didit Test Bank, and opens
      country by country. Nothing is charged in sandbox. A call made with an API
      key needs a key that can reach Bank data: a full-access key can, and a
      scoped key needs `bank-data` in its scopes (read for reads, write for
      operations that change something). A scoped key without it is refused, and
      the call answers `403 bank_data_access_denied`. The account check is the
      exception: it needs write access to sessions, or full access, and not the
      Bank data scope. Raw bank data (accounts, balances, transactions and the
      change feed) also refuses a request that carries no API key.


      Every refusal under `/v3/bank/` except the account check's has the same
      JSON body (`code`, `message`, `request_id`, `field`, `next_action`,
      `retry_after`). A path that is not an operation, an id that is not a UUID
      or an unknown sub-resource answers `404 not_found` for every method, and
      any unexpected error answers `500 internal_error` with a `request_id`.
      Where Bank data is not available, every operation answers the platform's
      standard `404`, exactly as an unknown route does.
paths:
  /v3/billing/top-up-invoices/:
    post:
      tags:
        - Billing
      summary: Create a top-up invoice
      description: >-
        Issue a USD invoice that tops up the organization's balance when it is
        paid by bank transfer, from any bank, within **45 days**: the same
        invoice a person creates in the console's Top up dialog. Built for
        finance teams that automate top-ups: watch `GET /v3/billing/balance/`,
        create an invoice, pay it, and follow it with `GET
        /v3/billing/top-up-invoices/{top_up_id}/`.


        - **Amount.** `amount_in_dollars` is the credit, from **\$1,000 to
        \$20,000**, at most two decimals. Tax is added to the invoice when it
        applies, so `total` (what you transfer) can be higher than
        `credit_amount`.

        - **Paying it.** While `status` is `open` or `part_paid` and
        `amount_open` is above zero, transfer `amount_open` with
        `invoice_number` as the reference, to the account in `bank_details`
        (`routing_number` for ACH and US wires, `swift_code` for international
        wires). The organization's billing contacts also receive the invoice by
        email, and `hosted_invoice_url` and `invoice_pdf` show the same details.
        When `bank_details` is null, use `hosted_invoice_url`.

        - **Credit.** Only what arrives is added, when it arrives. A transfer of
        all of `total` adds `credit_amount`; a part payment adds credit in
        proportion to the share of `total` it pays, and the rest stays open with
        the same reference until `due_at`, the date stated on the invoice. If
        `total` has not all arrived by then, the status becomes `expired`; a
        transfer that still arrives with the reference is added for what it
        pays.

        - **One at a time.** While an invoice is open or part paid, another
        returns `409` `top_up_invoice_open` with `open_invoice`: pay what it
        still owes or wait for it to expire. A person can cancel an invoice in
        the console only while nothing has arrived.

        - **Billing details.** The invoice is issued to the company's legal name
        and address, which a person saves once in the console's billing details;
        until then the request returns `400` `billing_details_required` with the
        `missing` fields.

        - **Plans.** Available where top-ups are: the Free, Growth and Scale
        plans. Annual Enterprise contracts return `409` `top_up_not_allowed`.


        **Idempotency.** The `Idempotency-Key` header is required: a missing,
        blank or longer-than-255-character key returns `400`
        `idempotency_key_required`. Use one key per invoice you intend to
        create, store it, and reuse it only to retry that same request: the same
        key and amount from the same credential returns that invoice (`201`) in
        whatever state it is now, even paid, cancelled or expired, so give
        payment instructions only while `status` is `open` or `part_paid` and
        `amount_open` is above zero. The same key with another amount, or from
        another credential, returns `409` `idempotency_key_conflict`.


        **If a request fails.** A `502` `payment_provider_error` means the
        invoice's state could not be confirmed. Retry with the same key: the
        retry returns the invoice if it was issued, or `409`
        `top_up_not_completed` if nothing was issued. Only after
        `top_up_not_completed` create a new invoice with a new key; a new key
        after a `502` alone can find the first invoice still open (`409`
        `top_up_invoice_open`).
      operationId: billing_top_up_invoices_create
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            One key per invoice you intend to create, 1 to 255 characters,
            reused only to retry that request. The same key and amount from the
            same credential returns the same invoice and never issues two. A
            missing, blank or longer key returns `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: >-
                    The credit to add, in USD, **from 1,000 to 20,000**, with at
                    most two decimals. Tax is added to the invoice when it
                    applies.
                  multipleOf: 0.01
                po_number:
                  type: string
                  maxLength: 140
                  description: Your purchase order number, printed on the invoice.
            examples:
              Invoice for $5,000 of credit:
                value:
                  amount_in_dollars: 5000
                  po_number: PO-88213
      responses:
        '201':
          description: >-
            The invoice: new, or the one this key already created, in its
            current state.
          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: >-
            A field error (for example `amount_in_dollars` below \$1,000, above
            \$20,000 or with more than two decimals), an object with a `code`:
            `idempotency_key_required` (a missing, blank or
            longer-than-255-character `Idempotency-Key`) or
            `billing_details_required` (the legal name and address are not saved
            yet; `missing` lists them). A body that is not valid JSON returns an
            object with only a `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: >-
            The API key or the application's access token has expired or was
            revoked: replace the credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopUpInvoiceDetailError'
              examples:
                Expired key:
                  value:
                    detail: This API key has expired.
        '403':
          description: >-
            No credential was sent, or the credential cannot use top-up invoices
            for this organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopUpInvoiceDetailError'
              examples:
                No credential:
                  value:
                    detail: Authentication credentials were not provided.
        '404':
          description: >-
            `billing_not_available`: billing is not available for this
            organization yet.
          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` (another invoice is open or part paid;
            `open_invoice` names it), `idempotency_key_conflict` (the key was
            used with another amount or by another API key),
            `top_up_not_completed` (an earlier request with this key could not
            issue its invoice: nothing was issued; create a new invoice with a
            new key), `top_up_not_allowed` (annual Enterprise contract) or
            `billing_customer_missing` (the organization has no billing account
            yet; a person sets up billing in the console).
          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: >-
            Rate limit exceeded; back off and retry after the interval indicated
            in `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`: the invoice's state could not be confirmed
            with the payment provider. Retry with the same `Idempotency-Key`: it
            returns the invoice if it was issued, or `409`
            `top_up_not_completed` if nothing was issued; only then create a new
            invoice with a new key.
          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: >-
        A top-up invoice paid by bank transfer: the same invoice the console's
        Top up dialog issues. Read `status` and the amounts to know where it
        stands; the timestamps only record events.
      required:
        - id
        - lane
        - status
        - credit_amount
        - total
        - tax
        - currency
        - amount_received
        - amount_credited
        - amount_open
        - created_at
      properties:
        id:
          type: string
          format: uuid
          description: >-
            The invoice's identifier: read it again with `GET
            /v3/billing/top-up-invoices/{top_up_id}/`.
        lane:
          type: string
          enum:
            - bank_transfer
          description: Always `bank_transfer`.
        status:
          type: string
          enum:
            - open
            - part_paid
            - paid
            - expired
            - cancelled
            - failed
          description: >-
            `open`: waiting for the transfer. `part_paid`: part of `total`
            arrived and its share of the credit was added; send `amount_open`
            with the same reference before `due_at`. `paid`: `total` arrived and
            `credit_amount` was added. `expired`: `due_at` passed before all of
            `total` arrived; what arrived stays added, and a transfer that still
            arrives with the reference is added for what it pays. `cancelled`: a
            person cancelled it in the console before anything arrived (an
            invoice can no longer be cancelled once money arrived). `failed`:
            the invoice could not be issued; nothing was issued.
        credit_amount:
          type: string
          description: >-
            What is added to the balance when `total` is paid in full, in USD,
            before tax.
          example: '5000.00'
        total:
          type: string
          description: >-
            What the invoice asks for, in USD, tax included. It can be higher
            than `credit_amount`.
          example: '5000.00'
        tax:
          type: string
          description: Tax on the invoice, in USD. `0.00` when none applies.
          example: '5000.00'
        currency:
          type: string
          enum:
            - usd
          description: Always `usd`.
        amount_received:
          type: string
          description: What has arrived so far, in USD.
          example: '5000.00'
        amount_credited:
          type: string
          description: >-
            What has been added to the balance so far, in USD. A part payment
            adds credit in proportion to the share of `total` it pays: 550.00 of
            a 1,100.00 invoice for 1,000.00 of credit adds 500.00.
          example: '5000.00'
        amount_open:
          type: string
          description: >-
            What is still to send, in USD, while `status` is `open` or
            `part_paid`: transfer exactly this, with `invoice_number` as the
            reference. Ignore it once the invoice is closed.
          example: '5000.00'
        presented:
          type: object
          nullable: true
          description: Always null for a top-up invoice.
          properties:
            amount:
              type: string
            currency:
              type: string
        method:
          type: object
          nullable: true
          description: How it is paid, as billing history names it.
          properties:
            type:
              type: string
              example: customer_balance
            name:
              type: string
              example: Bank transfer
        invoice_number:
          type: string
          nullable: true
          description: >-
            The invoice number. Put it in the transfer as the reference: a
            transfer without it cannot be matched to the invoice.
        hosted_invoice_url:
          type: string
          format: uri
          nullable: true
          description: The invoice's page, with the bank details.
        invoice_pdf:
          type: string
          format: uri
          nullable: true
          description: The invoice as a PDF.
        po_number:
          type: string
          nullable: true
          description: The purchase order number printed on the invoice, when one was sent.
        due_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            The due date stated on the invoice: use this value, never a formula.
            New invoices are due 45 days after they are issued; an invoice
            issued under earlier terms keeps the date it was issued with. If
            `total` has not all arrived by then, the status becomes `expired`; a
            paid invoice stays `paid`.
        confirmed_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the latest transfer was confirmed, a part payment included. It
            does not mean the invoice is settled: read `status` and
            `amount_open`.
        closed_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the invoice failed, expired or was cancelled. Null for an open,
            part-paid or paid invoice.
        failure_reason:
          type: string
          nullable: true
          description: Why it failed or expired, when it did.
        created_at:
          type: string
          format: date-time
          description: When it was issued.
        bank_details:
          type: object
          nullable: true
          description: >-
            Where to send the money, while the invoice can take a transfer
            (`open` or `part_paid`). Null once it is closed, and also when the
            bank details cannot be read right now: then use
            `hosted_invoice_url`, which shows them too. Not part of
            `open_invoice` in an error.
          required:
            - currency
            - amount_due
            - account_holder_name
            - bank_name
            - account_number
            - routing_number
            - swift_code
            - reference
          properties:
            currency:
              type: string
              description: Always `USD`.
            amount_due:
              type: string
              description: 'What to send, in USD: the same as `amount_open`.'
            account_holder_name:
              type: string
              description: The account the money goes to.
            bank_name:
              type: string
              description: The receiving bank.
            account_number:
              type: string
              description: The receiving account number.
            routing_number:
              type: string
              description: For ACH and US wires.
            swift_code:
              type: string
              description: For international wires.
            reference:
              type: string
              description: The invoice number. It must be in the transfer.
    TopUpInvoiceFieldErrors:
      type: object
      description: >-
        A field error: each invalid request field with its messages, such as an
        amount below \$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: Error body of a top-up invoice request.
      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: Stable error code.
        detail:
          type: string
          description: Human-readable explanation.
        missing:
          type: array
          items:
            type: string
          description: >-
            On `billing_details_required`: the billing details still to save,
            such as `legal_name` or `address.line1`.
        open_invoice:
          description: >-
            On `top_up_invoice_open`: the invoice that is open or part paid,
            without `bank_details` (read it to get them). Null when it closed
            before the answer was written: create the invoice again.
          oneOf:
            - $ref: '#/components/schemas/BillingTopUpInvoice'
            - $ref: '#/components/schemas/TopUpInvoiceNoOpenInvoice'
    TopUpInvoiceDetailError:
      type: object
      description: >-
        A refusal with only a `detail`: an expired or revoked credential (401),
        a missing key or a permission the credential lacks (403), or a body that
        is not valid JSON (400).
      required:
        - detail
      additionalProperties: false
      properties:
        detail:
          type: string
          description: Human-readable explanation.
    RateLimitBudgetError:
      type: object
      description: >-
        Returned only for a rate-limit middleware budget refusal. Other 429
        errors, including idempotency conflicts and endpoint-specific caps, do
        not promise these metadata fields.
      required:
        - detail
        - reference
        - limit
        - remaining
        - reset
        - window_seconds
      properties:
        detail:
          type: string
          description: Existing human-readable budget refusal message.
        reference:
          type: string
          pattern: ^RL-[0-9a-f]{32}$
          description: >-
            Opaque support reference: RL- followed by 32 lowercase UUID
            hexadecimal characters.
        limit:
          type: integer
          description: Budget for the exceeded scope; equals X-RateLimit-Limit.
        remaining:
          type: integer
          minimum: 0
          description: Remaining budget, clamped to zero; equals X-RateLimit-Remaining.
        reset:
          type: integer
          format: int64
          description: Window reset time in Unix seconds; equals X-RateLimit-Reset.
        window_seconds:
          type: integer
          description: >-
            Fixed-window duration in seconds, not the remaining wait. Honor
            Retry-After before retrying.
      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: 'No invoice: the open one closed before the answer was written.'
      enum:
        - null
      nullable: true
  headers:
    BudgetRetryAfter:
      description: >-
        Seconds to wait, rounded up to the next window. Present on middleware
        budget refusals.
      schema:
        type: integer
    BudgetXRateLimitScope:
      description: >-
        The scope whose budget was exceeded. Present on middleware budget
        refusals.
      schema:
        type: string
    BudgetXRateLimitLimit:
      description: >-
        Budget for the exceeded scope; equals body limit. Present on middleware
        budget refusals.
      schema:
        type: integer
    BudgetXRateLimitRemaining:
      description: >-
        Remaining budget, clamped to zero; equals body remaining. Present on
        middleware budget refusals.
      schema:
        type: integer
    BudgetXRateLimitReset:
      description: >-
        Reset time in Unix seconds; equals body reset. Present on middleware
        budget refusals.
      schema:
        type: integer
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your application's API key, from Developers -> API keys in the Business
        Console. The primary key has full access. A named key can be scoped:
        none, read or write per resource, limited to some workflows or to
        approved sessions, to a list of IP addresses, and to an expiry date. 401
        means the key is wrong, revoked or expired; 403 means no key was sent,
        the key has no access to this resource or action, or the request came
        from an address outside its IP list; 404 on a session route means the
        session is outside the key's workflows or statuses. A key without media
        access receives image, video and PDF URLs as null, and a key without
        sessions write receives session links and tokens as null. See
        https://docs.didit.me/console/api-keys.
    BearerAuth:
      type: http
      scheme: bearer
      description: The application's client-credentials access token.

````

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