Skip to main content
POST
POST /payment/{id}/cancel voids an authorization before it is captured, releasing the hold on the cardholder’s funds immediately. Use this when an order is cancelled or cannot be fulfilled after the authorization was placed. If the payment has already been captured and settled, use Refund instead — you cannot cancel a captured payment.

Identifying the payment

{id} is the Therius payment id returned by POST /payment/authorization and POST /payment/purchase. orderCode and paymentCode are your own reference fields and are not accepted here. An unknown or non-owned id returns 404.

Example

Cancel an authorization

This endpoint only works for payments in the authorized state. If the payment has already been captured, this call will return an error. Use Refund to return funds on a captured payment, or Cancel or Refund if you don’t know the current state.
When you cancel an authorization, the cardholder’s available balance is restored immediately on Therius’s side. The reflected timing on the cardholder’s bank statement varies by issuer — it’s typically instant to a few hours, but can take up to 3–5 business days for some issuers.

Authorizations

Authorization
string
header
required

Your secret API key: Bearer prv_production_xxx (production) or Bearer prv_sandbox_xxx (sandbox).

Headers

Idempotency-Key
string<uuid>

A UUID you generate per operation. Required in production. Retrying with the same key returns the original response.

Path Parameters

id
string<uuid>
required

The Therius payment id returned by POST /payment/authorization or POST /payment/purchase.

Body

application/json
merchantCode
string
required

Your merchant account identifier. Validated against the Bearer key's merchant; required if the key maps to more than one merchant account.

reference
string

Optional internal reference for this cancellation.

Response

200 - application/json

Cancellation result

Result of a capture, refund, cancel or cancel_or_refund.

id
string

The Therius payment id.

merchantCode
string
orderCode
string
paymentCode
string

Therius receipt ID.

amount
object
status
enum<string>

Outcome of the operation.

Available options:
captured,
refunded,
cancelled,
failed