Batch Convert Products to Bundle/Kit
POST/api/v2/products/bundle-workshop/batch-convert
Batch convert standard products to bundle/kit types.
products:writeGrant 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
bundlewhen the source product has prior sale/assembly inventory movements (cannot become a bundle once it has movement history). - Converting to
bundleorkitwhen the source product has zero components AND nocomponentswere provided in the request (you must add components before promoting it). - Provided
componentsfailed 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
- 200
- 401
- 403
- 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.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
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.