Create Variant
Variants
Create Variant
Add variants to a product
POST
Create Variant
There is no variant endpoint on the OAuth App API (
/api/v1/). This is
the merchant Admin API route, authenticated with a merchant access token
(not an app OAuth access token). To create variants from an app, send them in
the variants[] array of Create Product.Create Variant
There is no OAuth App API route for creating variants individually. Variants are created in one of two ways:- Merchant dashboard API —
POST /variants/bulk-add-variant/{product_id}adds one or more variants to an existing product (described below). - App API product create — pass a nested
variantsarray inside the body ofPOST /api/v1/products.json(Create Product).
bulk-add-variant route. It requires a
merchant (or staff) JWT and accepts a multipart/form-data body (so an
optional mainImage file can be attached). The variants field is a JSON
array of variant objects.
Path Parameters
The product ID to add variants to.
Body Parameters
Array of variant objects. Each object accepts the fields below.
When
true, append the supplied variants to the product’s existing set.
When false (default), the supplied set replaces the product’s variants.Optional variant image (multipart file part).
Variant object fields
Option name (e.g.
"Size").Option value (e.g.
"Medium").Variant price.
Discounted / compare-at price.
Stock quantity.
Stock status (e.g.
in_stock).Stock keeping unit.
Variant weight.
Weight unit (e.g.
kg).Request
Response
Responses use the platform response envelope:status, state, message,
data.