HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Changelog

Release 1.9.2

Add new fields to "Get Order" Response

API: Get Order

Summary:
使用Get Order 可以看到 物流狀態 shipped at 已送貨 , arrived at 已到達 , collected at 已取貨 ,returned at 已退貨 , 與訂單狀態 confirmed at 已確認 , 以上狀態的更新時間點 (時間表示為 UTC+0 time)

"Get Order" provides the status update timing of delivery status "shipped at", "arrived at", "collected at", "returned at", and oder status "confirmed at." (Time: UTC+0 Time)

Response add new field
  order_delivery.shipped_at
  order_delivery.arrived_at
  order_delivery.collected_at
  order_delivery.returned_at
  confirmed_at
{
  "order_delivery": {
    "shipped_at": "2019-04-23T05:36:25.230+00:00",
    "arrived_at": "2019-04-24T04:36:33.524+00:00",
    "collected_at": "2019-04-24T04:36:41.623+00:00",
    "returned_at": "2019-04-26T04:36:50.505+00:00"
  },
  "confirmed_at": "2019-04-23T04:35:21.458+00:00",
}

Create product with product variation sku, quantity

API: Create Product
Summary:
新增支援 Create Product 可以對 規格商品 product variation 設定相對應的 sku(商品貨號), quantity(商品數量)

商品規格選項 variant_options 多新增 key 來對應 不同規格商品 product variations
新增 field variations 來對應

範例:
variation options 有2種類型 Types (顏色與尺寸),各2種選項 option , 共有4種規格商品product variations如下:
顏色: “zh-hant” - ; "en"- green, red
尺寸: “zh-hant” - 大1 小1 ; "en"- l1,s1
規格商品: green+l1 ,green+s1, red+l1 , red+s1

每一個 選項 option 都有獨立的 key: green, red, l1, s1
因為每個規格商品最多對應到兩個 options,因此一個規格商品的 variations.key 最多為兩個 keys, 最少為一個key ,使用者可以以key的組合來對應到共四種規格商品, 設定相關的 quantity,sku

Variation products' sku and quantity can be edited when using "Create Product", by the new added fileds key and variations. Different key combinations refers to different product variations. Please refer to below for example.

Example:
There are 2 types of options ( color & size), and each type has 2 options. Thus in this case, we have 2x2 =4 kinds of product variations.

Color: green, red
Size: "en"- l1,s1
Product variations: green+l1 ,green+s1, red+l1 , red+s1

Every option has a key. In this case, the option keys are green, red, l1, s1
Every product variation has at most 2 options, so it has 2 keys as well. (1 key at least)
We can refer to different product variation by key combinations, and set up their corresponding sku and quantity.

"variant_options": [
  {
    "name_translations": {
      "en": "green",
      "zh-hant": "綠"
    },
    "type": "color",
    "key": "green"
  },
  {
    "name_translations": {
      "en": "Red",
      "zh-hant": "紅"
    },
    "type": "color",
    "key": "red"
  },
  {
    "name_translations": {
      "en": "L1",
      "zh-hant": "大1"
    },
    "type": "custom_1",
    "key": "l1"
  },
  {
    "name_translations": {
      "en": "S1",
      "zh-hant": "小1"
    },
    "type": "size",
    "key": "s1"
  }
],
"variations": [
  {
    "key": ["green", "l1"],
    "quantity": 10,
    "sku": "green_l1"
  },{
    "key": ["green", "s1"],
    "quantity": 10,
    "sku": "green_s1"
  },{
    "key": ["red", "l1"],
    "quantity": 10,
    "sku": "red_l1"
  },{
    "key": ["red", "s1"],
    "quantity": 10,
    "sku": "red_s1"
  },
]
"variant_options": [
  {
    "name_translations": {
      "en": "green",
      "zh-hant": "綠"
    },
    "type": "color",
    "key": "green"
  },
  {
    "name_translations": {
      "en": "Red",
      "zh-hant": "紅"
    },
    "type": "color",
    "key": "red"
  }
],
"variations": [
  {
    "key": ["green"],
    "quantity": 10,
    "sku": "green"
  },{
    "key": ["red"],
    "quantity": 10,
    "sku": "red"
  }
]

完整 Request example

{
  "product": {
    "category_ids": [],
    "cost": 609,
    "description_translations": {
      "en": "No transaction fees. No design or technical skills required. Integrated with multiple payment and logistic options. With over 120,000 merchants online. Everything you need for your e-commerce store.",
      "zh-hant": "我們是一家以產品設計為主導的公司, 旨在打造款式簡潔時尚且關注社會大眾需求的產品。 公司聚集了一批來自哈佛大學設計學院 以及麻省理工商學院的優秀設計團隊。 我們致力於設計獨特新穎的創新產品, 適合不同年齡,性別人士使用。 在執著追求產品優化同時,注重履行企業社會責任。"
    },
    "detail_images": [
      "https://shopline.tw/blog/wp-content/uploads/2015/11/logo-shopline-white.png"
    ],
    "hide_price": false,
    "images": [
      "https://shopline.tw/blog/wp-content/uploads/2015/11/logo-shopline-white.png"
    ],
    "link": "shopline",
    "price": 1000,
    "price_sale": 689,
    "same_price": true,
    "seo_description_translations": {
      "en": "No transaction fees. No design or technical skills required. Integrated with multiple payment and logistic options. With over 120,000 merchants online. Everything you need for your e-commerce store.",
      "zh-hant": "我們是一家以產品設計為主導的公司, 旨在打造款式簡潔時尚且關注社會大眾需求的產品。 公司聚集了一批來自哈佛大學設計學院 以及麻省理工商學院的優秀設計團隊。 我們致力於設計獨特新穎的創新產品, 適合不同年齡,性別人士使用。 在執著追求產品優化同時,注重履行企業社會責任。"
    },
    "seo_keywords": "電商, 開店, 創業",
    "seo_title_translations": {
      "en": "SHOPLINE",
      "zh-hant": "商線科技"
    },
    "status": true,
    "title_translations": {
      "en": "Shopline.co",
      "zh-hant": "商線科技"
    },
    "unlimited_quantity": true,
    "variant_custom_type_translations": [
      {
        "name_translations": {
          "en": "size",
          "zh-hant": "尺寸"
        },
        "type": "size"
      }
    ],
    "variant_options": [
      {
        "name_translations": {
          "en": "green",
          "zh-hant": "綠"
        },
        "type": "color",
        "key": "green"
      },
      {
        "name_translations": {
          "en": "Red",
          "zh-hant": "紅"
        },
        "type": "color",
        "key": "red"
      },
      {
        "name_translations": {
          "en": "L1",
          "zh-hant": "大1"
        },
        "type": "size",
        "key": "l1"
      },
      {
        "name_translations": {
          "en": "S1",
          "zh-hant": "小1"
        },
        "type": "size",
        "key": "s1"
      }
    ],
    "variations": [
      {
        "key": ["green", "l1"],
        "quantity": 10,
        "sku": "green_l1"
      },{
        "key": ["green", "s1"],
        "quantity": 10,
        "sku": "green_s1"
      },{
        "key": ["red", "l1"],
        "quantity": 10,
        "sku": "red_l1"
      },{
        "key": ["red", "s1"],
        "quantity": 10,
        "sku": "red_s1"
      },
    ]
  }
}

Changelog

  • improved: Add new fields to "Get Order" Response
  • improved: Create product with product variation sku, quantity