Skip to main content

Bulk Re-link Open Lines to Mapped Products

POST 

/api/configurable-products/bulk-relink-open-lines

Run Re-link Open Lines for several configured SKUs at once: each mapped configured SKU moves its open lines on the base product onto its mapped product where that is safe, exactly as the single-row endpoint does. A configured SKU that is not mapped, whose mapped product is archived, that uses its base product, or that no longer exists is skipped with the reason; one whose re-link raises an error is reported as failed and the rest carry on.

Required scope: products:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token (scopes products:write and orders:write) and the permissions to create products and update sales orders.

Body:

  • ids (array of integers, required, 1 to 2,000, distinct) — configured SKU (mapping) IDs. Selecting every row that matches a filter: send the matching IDs in ids, at most 2,000 per request; split a larger selection into several requests.

Up to 25 IDs run now and return 200 with the outcome:

  • summary — one line, e.g. "3 open lines moved, 1 left on the base product, 0 failed; 1 configured SKU skipped."
  • rows_processed, rows_relinked, rows_skipped, rows_failed — configured SKUs by outcome.
  • lines_moved, lines_blocked, lines_failed — order lines moved, left on the base product because moving them isn't safe, and whose move failed.
  • lines_blocked_reasons / lines_failed_reasons — {reason: line count}, most common first (an empty list when there are none).
  • has_failures, failed_count — whether anything failed, and how many configured SKUs plus lines.
  • errors / warnings — [{message}], one per failed configured SKU or failed reason, and one per skipped configured SKU or blocked reason.
  • results[] — per configured SKU: id, outcome (relinked | skipped | failed), configured_sku, message (why it was skipped or failed), lines_moved, lines_blocked, lines_blocked_reasons, lines_failed, lines_failed_reasons.

Line-level reasons are the plain-sentence reasons described under Blocked lines on Re-link Open Lines to Mapped Product. Individual lines are not listed here; call Get Configurable Product for a row's blocked lines with their codes.

More than 25 IDs run in the background and return 202 with tracked_job_id and data.tracked_job_log_id. The job's results hold the same fields once it completes.

Returns 422 on validation errors, 404 while line options are switched off.

Request​

Responses​

OK

Response Headers
    Content-Type