Cancel order
Cancel a specific order by changing its status to CANCELLED. This action does not automatically process refunds. To refund a paid order, use the refund endpoint or process through your payment provider. Requires write access.
Authorization
Public key Secret key In: header
In: header
Path Parameters
Order identifier - either the order UUID or the order number as returned in 'number' (e.g., L8VQK3N2M7KpQ9nR). This endpoint also accepts the number with the leading '#' the dashboard shows; subscription endpoints do not, so prefer sending it without.
Request Body
application/json
PATCH /v0/orders/:orderIdOrNumber/cancel Request body
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X PATCH "https://example.com/v0/orders/550e8400-e29b-41d4-a716-446655440000/cancel" \ -H "Content-Type: application/json" \ -d '{}'{ "status": "success", "data": { "order": { "object": "order", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "number": "string", "status": "PENDING", "value": 0, "tax": 0, "fee": 0, "totalItems": 0, "country": null, "currency": "AFN", "currencyDecimals": null, "createdAt": 0, "userId": null, "user": null, "lastPaymentId": null, "lastPaymentNumber": null, "lastPayment": null, "subscriptionId": null, "subscription": null, "checkoutId": null, "orderNumber": "string" } }}Update order PATCH
Modify an existing order's details. Can update status, value, fee, tax, and currency. Requires write access. Note: Use with caution as this directly modifies order records. For most cases, use the refund or cancel endpoints instead.
Refund order payment PATCH
Refund a paid order via Stripe, in full or in part. Requires write access. The customer is refunded first, then the platform fee is adjusted for the refunded amount. Errors: 403 when refunds are not enabled for your workspace — contact support to turn them on. 404 when the order does not exist, and when the endpoint is not available to you. 400 when the order exists but cannot be refunded: it was paid through a processor that doesn't support refunds through this API, its status does not allow a refund, or the amount is above what is still refundable. The 400 message says which. Refunds on a workspace can also be temporarily limited while earlier ones finish settling; that is a 400 telling you to try again later, and it clears on its own. A disputed charge is checked against Stripe live, at request time. If that lookup fails, you get a 503, not a 400 — retry the request; this is not a rejection. Idempotency: send a stable `idempotencyKey` on every retry. Retries carrying the same key are deduplicated. A refund sent without a key is not guaranteed to be deduplicated, so retrying one after a lost response can refund the customer again. Retrying a non-exhausting partial refund with the same `idempotencyKey` returns the original refund and changes nothing else — no second refund, no status change, no notification. If that same key repeats a request a fresh eligibility check now rejects — a full refund, an exhausting partial, or one above the currently refundable amount — you get a 400. Retry with a smaller amount, or contact support to confirm the original refund's status.