Cancel Invoice

Cancel invoice endpoint allows you to cancel an invoice when it is still being processed. Invoices can only be canceled when they are in certain selected statuses.

📘

Headers

Three headers are required to use this endpoint.

Required Headers

Name

Type

Required

Description

Authorization

string

Yes

Bearer token (OAuth 2.0) This header holds the bearer token required to use Veem's public API, and belongs to the owner account. Failure to use a valid bearer token will result in a 404 (Not Found) status code in the response. An example of a valid header value is as follows: Bearer c047594b-082c-4da1-be89-08fe3770f4b3

See Get Access Token section to generate your Bearer token

X-Request-Id

string

Yes

This is a unique string that identifies the current API request, and should follow the UUID format. Reusing this header without changing the value will result in a 409 (Conflict) status code in the response. An example X-request-id is as follows:
48855846-628d-4177-b071-80332a116f0a

Content-Type

string

Yes

The content type of the request. Must be application/json

Canceling an invoice

-- Example request: POST /v1.2/invoices/36612/cancel to cancel invoice with id 36612
POST /v1.2/invoices/{{invoiceId}}/cancel
-- Example response when invoice with id 36612 is cancelled successfully 
{
  "id": 36612,
  "amount": {
    "number": 30.0,
    "currency": "USD"
  },
  "status": "Cancelled",
  "requestId": "353d99be-2add-43e3-a6f4-7c80ce5df031",
  "exchangeRate": {
    "rate": 0.80554,
    "toAmount": 24.17,
    "fromAmount": 30.0,
    "toCurrency": "EUR",
    "fromCurrency": "USD"
  }
}

Note: Invoices cannot be cancelled if they are in following statuses: Claimed, MarkAsPaid, Cancelled, or Closed. If the invoice cannot be cancelled, a response code and a reason will be returned in response body.