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
| Status | Description |
|---|---|
400 | Transaction is not in a cancellable status (completed or failed cannot be cancelled). |
401 | Missing or invalid API key. |
404 | No transaction found for the given reference under your account. |
Next: Webhooks — receive payment.cancelled and other events without polling.