commerce
POST /v1/orders/{orderId}/payment-attempt/withdraw
Withdraw a payment waiting on the customer, to pay another way.
Authentication
Send an API key as a bearer token. The endpoint checks billing.payment.manage; a key without it is refused with 403, not 404.
This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.
Try it
Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.
curl -X POST https://api.zinndigital.com/v1/orders/{orderId}/payment-attempt/withdraw \
-H "Authorization: Bearer zdk_live_…"Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console
Details
For an unpaid order whose payment is waiting on the customer (a 3-D Secure challenge, a PayPal approval not yet given). Each waiting attempt is withdrawn only when its payment provider confirms it can no longer take money: a card payment is cancelled at the processor (never one that is processing, authorised or captured); a PayPal payment only while PayPal holds no approval for it. Any account credit it held is given back. It never charges and never starts a payment: pay again with payOrder or the order's payment options. withdrawn is how many attempts were withdrawn (0 when nothing was waiting); step is the order's payment step afterwards. A 422 with refusal.commerce.paymentWithdrawMayLand or refusal.commerce.paymentWithdrawCannotStop means a payment may still go through, and that attempt was left as it is.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
orderId (path) | Uuid | Yes | The order's id. |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
withdrawn | integer | Yes | — |
step | string<pay, confirm, settling> | Yes | — |
Errors this endpoint can return
401 · 403 · 404 · 422 · 429