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

There are 2 headers necessary for the use of this endpoint:

  • X-request-id: This is a number unique to the current API request, and follows the UUID format. Reusing this header without changing the value will result in a 409 (Conflict) status. An example X-request-id is as follows:

48855846-628d-4177-b071-80332a116f0a

  • Authorization: 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. An example of a valid token is as follows:

Bearer c047594b-082c-4da1-be89-08fe3770f4b3

See Get Access Token section to generate your bearerToken

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.