Replace Channel-Linked Sales Order Lines
POST/api/v2/sales-orders/:salesOrder/channel-mappings/replace
Swaps the order lines linked to one sales channel line for another line of the same order, e.g. the bundle components a channel item was split into, replaced by the kit product that ships. The replacement line is linked to the channel line and keeps that link through channel re-syncs. Each replaced line is deleted, or, when a shipping provider has a record of it (a fulfillment order for it was submitted to, or voided at, a carrier), every remaining unit is cancelled and the line drops to a zero price, so it stays as history without counting toward the order total.
orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
Request Body:
- sales_channel_line_id (required, string): The marketplace order item ID the lines are linked to
- line_id (required, integer): The order line that replaces them (must belong to this order)
- replaced_line_ids (required, array of integers, min 1): Order lines currently linked to sales_channel_line_id; must belong to this order and must not include line_id
Errors:
- 409 when a replaced line has shipped units or is committed to a live fulfillment (cancel or void the fulfillment first)
- 422 when a line does not belong to this order or a replaced line is not linked to sales_channel_line_id
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Conflict
Response Headers
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.