Skip to main content
POST
curl
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.

How it works

  1. Watch your balance with Get credit balance.
  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 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 time

While 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

To top up by card instead, see Top up credits.

Authorizations

x-api-key
string
header
required

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.

Headers

Idempotency-Key
string
required

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.

Required string length: 1 - 255

Body

application/json
amount_in_dollars
number
required

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.

Required range: 1000 <= x <= 20000Must be a multiple of 0.01
po_number
string

Your purchase order number, printed on the invoice.

Maximum string length: 140

Response

The invoice: new, or the one this key already created, in its current state.

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.

id
string<uuid>
required

The invoice's identifier: read it again with GET /v3/billing/top-up-invoices/{top_up_id}/.

lane
enum<string>
required

Always bank_transfer.

Available options:
bank_transfer
status
enum<string>
required

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.

Available options:
open,
part_paid,
paid,
expired,
cancelled,
failed
credit_amount
string
required

What is added to the balance when total is paid in full, in USD, before tax.

Example:

"5000.00"

total
string
required

What the invoice asks for, in USD, tax included. It can be higher than credit_amount.

Example:

"5000.00"

tax
string
required

Tax on the invoice, in USD. 0.00 when none applies.

Example:

"5000.00"

currency
enum<string>
required

Always usd.

Available options:
usd
amount_received
string
required

What has arrived so far, in USD.

Example:

"5000.00"

amount_credited
string
required

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
string
required

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"

created_at
string<date-time>
required

When it was issued.

presented
object | null

Always null for a top-up invoice.

method
object | null

How it is paid, as billing history names it.

invoice_number
string | null

The invoice number. Put it in the transfer as the reference: a transfer without it cannot be matched to the invoice.

hosted_invoice_url
string<uri> | null

The invoice's page, with the bank details.

invoice_pdf
string<uri> | null

The invoice as a PDF.

po_number
string | null

The purchase order number printed on the invoice, when one was sent.

due_at
string<date-time> | null

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
string<date-time> | null

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
string<date-time> | null

When the invoice failed, expired or was cancelled. Null for an open, part-paid or paid invoice.

failure_reason
string | null

Why it failed or expired, when it did.

bank_details
object | null

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.

Last modified on December 1, 2026