# Cancel an order

[All field references](/en/developers/field-reference) · [Orders](/en/developers/fields-group-orders)

`POST /v1/orders/{id}/cancel`

Submits a durable cancellation command. Revision and idempotency key prevent races and double execution. Rejected once picking or production has started on your own order; if a fulfiller has started, the fulfiller is asked (message goes to them). With fulfillment, a decision may be required. An accepted command can still be rejected later; track the command status until completed or rejected.

Required scopes: `"orders:cancel"`.

[How to read these tables](/en/developers/field-reference#reading-the-field-tables)

## Parameters

### path: id

Required. Meykt ID of an order of this API channel and this environment.

| Field | Type | Presence | null | Meaning, limits and examples |
| --- | --- | --- | --- | --- |
| $ (whole value) | string | Whole value | Not allowed | format: `"uuid"`. |

## Request body

Request body required.

Content type: `application/json`

| Field | Type | Presence | null | Meaning, limits and examples |
| --- | --- | --- | --- | --- |
| $ (whole value) | object | Whole value | Not allowed | Additional properties are not allowed. |
| idempotency_key | string | Required when parent is present | Not allowed | New UUID for this intended command. Retry the identical command with the same UUID after an unclear response. format: `"uuid"`. |
| expected_revision | string | Required when parent is present | Not allowed | Unchanged revision from the latest order response; a stale revision rejects the command. format: `"date-time"`. |
| message | string | Required when parent is present | Not allowed | Reason for requesting cancellation, shown to the fulfillment partner. minLength: `1`. maxLength: `4000`. |
| billing_choice | string | Required when parent is present | Not allowed | Explicit billing decision: preserve keeps booked services; reverse requests their reversal where allowed. Never infer this choice. enum: `["preserve","reverse"]`. |

## Response 200, 202

200: Success; see the status meaning of the operation. 202: Success

Content type: `application/json`

| Field | Type | Presence | null | Meaning, limits and examples |
| --- | --- | --- | --- | --- |
| $ (whole value) | object | Whole value | Not allowed | Additional properties are not allowed. |
| data | object | Required when parent is present | Not allowed | Authorized response payload or documented event data. Additional properties are not allowed. |
| data.command | object | Required when parent is present | Not allowed | Stored command outcome. processing and decision_required are provisional; completed and rejected are final. Additional properties are not allowed. |
| data.command.command_id | string | Required when parent is present | Not allowed | Identifier of the durable command whose outcome can be read again. format: `"uuid"`. |
| data.command.order_id | string | Required when parent is present | Not allowed | Meykt order ID from authorized reads; not order number/external reference. format: `"uuid"`. |
| data.command.kind | string | Required when parent is present | Not allowed | Kind selects required fields. enum: `["change","cancel"]`. |
| data.command.state | string | Required when parent is present | Not allowed | Operation state; processing/decision states do not prove completion. enum: `["processing","decision_required","completed","rejected"]`. |
| data.command.revision | string or null | Required when parent is present | Allowed by schema | Revision token; reuse unchanged for the next change. |
| data.command.code | string or null | Required when parent is present | Allowed by schema | Code of this condition, record or business result. |
| data.command.created_at | string | Required when parent is present | Not allowed | Created at, with time-zone offset. |
| data.command.updated_at | string | Required when parent is present | Not allowed | Last changed at, with time-zone offset. |

## Response 400, 401, 403, 404, 409, 413, 422, 429, 500, 503

400: The request is not valid JSON. 401: The key is missing, unknown, revoked or expired. 403: The key lacks a required scope, or the operation requires a live key. 404: Not found. Also applies to IDs that belong to another organization — we deliberately do not distinguish between "does not exist" and "does not belong to you". 409: The same ID already exists with different content. It is never overwritten. 413: The JSON request exceeds 256 KiB. 422: Content validation failed. The response lists all affected locations at once. 429: A rate limit was reached and the request did not run. Wait for Retry-After, then repeat it unchanged. X-RateLimit-Scope names the limit: key (120 requests per minute), organization (300 per minute across all keys), write (1,000 at once, refilling at 60 per minute) or list (300 unfiltered list pages at once, refilling at 10 per minute). 500: Unexpected error on our side. 503: Temporarily unavailable. Repeat the same request with the same business identity.

Content type: `application/json`

| Field | Type | Presence | null | Meaning, limits and examples |
| --- | --- | --- | --- | --- |
| $ (whole value) | object | Whole value | Not allowed | — |
| error | object | Required when parent is present | Not allowed | Machine-readable error code; use it to select the documented recovery path. |
| error.code | string | Required when parent is present | Not allowed | Machine-readable, permanently stable error code. Program against it, not against message. |
| error.message | string | Required when parent is present | Not allowed | Explanation for humans. May change at any time. |
| error.field | string | Optional | Not allowed | Affected location in the request, if it can be determined. |
| error.doc_url | string | Required when parent is present | Not allowed | Documentation link explaining this API error. format: `"uri"`. |
