Cancel an invoice
Cancels an invoice that has not been paid yet on the account bound to the API key. The invoice is identified by either id or merchant orderId - at least one is required. Returns 400 if the invoice has already been settled or cancelled.
Required scope: invoices.cancel.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Invoice ID (UUID) returned from POST /invoice. Mutually optional with orderId.
Merchant orderId supplied when the invoice was created. Mutually optional with id.
Responses
Section titled “Responses”Invoice cancelled.
Invoice cannot be cancelled in its current status, or neither id nor orderId was supplied.
Missing or invalid x-tenant-api-key header. Code: exceptions.auth.invalidApiKey.
object
Stable machine-readable error code, namespaced under exceptions.. Always prefer branching on this value over message. See the per-route descriptions for the codes that route emits.
Human-readable explanation. Subject to wording changes; for programmatic checks use code instead.
Optional structured payload accompanying the error. For exceptions.rateLimit.exceeded includes msBeforeNext; for validation errors includes the offending field info.
object
Example
{ "code": "exceptions.auth.invalidApiKey", "message": "Invalid or missing API key"}Request origin IP is not on the tenant API allowlist (exceptions.auth.ipNotAllowed), or the API key is missing the scope required by this operation (exceptions.auth.insufficientScope).
object
Stable machine-readable error code, namespaced under exceptions.. Always prefer branching on this value over message. See the per-route descriptions for the codes that route emits.
Human-readable explanation. Subject to wording changes; for programmatic checks use code instead.
Optional structured payload accompanying the error. For exceptions.rateLimit.exceeded includes msBeforeNext; for validation errors includes the offending field info.
object
Example
{ "code": "exceptions.auth.invalidApiKey", "message": "Invalid or missing API key"}Invoice not found.
Rate limit exceeded for this endpoint. Retry after the window resets. Code: exceptions.rateLimit.exceeded. The extension.msBeforeNext field tells you how long to wait.
object
Stable machine-readable error code, namespaced under exceptions.. Always prefer branching on this value over message. See the per-route descriptions for the codes that route emits.
Human-readable explanation. Subject to wording changes; for programmatic checks use code instead.
Optional structured payload accompanying the error. For exceptions.rateLimit.exceeded includes msBeforeNext; for validation errors includes the offending field info.
object
Example
{ "code": "exceptions.auth.invalidApiKey", "message": "Invalid or missing API key"}Unexpected server error. Safe to retry idempotent operations after a backoff.
object
Stable machine-readable error code, namespaced under exceptions.. Always prefer branching on this value over message. See the per-route descriptions for the codes that route emits.
Human-readable explanation. Subject to wording changes; for programmatic checks use code instead.
Optional structured payload accompanying the error. For exceptions.rateLimit.exceeded includes msBeforeNext; for validation errors includes the offending field info.
object
Example
{ "code": "exceptions.auth.invalidApiKey", "message": "Invalid or missing API key"}