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"
}'import requests
url = "https://verification.didit.me/v3/billing/top-up-invoices/"
payload = {
"amount_in_dollars": 5000,
"po_number": "PO-88213"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount_in_dollars: 5000, po_number: 'PO-88213'})
};
fetch('https://verification.didit.me/v3/billing/top-up-invoices/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://verification.didit.me/v3/billing/top-up-invoices/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount_in_dollars' => 5000,
'po_number' => 'PO-88213'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://verification.didit.me/v3/billing/top-up-invoices/"
payload := strings.NewReader("{\n \"amount_in_dollars\": 5000,\n \"po_number\": \"PO-88213\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://verification.didit.me/v3/billing/top-up-invoices/")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount_in_dollars\": 5000,\n \"po_number\": \"PO-88213\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://verification.didit.me/v3/billing/top-up-invoices/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount_in_dollars\": 5000,\n \"po_number\": \"PO-88213\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}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,000to20,000 of credit, with bank details and a PDF.
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"
}'import requests
url = "https://verification.didit.me/v3/billing/top-up-invoices/"
payload = {
"amount_in_dollars": 5000,
"po_number": "PO-88213"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount_in_dollars: 5000, po_number: 'PO-88213'})
};
fetch('https://verification.didit.me/v3/billing/top-up-invoices/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://verification.didit.me/v3/billing/top-up-invoices/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount_in_dollars' => 5000,
'po_number' => 'PO-88213'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://verification.didit.me/v3/billing/top-up-invoices/"
payload := strings.NewReader("{\n \"amount_in_dollars\": 5000,\n \"po_number\": \"PO-88213\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://verification.didit.me/v3/billing/top-up-invoices/")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount_in_dollars\": 5000,\n \"po_number\": \"PO-88213\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://verification.didit.me/v3/billing/top-up-invoices/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount_in_dollars\": 5000,\n \"po_number\": \"PO-88213\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}How it works
- Watch your balance with Get credit balance.
- Create an invoice for the credit you need, from $1,000 to $20,000, with a new
Idempotency-Key. - Transfer
amount_opento the account inbank_details, withinvoice_numberas the reference. - Follow it with Get top-up invoice until its
statusispaid, or it closes asexpiredorcancelled.
What you pay and what you get
amount_in_dollarsis the credit you add. Tax is added to the invoice when it applies, sototal, what you transfer, can be higher thancredit_amount.- Only what arrives is added to your balance, when it arrives.
- A part payment adds credit in proportion to the share of
totalit pays, and the rest stays open with the same reference untildue_at. due_atis 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
totalhas not all arrived bydue_at, the invoice isexpired. A transfer that still arrives with its reference is added for what it pays. routing_numberis for ACH and US wires, andswift_codefor international wires. Whenbank_detailsis null,hosted_invoice_urlshows 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_requiredwith themissingfields. - 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-Keyper 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
statusisopenorpart_paidandamount_openis above zero. - The same key with another amount, or from another credential, returns
409 idempotency_key_conflict. - A
502 payment_provider_errormeans the invoice’s state could not be confirmed. Retry with the same key: it returns the invoice if it was issued, or409 top_up_not_completedif nothing was issued, and only then create a new invoice with a new key.
One invoice at a time
While an invoice isopen 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. |
Authorizations
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
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.
1 - 255Body
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.
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.
open, part_paid, paid, expired, cancelled, failed 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.