Документация / Как начать / Работа с MCP / Идентификаторы и страницы результатов / REST: orders / changeOrderComposition Для AI-агентов: markdown этой страницы — /docs/api-op-changeordercomposition.md · индекс документации — /llms.txt
changeOrderComposition Обновлено 10 октября 2026 г.
POST /api/v1/orders/{seqNum}/composition
changeOrderComposition
# Авторизация и праваScopes: ALL. Auth alternatives: OR; scopes внутри альтернативы: ALL.
Поле Значение security.0.hubApiKey [] security.1.hubBearer [] securitySchemes.hubApiKey.in "header" securitySchemes.hubApiKey.name "X-Api-Key" securitySchemes.hubApiKey.type "apiKey" securitySchemes.hubBearer.scheme "bearer" securitySchemes.hubBearer.type "http" x-required-scopes ["orders:write"]
# Параметры запросаПоле Значение 0.description "Tenant Order sequence (seq_num) serialized as canonical decimal digits." 0.in "path" 0.name "seqNum" 0.required true 0.schema 0.schema 1.description "Required durable money receipt key; replay is retained for 30 days and returns the stored result with replayed=true." 1.in "header" 1.name "Idempotency-Key" 1.required true 1.schema 1.schema 2.description "The order version the change is based on: the weak ETag of GET /api/v1/orders/{id}. Any other value is a stale version (412)." 2.in "header" 2.name "If-Match" 2.required true 2.schema 2.schema
# Тело запросаПоле Значение content.application/json.examples.addLine.summary "Add a product line" content.application/json.examples.addLine.value.catalog_seq_num 23 content.application/json.examples.addLine.value.kind "add_line" content.application/json.examples.addLine.value.quantity 1 content.application/json.examples.removeLine.summary "Remove line 2" content.application/json.examples.removeLine.value.kind "remove_line" content.application/json.examples.removeLine.value.line_no 2 content.application/json.examples.setLinePrice.summary "Agree a unit price for line 2" content.application/json.examples.setLinePrice.value.final_unit_amount "1500.00" content.application/json.examples.setLinePrice.value.kind "set_line_price" content.application/json.examples.setLinePrice.value.line_no 2 content.application/json.examples.setLinePrice.value.reason "Loyal customer" content.application/json.examples.setQuantity.summary "Set the quantity of line 1" content.application/json.examples.setQuantity.value.kind "set_quantity" content.application/json.examples.setQuantity.value.line_no 1 content.application/json.examples.setQuantity.value.quantity 3 content.application/json.examples.setQuantityAtReviewedTotal.summary "Set the quantity only at the reviewed order total" content.application/json.examples.setQuantityAtReviewedTotal.value.expected_amount "4500.00" content.application/json.examples.setQuantityAtReviewedTotal.value.kind "set_quantity" content.application/json.examples.setQuantityAtReviewedTotal.value.line_no 1 content.application/json.examples.setQuantityAtReviewedTotal.value.quantity 3 content.application/json.schema OrderCompositionApplyRequest required true
# ОтветыПоле Значение 200.content.application/json.example.amount "4500.00" 200.content.application/json.example.currency "RUB" 200.content.application/json.example.order_seq_num 45 200.content.application/json.example.order_version "W/\"c8d8e23b45a34ae6\"" 200.content.application/json.example.replayed false 200.content.application/json.schema OrderCompositionApplyResponse 200.description "The change is applied, or the same Idempotency-Key replays its stored result (replayed=true)" 200.headers.ETag.description "The order version (Hub weak ETag); send it as If-Match to change the composition." 200.headers.ETag.required true 200.headers.ETag.schema 200.headers.ETag.schema
# ОшибкиПоле Значение 400.content.application/problem+json.schema ProblemDetails 400.description "Invalid strict body, path or an Idempotency-Key over 128 characters (VALIDATION_ERROR), or a missing Idempotency-Key (IDEMPOTENCY_KEY_REQUIRED)" 401.content.application/problem+json.schema ProblemDetails 401.description "Missing or invalid authentication" 403.content.application/problem+json.schema ProblemDetails 403.description "Missing orders:write scope (INSUFFICIENT_SCOPE) or a credential not admitted to this tenant (FORBIDDEN)" 404.content.application/problem+json.schema ProblemDetails 404.description "No order with this seq_num, or no active line with this line_no, in this tenant (NOT_FOUND)" 409.content.application/problem+json.schema ProblemDetails 409.description "The order is closed (ORDER_CLOSED) or already paid (ORDER_ALREADY_PAID); the recomposed total differs from expected_amount (PRICE_CHANGED); another change to this order is being applied (CONFLICT); or the receipt for this key is still pending (IDEMPOTENCY_KEY_IN_FLIGHT)" 412.content.application/problem+json.schema ProblemDetails 412.description "The order changed since the If-Match ETag was read (PRECONDITION_FAILED); current_etag and the ETag header carry the current version" 422.content.application/problem+json.schema ProblemDetails 422.description "The last active line cannot be removed or the product, price or resulting total is not accepted (INVALID_INPUT), the quantity is outside 1..999 (INVALID_QUANTITY), the product allows one per order (QUANTITY_LIMIT), or the key was reused with a different body (IDEMPOTENCY_KEY_MISMATCH)" 428.content.application/problem+json.schema ProblemDetails 428.description "If-Match with the order version is required (PRECONDITION_REQUIRED)"
# Дополнительные условияПоле Значение description "Apply one change to the composition of an open, unpaid order: remove_line, set_quantity, set_line_price or add_line (a variant change is a remove plus an add). Prices are recalculated by the platform under its pricing rules; an unpaid payment link is reissued for the new amount and the old one no longer pays the order. MCP agents prepare the same change with prepare_order_composition_change first." operationId "changeOrderComposition" tags ["orders"] x-idempotency "durable-receipt"