---
updatedAt: 2026-05-27T07:01:03.000Z
agentTools:
  projectIndex: https://open-api.docs.shoplineapp.com/llms.txt
---

# Create Product Variation

Add a variation product under an existing main product.<br>在現有主商品之下新增規格商品

# OpenAPI definition

```json
{
  "info": {
    "title": "SHOPLINE Open API",
    "version": "2.348.2",
    "description": "Welcome to the shopline open-api developer hub. You'll find comprehensive guides and documentation to help you start working with shopline open-api as quickly as possible, as well as support if you get stuck. Let's jump right in!"
  },
  "servers": [
    {
      "url": "https://open.shopline.io/v1",
      "description": "Production"
    }
  ],
  "openapi": "3.0.0",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "requestBodies": {
      "CreateProductVariationBody": {
        "description": "Payload for creating product variation",
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/requestBodies/UpdateProductVariationBody/content/application~1json/schema"
                },
                {
                  "type": "object",
                  "properties": {
                    "ignore_product_media_errors": {
                      "description": "Will ignore errors when media upload failed.<br>圖像上傳失敗時將忽略錯誤。",
                      "type": "boolean",
                      "default": false,
                      "example": true
                    },
                    "default_show_image_selector": {
                      "description": "Show variation photos.<br>展示商品規格圖像。",
                      "type": "boolean",
                      "default": false,
                      "example": true
                    },
                    "variant_options": {
                      "description": "Product Variations<br>商品規格<br>-<br> *Maximum allows 3 types of variant option for a product, type allow (color, size, custom_1, custom_2, custom_3)<br> 最多支援三種不同的規格種類，支援color, size, custom_1, custom_2, custom_3",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "name_translations",
                          "type"
                        ],
                        "properties": {
                          "name_translations": {
                            "$ref": "#/components/schemas/Translatable"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "color",
                              "size",
                              "custom_1",
                              "custom_2",
                              "custom_3"
                            ]
                          },
                          "media_id": {
                            "description": "ID of the image to represent the variation<br>用以表達該商品規枱的圖片ID",
                            "type": "string"
                          }
                        }
                      },
                      "example": [
                        {
                          "name_translations": {
                            "zh-hant": "綠",
                            "en": "green"
                          },
                          "type": "color",
                          "media_id": "61d80284275035004cc03573"
                        },
                        {
                          "name_translations": {
                            "en": "L1",
                            "zh-hant": "大1"
                          },
                          "type": "custom_1"
                        }
                      ]
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "UpdateProductVariationBody": {
        "description": "Payload for updating product variation",
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "location_id": {
                  "$ref": "#/components/schemas/Product/properties/location_id"
                },
                "sku": {
                  "$ref": "#/components/schemas/Product/properties/sku"
                },
                "price": {
                  "description": "Price (Note: Cannot be set to null. Product with a price of 0 cannot be sold.)<br> 原價格 (備註：不能設定為null。價格為0的商品不能被售出)",
                  "type": "number",
                  "example": 999
                },
                "retail_price": {
                  "description": "Retail Price<br>零售價",
                  "type": "number",
                  "example": 500
                },
                "product_price_tiers": {
                  "description": "Membership tier's ID<br>會員等級ID",
                  "type": "object",
                  "additionalProperties": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 999999999.9,
                    "description": "Product's price for member tier.<br>適用於指定會員分級的產品價格。"
                  },
                  "example": {
                    "5fe163b78b02930047a0a32e": 499,
                    "5fe163b78b02930047a0a32f": 399
                  }
                },
                "member_price": {
                  "description": "Member Price<br>會員價",
                  "type": "number",
                  "example": 900
                },
                "quantity": {
                  "description": "Product Variation Quantity<br>規格商品數量<br>-<br> Directly update the quantity of the variation. The quantity is between -9999999 to 9999999.<br> 直接更新規格商品數量。商品數量要在 -9999999 - 9999999 之間。",
                  "type": "integer",
                  "example": 100,
                  "minimum": -9999999,
                  "maximum": 9999999
                },
                "preorder_limit": {
                  "$ref": "#/components/schemas/Product/properties/preorder_limit"
                },
                "image": {
                  "description": "Link of Images<br>圖片連結",
                  "type": "string",
                  "example": "https://the-allstars.com/blog/images/articl/articl7.jpg"
                },
                "price_sale": {
                  "description": "Price on sale (Note: Cannot be set to null.\n Product with a price_sale of 0 will be sold at its original price.)<br>\n特價 (備註：不能設定為null。特價為0的商品會以原價售出)",
                  "type": "number",
                  "example": 80
                },
                "cost": {
                  "description": "Cost (Note: Cannot be set to null)<br> 成本 (備註：不能設定為null)",
                  "type": "number",
                  "example": 30
                },
                "weight": {
                  "description": "Weight (kg)<br>重量 (公斤)",
                  "type": "number",
                  "example": 1.2
                },
                "gtin": {
                  "$ref": "#/components/schemas/Product/properties/gtin"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "Translatable": {
        "type": "object",
        "properties": {
          "en": {
            "type": "string",
            "description": "Merchant defined English name<br>店家定義英文名稱"
          },
          "zh-hant": {
            "type": "string",
            "description": "Merchant defined Traditional Chinese name<br>店家定義繁體中文名稱"
          },
          "zh-cn": {
            "type": "string",
            "description": "Merchant defined Simplified Chinese name<br>店家定義簡體中文名稱"
          },
          "vi": {
            "type": "string",
            "description": "Merchant defined Vietnamese name<br>店家定義越南文名稱"
          },
          "ms": {
            "type": "string",
            "description": "Merchant defined Malaysian name<br>店家定義馬來西亞文名稱"
          },
          "ja": {
            "type": "string",
            "description": "Merchant defined Japanese name<br>店家定義日文名稱"
          },
          "th": {
            "type": "string",
            "description": "Merchant defined Thai name<br>店家定義泰文名稱"
          },
          "id": {
            "type": "string",
            "description": "Merchant defined Indian name<br>店家定義印度文名稱"
          },
          "de": {
            "type": "string",
            "description": "Merchant defined Deutsch name<br>店家定義德文名稱"
          },
          "fr": {
            "type": "string",
            "description": "Merchant defined France name<br>店家定義法文名稱"
          }
        }
      },
      "TranslatableArray": {
        "type": "object",
        "properties": {
          "en": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Merchant defined English name<br>店家定義英文名稱"
          },
          "zh-hant": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Merchant defined Traditional Chinese name<br>店家定義繁體中文名稱"
          },
          "zh-cn": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Merchant defined Simplified Chinese name<br>店家定義簡體中文名稱"
          },
          "vi": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Merchant defined Vietnamese name<br>店家定義越南文名稱"
          },
          "ms": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Merchant defined Malaysian name<br>店家定義馬來西亞文名稱"
          },
          "ja": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Merchant defined Japanese name<br>店家定義日文名稱"
          },
          "th": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Merchant defined Thai name<br>店家定義泰文名稱"
          },
          "id": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Merchant defined Indian name<br>店家定義印度文名稱"
          },
          "de": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Merchant defined Deutsch name<br>店家定義德文名稱"
          },
          "fr": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Merchant defined France name<br>店家定義法文名稱"
          }
        },
        "example": "{\"en\": [\"green\", \"L1\"], \"zh-hant\": [\"綠\", \"大1\"]}"
      },
      "Money": {
        "type": "object",
        "properties": {
          "cents": {
            "type": "integer"
          },
          "currency_symbol": {
            "type": "string"
          },
          "currency_iso": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "dollars": {
            "type": "number"
          }
        },
        "example": {
          "cents": 999999999,
          "currency_symbol": "NT$",
          "currency_iso": "TWD",
          "label": "NT$999,999,999",
          "dollars": 999999999
        }
      },
      "FilterTag": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Filter Tag's ID<br>自訂篩選條件 ID",
            "type": "string",
            "example": "5d3594c2e95d2f000642e011"
          },
          "name_translations": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Translatable"
              },
              {
                "description": "Name Translation<br>自訂篩選名稱"
              }
            ]
          }
        }
      },
      "Media": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Media ID",
            "example": "5f8e5dc08a8bb70a5c9cd93c"
          },
          "alt_translations": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Translatable"
              },
              {
                "description": "Content to display on ALT attribute<br>在圖片ALT上展示的內容",
                "example": {
                  "en": "Image ALT",
                  "zh-hant": "圖片ALT"
                }
              }
            ]
          },
          "images": {
            "type": "object",
            "description": "Object contains url of image in different dimensions<br>包含不同大小圖片的連絡",
            "example": {
              "original": {
                "width": 800,
                "height": 800,
                "url": "https://img.example.com/media/1234/thumb.jpg"
              }
            }
          }
        }
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Product's ID<br>商品ID",
            "type": "string",
            "example": "5d3594c276e7ec003b7021c0"
          },
          "status": {
            "description": "Product's status<br>商品狀態<br>-<br>true: Published 上架<br> false: Unpublished 下架<br>\"active\": Published 上架<br>\"draft\": Unpublished 下架<br> \"hidden\": hidden 隱藏<br><br>Default: false",
            "type": "string",
            "enum": [
              "active",
              "draft",
              "removed",
              "hidden"
            ],
            "example": "active"
          },
          "retail_status": {
            "description": "POS product's status<br>POS商品狀態<br>-<br> \"active\": Published 上架<br> \"draft\": Unpublished 下架<br><br> Default: active",
            "type": "string",
            "enum": [
              "active",
              "draft"
            ],
            "example": "active"
          },
          "title_translations": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Translatable"
              },
              {
                "description": "Title translations<br>商品名稱",
                "example": {
                  "en": "testing SL-8049",
                  "zh-hant": "測試 SL-8049 round 2"
                }
              }
            ]
          },
          "summary_translations": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Translatable"
              },
              {
                "description": "Summary translations<br>商品說明",
                "example": {
                  "en": "testing SL-8049",
                  "zh-hant": "測試 SL-8049 round 2"
                }
              }
            ]
          },
          "price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "description": "Price<br>原價格"
              }
            ]
          },
          "price_sale": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "description": "Price on sale<br>特價"
              }
            ]
          },
          "lowest_price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "description": "The lowest price of product variations if exists<br>規格商品中的最低價"
              }
            ]
          },
          "lowest_price_sale": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "description": "The lowest sale price of product variations if exists<br>特價規格商品中的最低價"
              }
            ]
          },
          "hide_price": {
            "description": "Hide Price to customers<br>隱藏價格<br>-<br>*Default: false",
            "type": "boolean",
            "example": "false"
          },
          "same_price": {
            "description": "Main Product and Variation Product share the same price (Including original price and member price) <br>規格商品是否皆同主商品價格，包含原價格與會員價<br> 1. If same price is true, main product price is required and will be apply to all variation prices<br> 2. If same price is false, variation price is required and each variation can apply different prices.",
            "type": "boolean",
            "example": true
          },
          "cost": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "description": "Cost<br>成本價"
              }
            ]
          },
          "member_price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "description": "Member Price<br>會員價"
              }
            ]
          },
          "retail_price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "description": "Retail Price<br>零售價<br> Only provided when include_fields contains 'retail_price'<br> 僅於include_fields傳入 'retail_price' 時提供"
              }
            ]
          },
          "flash_price_sets": {
            "description": "price for flash campaign<br>限時促銷價",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "start_at": {
                  "type": "string"
                },
                "end_at": {
                  "type": "string"
                },
                "price_set": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "flash_price_campaign_id": {
                      "type": "string"
                    },
                    "price": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/Money"
                        },
                        {
                          "description": "price"
                        }
                      ]
                    },
                    "price_sale": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/Money"
                        },
                        {
                          "description": "price_sale"
                        }
                      ]
                    },
                    "price_details": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "variation_key": {
                            "type": "string"
                          },
                          "price": {
                            "allOf": [
                              {
                                "$ref": "#/components/schemas/Money"
                              },
                              {
                                "description": "price"
                              }
                            ]
                          },
                          "price_sale": {
                            "allOf": [
                              {
                                "$ref": "#/components/schemas/Money"
                              },
                              {
                                "description": "price_sale"
                              }
                            ]
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    }
                  }
                },
                "created_at": {
                  "type": "string"
                },
                "updated_at": {
                  "type": "string"
                }
              },
              "example": "{\n  \"id\": \"60d946c53be7c54f08869b46\",\n  \"start_at\": \"2021-06-27T00:00:00.000+00:00\",\n  \"end_at\": \"2021-06-27T00:00:00.000+00:00\",\n  \"price_set\": {\n      \"id\": \"60d946953be7c54f08869b45\",\n      \"type\": \"flash_price\",\n      \"flash_price_campaign_id\": \"60d944aa3be7c54f08869b44\",\n      \"price\": {\n          \"cents\": 1000,\n          \"currency_symbol\": \"HK$\",\n          \"currency_iso\": \"HKD\",\n          \"label\": \"HK$10.00\",\n          \"dollars\": 10\n      },\n      \"price_sale\": {\n          \"cents\": 800,\n          \"currency_symbol\": \"HK$\",\n          \"currency_iso\": \"HKD\",\n          \"label\": \"HK$8.00\",\n          \"dollars\": 8\n      },\n      \"created_at\": null,\n      \"updated_at\": null\n  },\n  \"created_at\": \"2021-06-28T03:50:07.912+00:00\",\n  \"updated_at\": \"2021-06-28T03:50:07.912+00:00\"\n}"
            }
          },
          "is_preorder": {
            "description": "Pre-ordered or not<br>是否開放預購",
            "type": "boolean",
            "example": "false"
          },
          "preorder_limit": {
            "description": "Pre-ordere Limit<br>預購上限",
            "type": "integer",
            "example": 1
          },
          "preorder_note_translations": {
            "description": "Pre-order Note Info<br>預購資訊",
            "allOf": [
              {
                "$ref": "#/components/schemas/Translatable"
              },
              {
                "description": "Title translations<br>商品名稱",
                "example": {
                  "en": "Shipping starts April 20th, 1971, preorder NOW!",
                  "zh-hant": "1971/04/20 開始出貨, 立即訂購!"
                }
              }
            ]
          },
          "weight": {
            "description": "Product's Weight (kg)<br>商品重量 (公斤)",
            "type": "number",
            "example": 123.99
          },
          "quantity": {
            "description": "Product's Current quantity<br>商品目前數量<br>-<br> *If unlimited_quantity is true, the product has unlimited quantity<br> regardless of the quantity showing here",
            "type": "number",
            "example": 87
          },
          "total_orderable_quantity": {
            "description": "Product's Current total orderable quantity<br>商品目前可購買總數量<br>-<br> *If unlimited_quantity is true or out_of_stock_orderable is true<br> this field will return -1",
            "type": "number",
            "example": 87
          },
          "unlimited_quantity": {
            "description": "Unlimited product quantity or not.<br>商品數量是否無限",
            "type": "boolean",
            "enum": [
              true,
              false
            ],
            "example": "false"
          },
          "medias": {
            "description": "Media Data<br>媒體(照片)資訊",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Media"
            }
          },
          "detail_medias": {
            "description": "Additional Product Photos<br>更多商品圖片<br>Maximum 20 images for a product.<br>最多 20 張圖片",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Media"
            }
          },
          "category_ids": {
            "description": "Categories' IDs<br>商品所屬分類之ID",
            "type": "array",
            "items": {
              "type": "string",
              "example": "5be90603d1270b4032bed8b4"
            }
          },
          "supplier": {
            "description": "Supplier<br>供應商",
            "type": "string"
          },
          "sku": {
            "description": "Stock Keeping Unit<br>商品貨號",
            "type": "string",
            "example": "sku_123345"
          },
          "barcode": {
            "description": "Product's Barcode<br>商品條碼編號",
            "type": "string"
          },
          "quantity_sold": {
            "description": "Product's Quantity Sold<br>商品銷售數量",
            "type": "integer"
          },
          "barcode_type": {
            "description": "Barcode type<br>商品條碼編號類別",
            "type": "string",
            "enum": [
              "Code 128",
              "Bookland EAN",
              "ISBN"
            ]
          },
          "field_titles": {
            "description": "Field Title Data<br>規格名稱",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "name_translations": {
                  "$ref": "#/components/schemas/Translatable"
                },
                "selectorEnabled": {
                  "type": "boolean"
                }
              }
            },
            "example": [
              {
                "key": "color",
                "label": "Color",
                "name_translations": {
                  "en": "Color",
                  "zh-hant": "顏色"
                },
                "selectorEnabled": false
              },
              {
                "key": "custom",
                "label": "Custom",
                "name_translations": {
                  "en": "Custom1",
                  "zh-hant": "自訂1"
                },
                "selectorEnabled": false
              }
            ]
          },
          "variations": {
            "description": "Product Variations Data<br>商品規格資訊",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductVariation"
            }
          },
          "variant_options": {
            "description": "Product Variations<br>商品規格<br>-<br> Maximum 3 types of variant option for a product, type allow (color, size, custom_1, custom_2, custom_3)<br> 最多支援三種不同的 type, type 支援(color, size, custom_1, custom_2, custom_3)<br>",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name_translations": {
                  "$ref": "#/components/schemas/Translatable"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "color",
                    "size",
                    "custom_1",
                    "custom_2",
                    "custom_3"
                  ]
                },
                "media": {
                  "type": "object"
                },
                "index": {
                  "type": "integer"
                }
              }
            },
            "example": [
              {
                "id": "5d3594c2622a56618082c99f",
                "name_translations": {
                  "en": "green",
                  "zh-hant": "綠"
                },
                "type": "custom",
                "media": {},
                "index": 0
              },
              {
                "id": "5d3594c2622a56618082c9a0",
                "name_translations": {
                  "en": "L1",
                  "zh-hant": "大1"
                },
                "type": "custom",
                "media": {},
                "index": 1
              },
              {
                "id": "5d3594c2622a56618082c9a1",
                "name_translations": {
                  "en": "S1",
                  "zh-hant": "小1"
                },
                "type": "custom",
                "media": {},
                "index": 1
              },
              {
                "id": "5d3594c2622a56618082c9a2",
                "name_translations": {
                  "en": "Red",
                  "zh-hant": "紅"
                },
                "type": "custom",
                "media": {},
                "index": 0
              }
            ]
          },
          "location_id": {
            "description": "Stock Unit Number<br>儲位編號",
            "type": "string",
            "example": "shoplineabc"
          },
          "feed_category": {
            "description": "Category for different feed<br>廣告的分類",
            "type": "object",
            "properties": {
              "google_category_id": {
                "type": "string",
                "example": "animals_pet_supplies"
              },
              "google_option_id": {
                "type": "string",
                "example": "live_animals"
              },
              "google_product_category": {
                "type": "string",
                "example": "Animals & Pet Supplies > Live Animals"
              }
            }
          },
          "feed_variations": {
            "description": "Feed Variations<br>產品資訊 - 顏色、尺寸、材質",
            "type": "object",
            "example": "{\n  \"color\": \"red\",\n  \"size\": \"small\",\n  \"material\": \"gold\"\n}",
            "properties": {
              "color": {
                "description": "Color<br>產品資訊 - 顏色",
                "type": "string",
                "example": "red"
              },
              "size": {
                "description": "Size<br>產品資訊 - 尺寸",
                "type": "string",
                "example": "small"
              },
              "material": {
                "description": "Material<br>產品資訊 - 材質",
                "type": "string",
                "example": "gold"
              }
            }
          },
          "description_translations": {
            "description": "Product Description<br>商品描述<br> Content in each locale cannot exceed 100,000 characters.<br> 各語系內容不能超過 100,000 個字元數。",
            "allOf": [
              {
                "$ref": "#/components/schemas/Translatable"
              },
              {
                "description": "Title translations<br>商品名稱"
              }
            ]
          },
          "seo_title_translations": {
            "description": "Title of SEO<br>SEO優化標題",
            "allOf": [
              {
                "$ref": "#/components/schemas/Translatable"
              },
              {
                "description": "Title translations<br>商品名稱"
              }
            ]
          },
          "seo_description_translations": {
            "description": "Description of SEO<br>SEO優化描述",
            "allOf": [
              {
                "$ref": "#/components/schemas/Translatable"
              },
              {
                "description": "Title translations<br>商品名稱"
              }
            ]
          },
          "seo_keywords": {
            "description": "Keywords of SEO<br>SEO關鍵字<br> *Keywords should be separated by commas (,) max length 160 characters.<br> 關鍵字以逗號(,)分隔, 最長 160字",
            "type": "string",
            "example": "電商, 開店, 創業"
          },
          "link": {
            "description": "",
            "type": "string"
          },
          "is_reminder_active": {
            "description": "Out-Of-Stock Reminder<br>商品缺貨是否提醒",
            "type": "boolean",
            "example": "true "
          },
          "show_custom_related_products": {
            "description": "Show Custom Related products<br>顯示相關商品",
            "type": "boolean",
            "enum": [
              true,
              false
            ],
            "example": false
          },
          "related_product_ids": {
            "description": "Custom related products<br>自訂相關商品",
            "type": "array",
            "example": [
              "5d3593cd5722660032e8fbed",
              "5d355b7b0e5da9001741ac2c"
            ],
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "description": "Tags<br>標籤<br> *Tags are used to search products at the admin panel and help set up the product-related coupons.<br> 標籤功能用作商品搜尋，並能為指定商品設置優惠券的用途。",
            "type": "array",
            "example": "[\"shopline\", \"123\", \"abc\"]",
            "items": {
              "type": "string"
            }
          },
          "blacklisted_delivery_option_ids": {
            "description": "Excluded Delivery Options<br>排除的送貨方式",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "blacklisted_payment_ids": {
            "description": "Excluded Payment<br>Options<br>排除的付款方式",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "max_order_quantity": {
            "description": "set maximum quantity per purchase for this product<br> 商品單次購買上限<br> *-1 represents there's no quantity limit for each purchase<br> -1代表無商品單次購買的上限",
            "type": "integer",
            "example": 4
          },
          "gender": {
            "description": "Mapping Product Category: Gender<br>產品使用類別：性別<br> male 男性<br> female 女性<br>* unisex 男女通用",
            "type": "string"
          },
          "age_group": {
            "description": "Mapping Product Category:Age Group<br>產品使用類別：年齡層<br> newborn 新生兒<br> infant 嬰兒<br> toddler 幼兒<br> kids兒童<br>* Adult 成人",
            "type": "string"
          },
          "adult": {
            "description": "Mapping Product Category:Adult<br>產品使用類別：成人<br> yes 是<br> no 否",
            "type": "string"
          },
          "condition": {
            "description": "Mapping Product Category:Condition<br>產品使用類別：狀況<br> used 二手<br> refurbished 整新品<br>* new 新品",
            "type": "string"
          },
          "brand": {
            "description": "Brand<br>商品品牌",
            "type": "string"
          },
          "mpn": {
            "description": "Manufacturer Part Number<br>製造編號",
            "type": "string"
          },
          "gtin": {
            "description": "Barcode<br>商品條碼編號",
            "type": "string"
          },
          "blacklisted_feed_channels": {
            "description": "排除這個商品投放管道<br>Exclude this product to channel",
            "type": "array",
            "items": {
              "type": "string",
              "example": "google"
            }
          },
          "updated_at": {
            "description": "Last Updated Time<br>商品最後更新時間",
            "type": "string",
            "example": "2020-12-09T07:15:06.813+00:00"
          },
          "created_at": {
            "description": "Product Created Time<br>商品創建時間",
            "type": "string",
            "example": "2020-11-23T02:31:32.926+00:00"
          },
          "available_start_time": {
            "description": "",
            "type": "string"
          },
          "available_end_time": {
            "description": "",
            "type": "string"
          },
          "created_by": {
            "description": "",
            "type": "string",
            "example": "openapi"
          },
          "is_excluded_promotion": {
            "description": "product is exclude promotion which is discount on order<br>不適用全店折扣的優惠是否開啟",
            "type": "boolean",
            "example": true
          },
          "taxable": {
            "description": "taxable<br>是否收稅",
            "type": "boolean",
            "example": true
          },
          "labels": {
            "description": "product labels<br>標簽的商品促銷標簽文案",
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Translatable"
                }
              ]
            },
            "example": [
              {
                "en": "ABC",
                "zh-hant": "ddd"
              }
            ]
          },
          "locked_inventory_count": {
            "type": "number",
            "example": 10
          },
          "schedule_publish_at": {
            "type": "string",
            "example": "2020-11-23T02:31:32.926+00:00"
          },
          "product_price_tiers": {
            "description": "Product's price for member tier. <br> 適用於指定會員分級的產品價格。",
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/ProductPriceTier"
                }
              ]
            }
          },
          "metafields": {
            "description": "metafields<br>only show if include_fields[]=metafields",
            "type": "object",
            "example": {
              "namespace": {
                "key1": "value",
                "key2": 3,
                "key3": {
                  "json": "object"
                }
              }
            }
          },
          "out_of_stock_orderable": {
            "description": "out_of_stock_orderable<br>缺貨時是否可接單",
            "type": "boolean",
            "example": false
          },
          "subscription_enabled": {
            "description": "subscription_enabled<br>是否為定期購商品。",
            "type": "boolean",
            "example": true
          },
          "subscription_period_duration": {
            "description": "subscription_period_duration<br>定期購天數",
            "type": "integer",
            "example": 30
          },
          "subscription_recurring_count_limit": {
            "description": "Subscription recurring count limit<br>定期購期數",
            "type": "integer",
            "example": 5
          },
          "filter_tags": {
            "description": "filter_tags<br>自訂篩選條件",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FilterTag"
            }
          },
          "bundle_set": {
            "description": "bundle_set info<br>組合商品資訊<br> Only provided when include_fields contains 'bundle_set'<br> 僅於include_fields傳入 'bundle_set' 時提供",
            "type": "object",
            "properties": {
              "_id": {
                "type": "string"
              },
              "price_type": {
                "description": "Price Type<br>組合售價類型",
                "type": "string",
                "enum": [
                  "fixed_amount discount_percentage discount_amount"
                ],
                "example": "fixed_amount"
              },
              "discount_value": {
                "description": "Discount Value<br>金額折扣<br> When price_type is 'fixed_amount', example: 20 means price_sale $20<br> If discount_value is null, its value is taken from the price_sale<br> 當組合售價類型是固定組合價時，20代表组合售價为 $20. 如果該值為空, 金額折扣值取自特價<br> When price_type is 'discount_percentage', example: 20 for 80% off; 70 for 30% off<br> 當組合售價類型是折扣比例時，20代表八折; 70代表三折<br> When price_type is 'discount_amount', example: 20 means minus $20; 70 means minus $70<br> 當組合售價類型是金額折扣時，20代表減$20; 70代表減$70",
                "type": "number",
                "example": 20
              },
              "bundle_set_products": {
                "type": "object",
                "example": {
                  "6200c988dcf97a004b22ec26": {
                    "min_quantity": 1
                  }
                }
              }
            }
          },
          "type": {
            "description": "product type<br>商品型別<br> Only provided when include_fields contains 'type'<br> 僅於include_fields傳入 'type' 時提供",
            "type": "string",
            "example": "product"
          },
          "tax_type": {
            "description": "Tax type<br>國內稅項",
            "type": "string"
          },
          "oversea_tax_type": {
            "description": "Oversea tax type<br>海外稅項",
            "type": "string"
          },
          "allow_gift": {
            "description": "Specifies whether the item can be set as a gift.<br> 是否可以設為贈品<br> true: the product can be set as a gift.<br> false: the product cannot be set as a gift.",
            "type": "boolean",
            "example": true
          },
          "is_custom": {
            "description": "Specifies whether the item can be set as a customized product.<br>是否可以設為訂制商品<br> true: the product is custom product.<br> false: the product isn't custom product.",
            "type": "boolean",
            "example": true
          },
          "sold_out": {
            "description": "Indicates whether the product is sold out.<br> 商品是否售罄.<br> true: the product is sold out. 已售罄<br> false: the product is still available. 尚有庫存<br>",
            "type": "boolean",
            "example": true
          },
          "cart_tag_id": {
            "description": "Product Attribute ID<br>商品屬性設置 id<br> This field is unavailable when you get a product detail<br> 取得商品詳細資訊時不提供",
            "type": "string",
            "example": "63ec73c11ac51b368c74b92b"
          },
          "cart_tag": {
            "description": "Product Attribute<br>商品屬性設置<br> This field is only available when you get a product detail<br> 僅於取得商品詳細資訊時提供",
            "type": "object",
            "example": {
              "id": "63ec73c11ac51b368c74b92b",
              "name_translations": {
                "en": "",
                "zh-hant": "一車常溫"
              },
              "priority": 1
            }
          }
        }
      },
      "ProductPriceTier": {
        "type": "object",
        "properties": {
          "_id": {
            "description": "Product price tier's ID<br>產品價格分級的ID",
            "type": "string",
            "example": "610cdc702c1c120047c3519c"
          },
          "created_at": {
            "description": "Product price tier's created time<br>產品價格分級的創建時間",
            "type": "string",
            "example": "2021-08-06T06:55:45.471Z"
          },
          "updated_at": {
            "description": "Product price tier's updated time<br>產品價格分級的更新時間",
            "type": "string",
            "example": "2021-08-06T06:55:45.471Z"
          },
          "member_price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "description": "The price that is applied to this member tier<br>適用於這會員分級的價格"
              }
            ]
          },
          "membership_tier_id": {
            "description": "Membership tier's ID<br>會員等級ID",
            "type": "string",
            "example": "5de6192b9a8b7900365abb5b"
          },
          "product_id": {
            "description": "Product's ID<br>商品ID",
            "type": "string",
            "example": "5d3594c276e7ec003b7021c0"
          },
          "status": {
            "description": "Product price tier's status<br>產品價格分級的狀態",
            "type": "string",
            "enum": [
              "active"
            ],
            "example": "active"
          },
          "variation_key": {
            "description": "Product variation's ID<br>產品規格的ID",
            "type": "string",
            "example": "610cdcf19f09bc003a2139a4"
          }
        }
      },
      "ProductVariation": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Product Variation's ID<br>規格 ID",
            "type": "string",
            "example": "5d3594c2e95d2f000642e011"
          },
          "fields_translations": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TranslatableArray"
              },
              {
                "description": "Field Translation<br>規格名稱"
              }
            ]
          },
          "price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "description": "Price<br>原價格"
              }
            ]
          },
          "price_sale": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "description": "Price on sale<br>特價"
              }
            ]
          },
          "member_price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "description": "Member Price<br>會員價"
              }
            ]
          },
          "retail_price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "description": "Retail Price<br>零售價<br> Only provided when include_fields contains 'retail_price'<br> 僅於include_fields傳入 'retail_price' 時提供"
              }
            ]
          },
          "cost": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "description": "Cost<br>成本價"
              }
            ]
          },
          "quantity": {
            "description": "Product variation's current quantity<br>規格現有數量",
            "type": "number",
            "example": 100
          },
          "total_orderable_quantity": {
            "description": "Product variation's current orderable quantity<br>規格現有可購買數量",
            "type": "number",
            "example": 100
          },
          "unlimited_quantity": {
            "description": "Whether the variation has unlimited quantity or not.<br>規格是否有無限數量<br>*Please check the main product's unlimited_quantity to see whether variation has unlimited quantity or not.<br><br>unlimited_quantity of variation will always shows null",
            "type": "boolean",
            "nullable": true,
            "example": "null"
          },
          "preorder_limit": {
            "description": "Pre-ordere Limit<br>預購上限",
            "type": "integer",
            "example": 1
          },
          "media": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Media"
              },
              {
                "description": "Media Data<br>圖片資料"
              }
            ]
          },
          "sku": {
            "description": "Stock Keeping Unit<br>貨號",
            "type": "string",
            "example": "green_l1"
          },
          "location_id": {
            "description": "Location ID<br>儲位編號",
            "type": "string",
            "example": "LaB123"
          },
          "feed_variations": {
            "description": "Default variations for product feed<br>廣告規格<br> 當商品為多規格並且規格中有設置color、size時，此时color、size為json。<br> 當商品規格中未設置color、size，但商家有在產品規格摘要頁麵填冩color、size時，此時color、size爲純字串<br>",
            "type": "object",
            "properties": {
              "color": {
                "oneOf": [
                  {
                    "type": "object",
                    "example": {
                      "zh-hant": "紅色",
                      "en": "red"
                    }
                  },
                  {
                    "type": "string",
                    "example": "red"
                  }
                ]
              },
              "size": {
                "oneOf": [
                  {
                    "type": "object",
                    "example": {
                      "zh-hant": "xs",
                      "en": "xs"
                    }
                  },
                  {
                    "type": "string",
                    "example": "xs"
                  }
                ]
              },
              "material": {
                "type": "string"
              }
            }
          },
          "variant_option_ids": {
            "description": "ID of the corresponding variant options<br>對應規格類別 ID",
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "5d3594c2622a56618082c99f",
              "5d3594c2622a56618082c9a0"
            ]
          },
          "barcode": {
            "description": "Barcode<br>商品條碼編號",
            "type": "string"
          },
          "mpn": {
            "description": "Manufacturer Part Number<br>製造編號",
            "type": "string"
          },
          "gtin": {
            "description": "Barcode<br>商品條碼編號",
            "type": "string"
          },
          "barcode_type": {
            "description": "Barcode type<br>商品條碼編號類別",
            "type": "string",
            "enum": [
              "Code 128",
              "Bookland EAN",
              "ISBN"
            ]
          },
          "locked_inventory_count": {
            "type": "number",
            "example": 10
          },
          "weight": {
            "description": "Weight (kg)<br>重量 (公斤)",
            "type": "number",
            "example": 1.2
          }
        }
      },
      "ServerError": {
        "type": "object",
        "properties": {
          "message": {
            "description": "A detailed message of the reason of failure",
            "example": "Unable to create EventTrackers",
            "type": "string"
          },
          "code": {
            "description": "An error code",
            "example": "UnknownError",
            "type": "string"
          }
        }
      },
      "NotFoundError": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "example": "Unable to find the resource"
          },
          "code": {
            "type": "string",
            "example": "NOT_FOUND"
          },
          "extras": {
            "description": "Optional, Extra information about the error",
            "example": {},
            "type": "object"
          }
        }
      },
      "UnprocessableEntityError": {
        "type": "object",
        "properties": {
          "error": {
            "description": "A detailed message of the reason of failure",
            "type": "string"
          },
          "message": {
            "description": "A detailed message of the reason of failure",
            "example": "Unable to process the changes [\"event_type\" is not valid], [\"config_data.access_token\" is not valid]",
            "type": "string"
          },
          "code": {
            "description": "An error code",
            "example": "ValidationError",
            "type": "string"
          },
          "extras": {
            "description": "An extra information of the reason of failure",
            "type": "object"
          }
        }
      }
    }
  },
  "paths": {
    "/products/{product_id}/variations": {
      "post": {
        "summary": "Create Product Variation",
        "description": "Add a variation product under an existing main product.<br>在現有主商品之下新增規格商品",
        "parameters": [
          {
            "name": "product_id",
            "description": "Product ID<br>主商品ID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "5d3594c276e7ec003b7021c0"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/requestBodies/CreateProductVariationBody/content/application~1json/schema"
                  },
                  {
                    "required": [
                      "variant_options"
                    ]
                  }
                ]
              }
            }
          }
        },
        "tags": [
          "Products"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "404": {
            "description": "Product not found error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                },
                "examples": {
                  "1": {
                    "summary": "Product not found",
                    "value": {
                      "error": "Not found.",
                      "code": "NotFoundError",
                      "caused_by": null
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableEntityError"
                },
                "examples": {
                  "1": {
                    "summary": "Invalid request body",
                    "value": {
                      "error": "product is missing, product[price] is missing, product[title_translations] is missing",
                      "code": "UnprocessableEntityError"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerError"
                },
                "examples": {
                  "1": {
                    "summary": "Unknown error",
                    "value": {
                      "message": "Unable to post addVariation",
                      "code": "UNKNOWN"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Products",
      "description": "Operations about products"
    }
  ]
}
```