commerce
POST /v1/orders/{orderId}/cancel
Cancel your own unpaid order.
Authentication
Send an API key as a bearer token. The key must carry the billing.payment.manage permission; 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}/cancel \
-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
DAY-0296. Cancels an order that is still pending_payment or payment_failed and has no payment captured, refunded or still being confirmed (our record first, then the payment provider is asked). Nothing is charged. Cancelling an order that is already canceled returns it unchanged. A payment taken or still confirming is a 409 (refusal.commerce.orderPaymentConfirmingCancel); an order in any other state is a 409 (refusal.commerce.orderNotUnpaidCancel); another organization's order is a 404. A card attempt the provider holds at requires_payment_method, canceled, requires_action (abandoned at its 3-D Secure step) or requires_confirmation (nothing authorised) is cancelled at the provider first and does not block the cancel; a provider that cannot be asked keeps the 409. The cancel is audit-logged (order.cancelled_unpaid). Requires billing.payment.manage. When the platform's unpaid-order expiry is switched on, an unpaid order is also cancelled automatically 7 days after placing, at least 48 hours after the reminder that named that date.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
orderId (path) | Uuid | Yes | The order's id. |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
id | Uuid | Yes | UUIDv7 identifier — sortable by creation time. |
org_id | Uuid | Yes | UUIDv7 identifier — sortable by creation time. |
human_ref | string | Yes | Human-friendly order reference. |
status | OrderStatus | Yes | An order's lifecycle state. |
currency | CurrencyCode | Yes | ISO 4217 currency code (money is minor units + this code). |
subtotal_minor | integer | Yes | — |
tax_minor | integer | Yes | — |
discount_minor | integer | Yes | — |
total_minor | integer | Yes | — |
credit_applied_minor | integer | No | Account credit that pays first if the customer pays this order now (the card door's own rule, read from the wallet on the server). 0 when the order is not awaiting payment or… |
amount_due_minor | integer | No | What paying this order now charges the rail: total_minor less credit_applied_minor. Returned by getOrder only. |
billing_country | object | No | — |
placed_at | object | No | — |
created_at | string | Yes | — |
updated_at | string | No | — |
use_credit | boolean | No | The customer's checkout choice to let account credit pay first (row 1106#49), as stored on the order. false means the balance is never drawn for this order: every payment… |
lines | OrderLine[] | Yes | — |
payments | Payment[] | Yes | — |
coverage | PaymentCoverage | null | No | What paying this order buys, said BEFORE the customer pays: the subscription period it covers, the periods still owed after it, and whether the services… |
payment_failure | PaymentFailure | null | No | Present only on an unpaid order (pending_payment / payment_failed) whose latest payment attempt FAILED; null otherwise. Says why, so the customer is told plainly and offered… |
renewal | OrderRenewalPreview | null | No | When the plan this order buys first renews and what that renewal will charge, if the order were paid now (P6c-025): the card payment step says it beside "Renew automatically".… |
Errors this endpoint can return
401 · 403 · 404 · 409 · 429