Payments

Cancel a Payment

Cancel a pending or processing transaction before the customer completes payment.

Cancel a Payment

POST /v1/transactions/:reference/cancel

Cancels a transaction and fires a payment.cancelled webhook. Only transactions in pending or processing status can be cancelled.

Cancellation is irreversible. Once cancelled, the checkout session is invalidated and the customer cannot complete the payment.


Request

curl https://api.epayet.dev/v1/transactions/PAB12CD3420260813/cancel \
  -X POST \
  -H "Authorization: Bearer sk_live_your_key_here"

Path Parameters

Prop

Type


Response

Returns 204 No Content on success. No response body.


Errors

StatusDescription
400Transaction is not in a cancellable status (completed or failed cannot be cancelled).
401Missing or invalid API key.
404No transaction found for the given reference under your account.

Next: Webhooks — receive payment.cancelled and other events without polling.

On this page