Cancel selected open quantities or request their cancellation
POST /v1/orders/{id}/remaining-cancellations
Free quantities of your own are canceled directly. Portions handed over to a partner go through the existing partner decision; decision_required is not an accepted cancellation. Booked services stay unchanged. The same request_id keeps the same business context across HTTP and internal interfaces.
Required scopes: "orders:cancel_remaining".
#Parameters
#path: id
Required. Your own API source order.
| 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. |
| request_id | string | Required when parent is present | Not allowed | Request ID; retain for retries of the same operation. format: "uuid". |
| expected_revision | string | Required when parent is present | Not allowed | Latest-read revision; stale revisions rejected. pattern: "^[0-9a-f]{64}$". |
| reason | string | Required when parent is present | Not allowed | Recorded reason. minLength: 1. maxLength: 1000. |
| lines | array | Required when parent is present | Not allowed | All selected lines; each must satisfy this action’s quantity/identity rules. minItems: 1. maxItems: 200. |
| lines[] | object | Every array item | Not allowed | Additional properties are not allowed. |
| lines[].order_item_id | string | Required when parent is present | Not allowed | Line identifier from the current order read. format: "uuid". |
| lines[].quantity | string | Required when parent is present | Not allowed | Exact decimal-string quantity in the stated unit; no floats. maxLength: 24. pattern: "^(0|[1-9]\\d{0,8})(\\.\\d{1,6})?$". |
#Response 200
200: 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_id | string | Required when parent is present | Not allowed | Identifier of the durable command whose outcome can be read again. format: "uuid". |
| data.order_id | string | Required when parent is present | Not allowed | Meykt order ID from authorized reads; not order number/external reference. format: "uuid". |
| data.request_id | string | Required when parent is present | Not allowed | Request ID; retain for retries of the same operation. format: "uuid". |
| data.state | string | Required when parent is present | Not allowed | Operation state; processing/decision states do not prove completion. enum: ["completed","decision_required","rejected"]. |
| data.lines | array | Required when parent is present | Not allowed | All selected lines; each must satisfy this action’s quantity/identity rules. minItems: 1. maxItems: 200. |
| data.lines[] | object | Every array item | Not allowed | Additional properties are not allowed. |
| data.lines[].order_item_id | string | Required when parent is present | Not allowed | Line identifier from the current order read. format: "uuid". |
| data.lines[].quantity | string | Required when parent is present | Not allowed | Exact decimal-string quantity in the stated unit; no floats. maxLength: 24. pattern: "^(0|[1-9]\\d{0,8})(\\.\\d{1,6})?$". |
| data.code | string | Required when parent is present | Not allowed | Code of this condition, record or business result. enum: ["remaining_cancelled","partner_decision_required","remaining_no_longer_available","partner_rejected","withdrawn_by_customer"]. |
| data.billing_changed | boolean | Required when parent is present | Not allowed | Whether this command changed service billing. const: false. |
#Response 401, 403, 404, 409, 413, 422, 429, 500, 503
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". |
Machine-readable version of this page: https://www.meykt.com/developers/fields-cancel-remaining-quantities.md