Update an invoice
Present an API key (sb_live_… / sb_test_…), an OAuth2 access token, or a static token as a Bearer credential. The operator is implied by the credential; it is never in the path. Only a SHA-256 hash of an API key is stored server-side.
In: header
Path Parameters
UUIDv7 identifier of the resource.
uuidHeader Parameters
A unique key that makes this mutation safe to retry. Repeats replay the stored response; reuse with a different body returns 409 idempotency_conflict.
length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
All fields optional; only supplied fields are changed. None of these dates may be cleared to unset — a correction replaces the value with a new date, it never removes it. The dates are draft-only; customer_reference may be corrected on any invoice that is not void.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "Content-Type: application/json" \ -d '{}'{ "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "object": "invoice", "contact_id": "f245e2a3-e141-4d41-912c-b1c1f5bd5598", "subscription_id": "aa11a4c2-a467-43db-b413-c4ab0f5cf627", "agreement_id": "67dd069b-637c-4b8e-8d92-17a313d06fb8", "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811", "number": "string", "status": "draft", "currency": "str", "subtotal_minor": 0, "tax_minor": 0, "ipt_minor": 0, "total_minor": 0, "amount_paid_minor": 0, "amount_due_minor": 0, "issue_date": "2019-08-24", "due_date": "2019-08-24", "period_start": "2019-08-24", "period_end": "2019-08-24", "notice_sent_at": "2019-08-24T14:15:22Z", "paid_at": "2019-08-24T14:15:22Z", "voided_at": "2019-08-24T14:15:22Z", "void_reason": "raised_by_mistake", "voided_from": "draft", "customer_reference": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }}{ "error": { "code": "unauthorized", "message": "Missing or invalid credential." }}{ "error": { "code": "insufficient_scope", "message": "The credential lacks a scope required by this endpoint." }}{ "error": { "code": "not_found", "message": "Resource not found." }}{ "error": { "code": "conflict", "message": "The request conflicts with current resource state." }}{ "error": { "code": "validation_error", "message": "One or more fields are invalid.", "details": [ { "field": "email", "issue": "must be a valid email address" } ] }}{ "error": { "code": "rate_limited", "message": "Rate limit exceeded. Retry after 7s." }}{ "error": { "code": "validation_error", "message": "string", "details": [ { "field": "string", "issue": "string" } ] }}List payments GET
Previous Page
Void an invoice POST
Voids an invoice nobody has paid. A draft or open invoice can be voided; an overdue one can be voided once StoreBay has switched overdue voids on for the operator (until then it is refused `409` with "Only a draft or open invoice can be voided."). Refused `409`, each with its own sentence, and `details[0].issue` naming which (`invoice_part_paid`, `invoice_money_against_it`, `invoice_credit_note_against_it`, `invoice_written_off`, `invoice_debt_in_sale`, `invoice_collection_in_flight`, `invoice_shop_sale`, `invoice_not_voidable`): an invoice with money against it (including a part-payment) or a credit note issued or applied against it, whose debt was written off or is part of a sale of goods, with a collection still with the provider, or that is a Shop sale's invoice. Voiding an invoice that is already void answers `200` with the invoice and changes nothing. The status becomes `void` and nothing else on the invoice moves: `amount_due_minor` still reads what was due when it was voided, and nothing is owed. In the same transaction the void closes the customer's arrears case (and requests an unlock of its unit) when nothing overdue is left, and otherwise refreshes its amount; withdraws the reminder emails still waiting to go; closes the invoice's failed collection attempts and cancels their card payments; cancels a refundable deposit that was never paid; reverses the invoice in the connected accounting package; and puts the charges the invoice carried back on the plan's next invoice, unless the plan has ended. It sends no email to the customer. `409` with `code` `invoice_busy` means another writer held something the void needed: try again in a moment.