Marketplace
Create/Replace Product Variants
Fully replace the variant tree for a product — this is a destructive full-sync, not an incremental add.
POST
Create/Replace Product Variants
Sets the complete variant tree (variations → optional sub-variations → sub-variants) for a product. This is a full replace, not an append: any existing variant nodes not present in your request are deleted.Path Parameters
integer
required
A product you own, or a product owned by an active sub-merchant in your marketplace (marketplace operators can manage sub-merchant product variants directly).
Request Body
string
required
Label for the top-level variation axis, e.g.
"size".string
Display label shown to customers. Defaults to
variation_type if omitted.boolean
Whether each variation has a nested sub-variation axis (e.g. size → color). Recalculated server-side after processing — the server checks whether any
variations[].sub_variation.sub_variants actually has entries and overwrites whatever you sent with that computed value. Sending true with no real sub-variants will be silently corrected to false.integer
default:"0"
Only used if you provide it and it’s truthy — otherwise it’s computed server-side as the sum of each variation’s
variation_quantity. Either way, a second pass then recomputes the true total from the full tree (including sub-variant quantities) and writes that final number back to both the variation tree and the product record — so don’t rely on the value you sent surviving unchanged.array
required
Non-empty array. Each item:
Response
Side Effects
- Recomputes and overwrites
total_quantityon both the variation tree and the parentProductrecord. - Sets
Product.has_variation = trueunconditionally, even ifvariationsends up empty after processing. - Deletes any variant/sub-variation/sub-variant rows not present in this request’s
variationsarray (see warning above).
