API reference / Act as a platform
Cancel a customer's payment
POST/v1/platforms/{platformOrgId}/customers/{customerOrgId}/payments/{paymentId}/cancel
Acts on a linked customer with the platform's own key or team (platform:customer_operate). Same as POST /v1/orgs/{orgId}/payments/{paymentId}/cancel.
Before you call it
- Organization
platform - Permission
platform:customer_operate
Parameters
| Parameter | What it does |
|---|---|
platformOrgIdpath, uuidrequired | Your platform's organization id. platformOrgId is the platform response's org_id. |
customerOrgIdpath, uuidrequired | customerOrgId is the customer response's org_id. |
paymentIdpath, uuidrequired | The payment id from create payment or list payments. Withdrawals use the same id. |
Response 200
Canceled
| Field | What it does |
|---|---|
idstring (uuid)required | Payment id. Send it as paymentId to get, cancel, approve, or reject the payment. |
account_idstring (uuid)required | Payezy account the money moved from or into. |
directionenumrequired | Whether money came in or went out. One of: inbound, outbound. One of |
kindstringrequired | How the money moved, for example a fiat deposit or a payout. |
purposeenum | payment sends to a third party, withdrawal moves funds to the organization's own account, deposit is incoming One of |
invoice_numberstring | Your invoice or bill number, up to 64 characters. It is stored on the payment. |
statusstringrequired | Where the payment is in its lifecycle, such as pending_approval, processing, completed, failed, or canceled. |
amountstringrequired | Payment amount as a decimal string in major units of asset. |
assetstringrequired | Asset code, such as USD, USDC, or SBC. |
feestringrequired | Fee reserved with the amount, as a decimal string. |
railstringrequired | Rail that sent or received the money, such as ach_credit, wire, or onchain. |
memostringrequired | Note stored with the payment, up to 140 characters. |
failurePaymentFailure | Why a payment failed and the code to branch on. |
failure.codestringrequired | Stable reason the payment failed. |
failure.reasonstringrequired | Why this happened, or why the change is being made. |
created_atstring (date-time)required | When this record was created, as an ISO-8601 timestamp. |
completed_atstring (date-time) | When this finished, as an ISO-8601 timestamp. |
counterparty_idstring (uuid) | Recipient id. A recipient is a counterparty. |
recipientstring | Recipient name (outbound) |
recipient_accountstring | Masked destination, e.g. Chase ••6789 |
dest_assetstring | Stablecoin delivered (crypto payouts) |
dest_networkstring | Network a crypto payout is delivered on. |
tx_hashstring | On-chain hash or bank trace number |
tx_urlstring | Block explorer page for tx_hash. Set only for a crypto payout whose network Payezy supports. |
from_addressstring | On-chain address a crypto payout was sent from (the customer's holding wallet). |
to_addressstring | On-chain address a crypto payout was sent to (the destination wallet). |
approvals_requiredinteger | How many approvals the payment still needs. |
created_bystring (uuid) | User id of the person who created this. |
Events it causes
Errors to handle
| Code | What it means and what to do |
|---|---|
not_cancelable409 | The payment was already sent to the partner. Payments can be canceled only before they are processing. |
Every error is a Problem document. Branch on code; quote request_id to support.