Add Product Variation
Function
Add a variation product under an existing main product.
在現有主商品之下新增規格商品
URL
POST <<api_domain>>/v1/products/:product_id/variations
Request Parameters
Parameter | Type | Description | Example |
|---|---|---|---|
default_show_image_selector |
| Show image selector on product details page 顯示選項圖片於商品頁面 default false | |
product_id |
| Product ID | |
variant_options |
| Product Variations
| |
location_id |
| Location ID | |
sku |
| SKU ( Stock Keeping Unit ) | |
price |
| Product Price | |
member_price |
| Member Price | |
quantity |
| Product Quantity | |
image |
| Link of Images
| |
price_sale |
| Sale price |
|
cost |
| Cost |
|
weight |
| Weight (kg) |
|
gtin |
| barcode |
|
preorder_limit |
| [Will release on 2023 May 24th] |
|
Request Example
{
"variant_options":[
{
"name_translations":{
"zh-hant":"綠",
"en":"green"
},
"type":"color"
},
{
"name_translations":{
"en":"L1",
"zh-hant":"大1"
},
"type":"custom_1"
}
],
"location_id":"BA-001",
"sku":"SL-GU-0001",
"price":999,
"member_price":900,
"quantity":100,
"image":"https://the-allstars.com/blog/images/articl/articl7.jpg",
"price_sale":999,
"cost":999,
"weight":1.2,
"gtin":"1234567890",
"preorder_limit":999
}Response Example
Also same with Get Product
{
"id": "5d5baa89c34f740006ce1adc",
"fields_translations": {
"en": [
"green",
"L1",
"Long1"
],
"zh-hant": [
"綠",
"大1",
"長1"
]
},
"price": {
"cents": 999,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "NT$999",
"dollars": 999.0
},
"price_sale": {
"cents": 0,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "",
"dollars": 0.0
},
"member_price": {
"cents": 900,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "NT$900",
"dollars": 900.0
},
"quantity": 100,
"unlimited_quantity": null,
"media": {},
"sku": "SL-GU-0001",
"location_id": "BA-001",
"variant_option_ids": [
"5d5baa896c20ca00293f7455",
"5d5baa896c20ca00293f7456",
"5d5baa896c20ca00293f7457"
],
"barcode": null,
"gtin": "1234567890",
"preorder_limit":999,
"out_of_stock_orderable": false,
"subscription_enabled": false,
"subscription_period_duration": 30,
"filter_tags": []
}Updated 13 days ago