Skip to main content

Preview Copying Components to Variants

POST 

/api/v2/products/:product/component-copy/preview

Show what each sibling variant would get from copying this variant's components, without changing anything: its recipe before and after, which component IDs are added, removed or change quantity, and how each line was mapped.

Required scope: products:write

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

Variant-aware mapping: when a component is itself a variant of a matrix product and carries the source's option value (for example Finish = Gold), the target gets that component's sibling with the target's option value (Finish = Silver). When the component's matrix has no variant with that value, the component is copied as-is and the line's mapping is fallback with a note. Option values are matched case-insensitively.

Each target reports status: will_update, unchanged (already has exactly this recipe), or skipped (with reason, e.g. a standard variant, or a recipe that would contain itself). Line mapping is same, mapped, fallback, or kept (already on the target).

Fields:

  • mode (required, string): replace — each target's recipe becomes the source's recipe and components not in it are removed; add_missing — each target keeps its components and quantities, and only components it lacks are added.
  • target_ids (optional, array of integers, distinct): the sibling variants to copy to. Omit to include every other variant of the same matrix. An ID that is not a sibling variant is rejected with 422.

Returns 422 when the source is not a bundle or kit variant of a matrix, or has no components.

Authentication: Requires Bearer token.

Request​

Responses​

OK

Response Headers
    Content-Type