Payments and allocations
Money received is two separate facts: the receipt (money arrived) and the allocation (which invoices it paid). Keeping them apart is what lets one payment clear four invoices, or sit on the account until somebody knows what it was for.
These calls move money, so the key needs the money scope.
Recording money received
POST /v1/payments:
[{"external_ref": "PAY-9001", "customer_external_ref": "CUST-1001", "doc_date": "2026-12-03",
"amount": 1150.00, "reference": "ORD-5001"}]
The bank account is the company's default unless you send bank_account_id. A receipt with nothing allocated is a valid state: post it when the money arrives, allocate when you know what it paid. A refund is never a negative receipt; it is a credit note and a refund (below).
Saying what it paid
POST /v1/allocations, one row per invoice:
[{"payment_external_ref": "PAY-9001", "invoice_external_ref": "ORD-5001", "amount": 1150.00}]
Over-allocating - more than the receipt has left or more than the invoice owes - is refused by the ledger. A credit note is allocated to an invoice the same way, with the credit note's ref as payment_external_ref.
One payment for several invoices
When a customer pays several invoices in one go under one number (a remittance), record it first with POST /v1/remittances - its number, total and the invoices it covers. When the money comes, the bank line or the gateway confirmation carrying that number settles every invoice in it. See the Remittances reference.
Credit, and paying it back
GET /v1/creditslists every unused credit for your customers.GET /v1/customers/{externalRef}/creditis one customer's, ready to show in an app.- The customer wants the money instead:
POST /v1/credit-notes/{externalRef}/refund-requestflags it (a flag, nothing moves;DELETEthe same path if they change their mind). - The money leaves:
POST /v1/credit-notes/{externalRef}/refundrecords the refund paid from the bank. Leave outamountto refund all that is unused.
This page as plain text: payments-and-allocations.md