The Acme Billing API uses HTTP status codes. A 2xx status means success, and a 4xx status means that the request has a problem that you can fix.
Errors use the problem details format (RFC 9457) with the application/problem+json media type:
{
"type": "https://acme-billing.redocly.app/guides/errors#invoice-not-voidable",
"title": "Invoice cannot be voided",
"status": 409,
"code": "invoice_not_voidable",
"detail": "Invoice INV-2042 is paid. Only open and unpaid invoices can be voided.",
"instance": "/invoices/INV-2042/void"
}
| Field | Description |
|---|---|
type | A link to the section of this page for the error. |
title | A short summary of the error type. |
status | The HTTP status code. |
code | A stable code for the error. Use it in your code, not title or detail. |
detail | An explanation of this error, for people. |
instance | The path of the request. |
| Status | Code | Meaning |
|---|---|---|
400 | invalid_parameter | A query parameter is not valid. |
401 | unauthorized | The API key is missing or not valid. |
404 | not_found | No object with this ID exists in your account. |
409 | invoice_not_voidable | You tried to void a paid or void invoice. |
429 | rate_limited | You sent too many requests. |
Status 400. A query parameter has a value that the API does not accept, for example status=late. detail names the parameter and the accepted values.
Status 401. The request has no X-API-Key header, or the key is revoked or not valid. See Authentication.
Status 404. No customer, invoice, or payment with this ID exists in your account. Check the ID, and check that you use the API key of the correct account.
Status 409. You can void only an open or an unpaid invoice. A paid invoice and an invoice that is already void return 409. To return money for a paid invoice, refund the payment in the dashboard. See Invoice lifecycle.
Status 429. Each API key can send 100 requests per minute. Wait for the number of seconds in the Retry-After header, then send the request again.