Cancel a payment waiting for the payer
Only an AWAITING_CUSTOMER payment can be canceled. Canceling an already canceled payment returns the same result.
The merchant receives a payment.canceled webhook.
ApiKeyBearerAuthorizationBearer <sk_test_… | sk_live_…>The application's API key. sk_test_…: sandbox, no money moves. sk_live_…: real.
id*stringPayment identifier (UUID).
uuidThe canceled payment.
application/json- response
id*stringuuidstate*PaymentState"CREATED""AWAITING_CUSTOMER""PROCESSING""SUCCEEDED""FAILED""EXPIRED""CANCELED"mode*string"LIVE""TEST"merchant_reference*stringamount*stringAmount in major units, at the currency's exponent.
amount_minor*integerThe same amount in minor units.
int64currency*stringdescription?string|nullmetadata*networks*array<string>Networks the payer can choose, in alphabetical order: those left after country and networks.
Only one for a direct payment, the one the merchant chose.
network?|The network of the latest attempt, the one the payer paid or tried to pay with; null until they have tried.
checkout_url*|The payment page link, to give the payer. null for a direct payment, which skips the page: for a
redirect network (Wave), the operator's link is redirect_url.
expires_at*stringdate-timesucceeded_at?|date-timecreated_at*stringdate-timeattempts?array<>|Present when reading a payment and in the response of a direct payment (the opened attempt);
null when creating a payment with a payment page, in the list and on cancellation.
next_action?stringOnly present in a direct payment's response (network and msisdn at creation).
REDIRECT: send the payer to redirect_url. NONE: nothing to do, the payer confirms on their
phone; follow the payment with GET /v1/payments/{id} or the webhook.
"NONE""REDIRECT"redirect_url?|Only present in the response of a direct payment. The operator's page, for REDIRECT.
curl -X POST 'https://api.flowpay.example/api/v1/payments/{{paymentId}}/cancel'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "state": "CREATED", "mode": "LIVE", "merchant_reference": "string", "amount": "5000", "amount_minor": 5000, "currency": "XOF", "description": "string", "metadata": {}, "networks": [ "BF_ORANGE" ], "network": "BF_ORANGE", "checkout_url": "string", "expires_at": "2019-08-24T14:15:22Z", "succeeded_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "attempts": [ { "attempt_no": 1, "state": "CREATED", "provider_key": "LIGDICASH", "route_reason": "LOWEST_COST", "route_cost_minor": 0, "failure_class": "CUSTOMER_DECLINED", "created_at": "2019-08-24T14:15:22Z", "settled_at": "2019-08-24T14:15:22Z" } ], "next_action": "NONE", "redirect_url": "string"}