**Version: 202601**

# Create variant

**POST** `/openapi/2026-01/products/:product_id/variants`

Create a new product variant with the specified details.

## Request

**Path Parameters**

- `product_id` string (required)

  The product ID of the variant

**application/json**

**Body | Example**

**Body (required)**

- `variant` object (required)

  The variant details

  - `option1` string

    Option 1
  - `option2` string

    Option 2
  - `option3` string

    Option 3
  - `image_id` string

    ID of the variant's image
  - `compare_at_price` double

    Compare at price (original price)
  - `price` double (required)

    Price of the variant. The variant price will be set to the item's wholesale's price value when the variant price is 0 and the wholesale's price is not 0
  - `sku` string

    SKU
  - `barcode` string

    The barcode of the variant
  - `note` string

    The note of the variant
  - `inventory_quantity` int64

    Inventory quantity
  - `weight` double

    The weight of the variant
  - `weight_unit` string

    Unit of weight, possible value are: `kg`, `g`, `lb`, `oz`
  - `cost_price` double

    Cost price
  - `wholesale_price` object[]

    Wholesale price list

    *   Array \[

    - `price` double (required)

      Price
    - `min_quantity` int64 (required)

      Mini Order Quantity
    *   \]
  - `retail_price` double

    Retail price of the variant
  - `position` int64 (required)

    Position of the variant in the list
  - `extend` object

    Extend of the variant

    - `length` double

      Length of the variant
    - `width` double

      Width of the variant
    - `height` double

      Height of the variant
    - `dimension_unit` string

      Dimension unit, possible value are: `cm`, `in`, `mm`
    - `origin_country_code` string

      Origin country of the variant
    - `hs_code` string

      Harmonized System Code of the variant

```json
{
  "variant": {
    "option1": "string",
    "option2": "string",
    "option3": "string",
    "image_id": "string",
    "compare_at_price": 0,
    "price": 0,
    "sku": "string",
    "barcode": "string",
    "note": "string",
    "inventory_quantity": 0,
    "weight": 0,
    "weight_unit": "string",
    "cost_price": 0,
    "wholesale_price": [
      {
        "price": 0,
        "min_quantity": 0
      }
    ],
    "retail_price": 0,
    "position": 0,
    "extend": {
      "length": 0,
      "width": 0,
      "height": 0,
      "dimension_unit": "string",
      "origin_country_code": "string",
      "hs_code": "string"
    }
  }
}
```

## Responses

**200**

OK

**application/json**

**Schema | Example**

**Schema**

- `code` string

  error code
- `message` string

  error message
- `data` object

  - `variant` object

    The created variant

    - `id` string

      The unique identifier of the variant
    - `product_id` string

      The product ID this variant belongs to
    - `image_id` string

      The image ID of the variant
    - `created_at` string

      The time of the variant was created
    - `updated_at` string

      The time of the variant was updated
    - `title` string

      Title of the variant
    - `option1` string

      The first option of the variant
    - `option2` string

      The second option of the variant
    - `option3` string

      The third option of the variant
    - `image` object

      The image of the variant

      - `src` string

        Image's URL
      - `width` int32

        Image's width in px
      - `height` int32

        Image's height in px
      - `alt` string

        Image's alt
      - `path` string

        Image's path
    - `position` int64

      The position of the variant in the product
    - `compare_at_price` double

      The compare at price of the variant
    - `price` double

      The price of the variant
    - `sku` string

      The SKU of the variant
    - `barcode` string

      The barcode of the variant
    - `note` string

      The note of the variant
    - `inventory_quantity` int64

      The inventory quantity of the variant
    - `weight` double

      The weight of the variant
    - `weight_unit` string

      The weight unit of the variant, possible value are: `kg`, `g`, `lb`, `oz`
    - `cost_price` double

      The cost price of the variant
    - `wholesale_price` object[]

      The wholesale prices of the variant

      *   Array \[

      - `price` double (required)

        Price
      - `min_quantity` int64 (required)

        Mini Order Quantity
      *   \]
    - `whole_prices` object[]

      The wholesale prices of the variant. Deprecated alias of `wholesale_price`; both carry the same value.

      *   Array \[

      - `price` double (required)

        Price
      - `min_quantity` int64 (required)

        Mini Order Quantity
      *   \]
    - `retail_price` double

      The retail price of the variant
    - `is_discount` boolean

      Whether the variant is discount
    - `origin_price` double

      The origin price of the variant
    - `extend` object

      Extend of the variant

      - `length` double

        The length of the variant
      - `width` double

        The width of the variant
      - `height` double

        The height of the variant
      - `dimension_unit` string

        The dimension unit
      - `origin_country_code` string

        Origin\_country\_code
      - `hs_code` string

        Hs\_code

```json
{
  "code": "string",
  "message": "string",
  "data": {
    "variant": {
      "id": "string",
      "product_id": "string",
      "image_id": "string",
      "created_at": "string",
      "updated_at": "string",
      "title": "string",
      "option1": "string",
      "option2": "string",
      "option3": "string",
      "image": {
        "src": "string",
        "width": 0,
        "height": 0,
        "alt": "string",
        "path": "string"
      },
      "position": 0,
      "compare_at_price": 0,
      "price": 0,
      "sku": "string",
      "barcode": "string",
      "note": "string",
      "inventory_quantity": 0,
      "weight": 0,
      "weight_unit": "string",
      "cost_price": 0,
      "wholesale_price": [
        {
          "price": 0,
          "min_quantity": 0
        }
      ],
      "whole_prices": [
        {
          "price": 0,
          "min_quantity": 0
        }
      ],
      "retail_price": 0,
      "is_discount": true,
      "origin_price": 0,
      "extend": {
        "length": 0,
        "width": 0,
        "height": 0,
        "dimension_unit": "string",
        "origin_country_code": "string",
        "hs_code": "string"
      }
    }
  }
}
```
