Skip to main content

Batch Convert Products to Bundle/Kit

POST 

/api/v2/products/bundle-workshop/batch-convert

Batch convert standard products to bundle/kit types.

Required scope: products:write

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

Authentication: Requires Bearer token.

Fields:

  • products (required, array, min 1): Products to convert
    • id (required, integer): Product ID
    • type (required, string): Target type — bundle, kit, or standard
    • components (optional, array): Components to save on the product BEFORE converting. Only applies when type is bundle or kit. Allows converting a product that currently has zero components in a single atomic call.
      • id (required, integer, must exist in products): Component product ID. Components must be standard or kit products (a bundle cannot be a component).
      • quantity (required, numeric, min 1): Quantity of this component per parent unit.

Component handling: When components is provided for a bundle/kit target, they are saved first (via the bundle/kit component setter for the target type), then the type conversion proceeds. If the component save fails (e.g. a component is itself a bundle, a kit component references itself, or a circular kit reference is detected), the item is skipped with the validation message as reason and the product type is left unchanged.

Skip rules — returned in data.skipped[]:

  • Converting to bundle when the source product has prior sale/assembly inventory movements (cannot become a bundle once it has movement history).
  • Converting to bundle or kit when the source product has zero components AND no components were provided in the request (you must add components before promoting it).
  • Provided components failed validation (invalid component type, self/circular reference) — the validation message is returned as the skip reason.

The response payload includes data.converted_count for successful conversions and data.skipped[] for entries that were skipped, each with id, sku, and a human-readable reason.

Request

Responses

OK

Response Headers
    Content-Type