Invoice a customer, accept bank, USDC or card, match the payment, export to your ledger (UC-B-02)
Status: current as of 2026-11-18.
Who this is for
A business with a business account that sends invoices and wants each payment, whichever way it arrives, matched to its invoice and written to its books. The result is an invoice that turns paid on its own, a balanced journal entry per payment, and a monthly export for your ledger.
Before you start
- Account: a business account on the SET API. Invoices are for a business invoicing its own customers.
- Key scopes:
write(invoice, link, claim, match, ledger mapping) andread(lists and export). Send the key asAuthorization: Bearer set_test_…orset_live_…. - Your business's customer id (
cus_…), verified by SET's provider. - Where the invoice is paid, one of:
- a Cash-Out Address of yours for stablecoin payers (Take stablecoin and be paid in your own currency, UC-B-01): a USD invoice needs a USDC address that pays USD, a EUR invoice a EURC address that pays EUR;
- a virtual account of yours for bank payers, in the invoice's currency (
POST /v1/payment_setupsanswers it asvirtualAccount).
- Card payment through a payment link needs your card account to be taking payments (Card payments).
By API
- Create the invoice. One currency per invoice:
usd,eurorgbp.POST /v1/invoices· Header:Idempotency-Key``json { "customer": "cus_…", "number": "…", "amount": "250.00", "currency": "usd", "pay": { "cashOutAddress": "…" }, "dueAt": "…" }`For bank payers send"pay": { "virtualAccount": "…" }instead.payer(optional) is{ "type": "business" | "individual", "name": "…", "address": { "country": "…" } }; SET seals it at rest and names it as the sender when a payment matches. Next step uses:id,state(open),payableAmount,pay.amount,pay.reference. Paid in stablecoin, the payer sends exactlypayableAmount: its last decimals identify the invoice. Paid by bank, the payer quotes the invoice number (pay.reference`).
- Give the payer one link. The link carries the amount still due and the invoice's currency, and offers card when the invoice is in USD (send
"card": falseto offer none). One link per invoice: asking again returns the same link.POST /v1/payment_links· Header:Idempotency-Key``json { "invoice": "inv_…" }`Next step uses:url,card,active`.
- A payer who sent stablecoin can name the transaction, before or after it arrives. Stablecoin invoices only.
POST /v1/invoices/{id}/payment_claims· Header:Idempotency-Key``json { "txHash": "0x…" }`Next step uses:claim.matched,state`.
- Read what matched, and match the rest by hand. Matches happen by themselves. Read paid invoices with
GET /v1/invoices?state=paidand payments that matched nothing withGET /v1/payments?state=unmatched(fieldsid,kind,receivedAmount). Then match one:POST /v1/payments/{id}/match· Header:Idempotency-Key``json { "invoice": "inv_…" }`Next step uses:state(matched),invoice,rule(manual`).
- Name your ledger accounts once. Each key is a journal role; each value is your account's name or number (1 to 80 characters). Roles:
clearing,receivable,tag_income,overpayment,bank,fees_set,fees_provider,rounding,returned_wallet,card_clearing,card_sales,refunds,wallet,stablecoin_wallet,escrow_funds,payable,prefunding_payable(the last four for SET Escrow).PUT /v1/ledger_mapping``json { "receivable": "…", "clearing": "…" }`Next step uses:mapping(roles you leave out keepdefaults`).
- Export the month.
formatiscsv(default),json, orqbofor a QuickBooks Online journal import.GET /v1/journal_entries/export?month=2026-10&format=csvAnswer: a CSV file, or withjsonthe fieldsmonthandentries.
In SET Console
- In SET Console, open Merchant View › Invoices and press Send an invoice (or Workflows › Send an invoice). Fill in Your account (customer), Invoice number, Amount, Currency, Due date (optional) and Paid into account, then Review and Confirm. The receipt shows Invoice, Number and its state. The console form makes a bank-paid invoice (
pay.virtualAccount); an invoice paid to a Cash-Out Address: Console: not available. Use the API call. - A payment link for an invoice: Console: not available. Use the API call. (The Create a payment link workflow is demo-only and makes a card link for an amount, not for an invoice.)
- Naming a transaction for an invoice: Console: not available. Use the API call.
- Matching a payment by hand: Console: not available. Use the API call.
- Ledger mapping: Console: not available. Use the API call.
- Export: Console: not available. Use the API call. Merchant View › Accounting › Journal entries lists the entries, and Export CSV under the table saves the rows shown, not the month's export file.
Signed in, the API Builder in the console's top bar sends any of the calls above as you, within your role.
Check it worked
GET /v1/invoices/{id}:stateispaid(orshort,over),receivedAmount, andpaymentswith each match'srule.GET /v1/journal_entries: onereceiptentry per matched payment.- In SET Console: Merchant View › Invoices › Invoices shows the invoice's state; Overview lists an open invoice past its due date under what needs attention.
- Webhooks:
invoice.created,payment.matched,payment.unmatchedandinvoice.<state>(for exampleinvoice.paid);payment_link.createdfor a new link. See Webhooks and events.
If it fails
403 invoices_merchant_only: the key is a platform account's; invoices are for a business account.404 customer_unknown:customeris not your business's id.400 number_invalid,400 amount_invalid,400 currency_invalid,400 due_at_invalid: a field outside its format.400 pay_invalid:payneeds exactly one ofcashOutAddressorvirtualAccount.404 cash_out_address_unknown,404 virtual_account_unknown: not one of your customer's.409 currency_mismatch: the address or account does not take and pay the invoice's currency. Cross-currency invoices are refused.400 amount_too_small: a stablecoin invoice is below the provider's Cash-Out minimum.409 invoice_number_taken: that number is already used.409 payable_amount_exhausted: too many open invoices of that amount on one address; void or settle some.409 invoice_settled: the invoice is not open (link, claim or match).400 field_not_used: an invoice's link takes noamountorcurrency.409 claim_not_applicable: bank invoices are matched by reference, not by claim.400 tx_hash_invalid,409 tx_already_claimed.404 payment_unknown,409 payment_matched,409 payment_card(card payments match only through their payment link),409 invoice_elsewhere,409 amount_unknown.400 role_unknown,400 account_invalid: a ledger mapping key or value outside the rules above.400 month_invalid,400 format_invalid: export parameters.
All codes: Errors.
Related
- Create an invoice
- Match a payment
- Export journal entries
- Card payments
- Take stablecoin and be paid in your own currency (UC-B-01)
- Idempotency
- All use cases
Changes
- 2026-11-18: Docs, OpenAPI and Postman synced to the wallet at: SET Escrow journal entries and SET Close.
- 2026-11-18: SET Docs lead with the SET Crypto API Suite, then the SET API, then SET Direct Deposit.
- 2026-11-16: Every use case step by step, by API and in the console.
- 2026-11-16: The modernized API Reference, the sandbox-key form, Direct Deposit without a revenue share.