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
PATCH /v0/orders/:orderIdOrNumber/cancel Parameter
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/497f6eca-6276-4993-bfeb-53cbbbba6f08/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. Supports full and partial refunds. Requires write access, and refunds must be enabled for your workspace and on the platform — the endpoint returns 404 while refunds are not enabled; contact support to enable them. The customer is refunded first; the platform fee is adjusted for the refunded amount. Idempotency: when `idempotencyKey` is omitted, a key is derived from the request (amount, reason, metadata) and the order's refund state at request time. That protects true retries of an identical request, but a keyless retry after a lost response can be treated as a new request (and refund twice) once the first refund has applied — always send a stable `idempotencyKey` for retries. Repeating a non-exhausting partial refund with the same `idempotencyKey` returns the original refund and makes no further changes (no duplicate refund, status change, or notification). A repeat that would now be rejected by a fresh eligibility check — a full refund, an exhausting partial, or one exceeding the currently refundable amount — returns 400 instead; retry with a smaller/different request, or contact support to confirm the original refund's status.