Skip to main content
POST
/
api
/
v1
/
products
/
{product_id}
/
variants
Create Variant
curl --request POST \
  --url https://api.launchmystore.io/api/v1/products/{product_id}/variants \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sku": "<string>",
  "price": 123,
  "compare_at_price": 123,
  "option1": "<string>",
  "option2": "<string>",
  "option3": "<string>",
  "inventory_quantity": 123,
  "weight": 123,
  "barcode": "<string>",
  "requires_shipping": true,
  "taxable": true
}
'
{
  "success": true,
  "data": {
    "id": "var_new123",
    "product_id": "prod_xyz789",
    "title": "Blue / Large",
    "sku": "TSHIRT-BLUE-L",
    "price": 2999,
    "compare_at_price": 3999,
    "inventory_quantity": 100,
    "weight": 240,
    "option1": "Blue",
    "option2": "Large",
    "option3": null,
    "barcode": "123456789099",
    "requires_shipping": true,
    "taxable": true,
    "position": 5,
    "created_at": "2024-01-20T14:30:00Z",
    "updated_at": "2024-01-20T14:30:00Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt

Use this file to discover all available pages before exploring further.

Path Parameters

product_id
string
required
The product ID

Body Parameters

sku
string
Stock keeping unit (unique identifier)
price
number
required
Price in cents (e.g., 2999 = $29.99)
compare_at_price
number
Original price for showing discounts
option1
string
First option value (e.g., “Red”)
option2
string
Second option value (e.g., “Small”)
option3
string
Third option value
inventory_quantity
number
default:"0"
Initial stock quantity
weight
number
Weight in grams
barcode
string
UPC, EAN, or other barcode
requires_shipping
boolean
default:"true"
Whether variant requires shipping
taxable
boolean
default:"true"
Whether variant is taxable

Response

{
  "success": true,
  "data": {
    "id": "var_new123",
    "product_id": "prod_xyz789",
    "title": "Blue / Large",
    "sku": "TSHIRT-BLUE-L",
    "price": 2999,
    "compare_at_price": 3999,
    "inventory_quantity": 100,
    "weight": 240,
    "option1": "Blue",
    "option2": "Large",
    "option3": null,
    "barcode": "123456789099",
    "requires_shipping": true,
    "taxable": true,
    "position": 5,
    "created_at": "2024-01-20T14:30:00Z",
    "updated_at": "2024-01-20T14:30:00Z"
  }
}