Skip to main content
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:
  1. Merchant dashboard APIPOST /variants/bulk-add-variant/{product_id} adds one or more variants to an existing product (described below).
  2. App API product create — pass a nested variants array inside the body of POST /api/v1/products.json (Create Product).
This page documents the merchant 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

string
required
The product ID to add variants to.

Body Parameters

array
required
Array of variant objects. Each object accepts the fields below.
boolean
default:"false"
When true, append the supplied variants to the product’s existing set. When false (default), the supplied set replaces the product’s variants.
file
Optional variant image (multipart file part).

Variant object fields

string
required
Option name (e.g. "Size").
string
Option value (e.g. "Medium").
number
required
Variant price.
number
Discounted / compare-at price.
number
Stock quantity.
string
Stock status (e.g. in_stock).
string
Stock keeping unit.
number
Variant weight.
string
Weight unit (e.g. kg).

Request

Response

Responses use the platform response envelope: status, state, message, data.