API ReferenceTransactions
Cancel a transaction
POST /v1/transactions/{id}/cancel : cancel a pending transaction.
POST /v1/transactions/{id}/cancel
Headers
| Header | Required | Value |
|---|---|---|
Authorization | yes | Bearer sk_... |
Path params
| Param | Type | Notes |
|---|---|---|
id | string | Transaction ULID |
What can be cancelled
Only pending transactions: before the provider leg is submitted. A
processing transaction cannot be cancelled (the provider may already have
it); wait for the webhook or check status.
Request
curl -X POST https://api.ouipay.com/v1/transactions/01M2S18.../cancel \
-H "Authorization: Bearer sk_test_..."Response 200
The transaction with status: "failed" and failure.code = "CANCELLED".
Any hold on funds is released.
Errors
| HTTP | error.code | Cause |
|---|---|---|
| 404 | NOT_FOUND | No such transaction |
| 409 | CONFLICT | Not in a cancellable state |