HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Split Order

Function

Merchants can manage to ship more flexibly via split order API.

店家可以透過 split order API 進行拆單。

URL

POST <<api_domain>>/v1/orders/:id/split

Request Parameters

ParameterTypeDescriptionExample
order_items
*Required
ArrayThe order items of the order which would like to split into new order.
欲拆單至新訂單的商品品項
{ "id": "62a9c50634e470204d99fa0a", "quantity": 1 }
updated_at
*Required
StringCurrent order's updated_at. (Should use UTC timezone)
當前訂單的更新時間 (應使用 UTC 時區**)**
-

[Note]
It will response parent_order_updated error if the updated_at isn't same as order's updated_at.

若 updated_at 與訂單當前的 updated_at 不同將會收到 parent_order_updated 的錯誤。

(此為必填欄位,避免同張訂單同時被拆分。建議先打 Get Order 取得 updated_at 後帶入此 API)
"updated_at": "2022-08-05 07:59:09"
send_child_emailBooleanTo notify the customer that the child order already created by email (default: true).
發送新訂單(拆單成立)通知信(預設:true)
"send_child_email": true
send_parent_email
(default: false)
BooleanTo notify the customer that the parent order already split by email (default: false).
發送新訂單(拆單成立)通知信(預設:false)
"send_parent_email": true

Request Example

curl -X POST \
  <<api_domain>>/v1/orders/5b2b66599a76f0196a000a54/split \
  -H 'Accept: application/json' \
  -H 'Authorization: access_token' \
  -H 'Content-Type: application/json' \
  -d '{
    "order_items": [{ "id": "62a9c50634e470204d99fa0a", "quantity": 1 }],
    "updated_at": "2022-08-05 07:59:09",
    "send_child_email": false,
    "send_parent_email": true
  }'

Response Field

The same as Get Order

Response Example

The same as Get Order