Apply a customer's credit to an invoice
Draws on the customer's unallocated payment credit, oldest payment first, to pay down this invoice as far as the credit in the invoice's own currency goes. Refused when the invoice is not open, or there is no credit in that currency.
apiKeyAuthorizationBearer <token>An API key from the Developers page. rhq_test_ keys reach the sandbox, rhq_live_ keys the live side.
id*stringSuccess
application/json- response
Success
id*stringnumber*stringCounts up from INV-0001 across your account, with no gaps
customerId*stringcurrency*stringThe currency of every amount on the invoice
"USD""EUR""GBP""CAD""AUD""NZD""CHF""SEK""NOK""DKK""PLN""INR""SGD""HKD""AED""ZAR""BRL""MXN"lines*array<>subtotal*integerThe lines added up, before tax
0 <= valuetaxBps*|The tax rate in basis points. Null when there is no tax
tax*integersubtotal times the tax rate, rounded
0 <= valuetaxLines*array<>How tax is made up, line by line: one entry per matched tax rule component. Empty on an invoice priced with the flat taxBps or with no tax at all
reverseCharge*|Set when the matched tax rule reverse-charges this invoice: tax is 0 and this is the legal note and both parties' tax numbers as they stood at issue
total*integerWhat the customer owes: subtotal plus tax
0 <= valuestatus*stringcredited was corrected in full by credit notes and asks for nothing
"open""paid""void""credited"overdue*booleanTrue for an open invoice whose due date has passed: from a day after dueAt, so an invoice due today is not overdue today
shared*booleanTrue once POST /invoices/{id}/share has made a public link for this invoice, false again once revoked. The token itself is never in this response or the list
issuedAt*stringdate-timedueAt*stringdate-timepaidAt*|nullvoidedAt*|nullnote*string|nullcredited*integerWhat credit notes against this invoice come to. 0 when there are none
0 <= valuepaidAmount*integerCollected so far via payments applied to this invoice. 0 until the first one
0 <= valueamountDue*integerWhat is still owed: total less credited and paidAmount, and 0 on one that is paid, void or credited in full
0 <= valuecreditedAt*|nullissuer*|Your account as it billed this invoice, copied at the time it was issued. Null on invoices made before you set any billing details
actor*|Who raised this invoice
voidedBy*|Who voided this invoice. Null unless status is void
paidBy*|Who recorded this invoice as paid. Null unless status is paid through that path
sharedBy*|Who last shared this invoice. Null until it has ever been shared
curl -X POST "https://example.com/v1/invoices/inv_01K6XJ4Q8ZT3M9R5V2B7WDHNCA/apply-credit"{ "id": "inv_01K6XJ4Q8ZT3M9R5V2B7WDHNCA", "number": "INV-0001", "customerId": "cus_01K6XJ4Q8ZT3M9R5V2B7WDHNCA", "currency": "USD", "lines": [ { "saleId": "sal_01K6XJ4Q8ZT3M9R5V2B7WDHNCA", "description": "northwind-telecom.com, 2 years", "quantity": 2, "unitPrice": 1439, "total": 2878 } ], "subtotal": 2878, "taxBps": 2000, "tax": 576, "taxLines": [ { "name": "string", "rateBps": 2000, "amount": 2878 } ], "reverseCharge": { "note": "string", "sellerTaxId": "string", "customerTaxId": "string" }, "total": 3454, "status": "open", "overdue": true, "shared": true, "issuedAt": "2026-10-07T11:04:31.000Z", "dueAt": "2026-10-21T11:04:31.000Z", "paidAt": null, "voidedAt": null, "note": "Thank you for your business", "credited": 2878, "paidAmount": 2878, "amountDue": 2878, "creditedAt": null, "issuer": { "name": "Northwind Telecom", "legalName": null, "addressLines": [], "taxId": null, "billingEmail": null }, "actor": { "kind": "user", "label": "string" }, "voidedBy": { "kind": "user", "label": "string" }, "paidBy": { "kind": "user", "label": "string" }, "sharedBy": { "kind": "user", "label": "string" }}Revoke an invoice link DELETE
The public link stops working at once. An invoice with no link also answers 204: there is nothing to revoke. Sharing again afterwards mints a different token; the old one stays dead for good.
Issue a credit note POST
Corrects an invoice already issued, by named lines or by a flat amount, instead of editing it: an invoice is never rewritten once sent. A fully credited open invoice moves to `credited`; a paid invoice stays `paid`. Send an Idempotency-Key header so a retry can never credit twice.