Skip to content
Last updated

Errors

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.

Error format

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"
}
FieldDescription
typeA link to the section of this page for the error.
titleA short summary of the error type.
statusThe HTTP status code.
codeA stable code for the error. Use it in your code, not title or detail.
detailAn explanation of this error, for people.
instanceThe path of the request.

Status codes

StatusCodeMeaning
400invalid_parameterA query parameter is not valid.
401unauthorizedThe API key is missing or not valid.
404not_foundNo object with this ID exists in your account.
409invoice_not_voidableYou tried to void a paid or void invoice.
429rate_limitedYou sent too many requests.

Invalid parameter

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.

Unauthorized

Status 401. The request has no X-API-Key header, or the key is revoked or not valid. See Authentication.

Not found

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.

Invoice not voidable

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.

Rate limited

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.