HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Execute Shipment

Function

Execute shipment, currently we support order with following delivery service: 7-11 B2C / 7-11 C2C / 7-11 Cross Border / FMT Freeze / FMT B2C / FMT C2C /T-cat /HCT / SF / Tcat Emap
Only applicable to order in pending delivery status.

針對串接物流訂單執行出貨,目前支援的物流方式有:7-11 B2C / 7-11 C2C / 7-11 跨境/ 全家冷凍/ 全家 B2C /全家 C2C / 黑貓 /新竹物流/ 順豐 / 黑貓快速到店。
只對物流配送狀態為未執行的訂單有效。

URL

PATCH <<api_domain>>/v1/orders/:id/execute_shipment

Request Parameters

ParameterTypeDescriptionExample
id
*Required
StringOrder's ID
訂單ID

Can only input 1 order id at once
一次只能輸入一筆 order id
5d8c8b3be388095d25acbc89

Note:

Response Field

FieldTypeDescriptionExample
delivery_statusStringDelivery status after shipment is executed.
執行出貨後該訂單的物流配送狀態

request_accepted
可供出貨
request_authorized
待處理
request_submitted
處理中
request_accepted
tracking_numberStringDelivery Tracking Number
貨件追蹤號碼

*tracking_number could be empty when delivery is processing the shipment. Please call Get Order to retrieve tracking_number.
當物流正在處理出貨,tracking_number有機會為空,請以Get Order來獲取tracking_number。
SL0123456789

Response Example

JSON sample

{
  “delivery_status“: “request_accepted“,
  ”tracking_number”: “SL0123456789“
}

JSON sample for failure case

{
    "error": "Order#[5e3d898d622a5606b929d686] integrated delivery service error",
    "code": "0004"
}

Errors

CodeErrorDescription
0001Order#[5cece030d62fc30035b33bf1] is invalid填寫之 order_id 不存在或有問題,或同時填入多組 order id
The requested order_id doesn't exist/has problems/more than one order id.
0002Order#[5cece030d62fc30035b33bf1] shipment can only be executed when delivery_status is pending訂單 delivery_status 非 未執行
The delivery_status must be pending to execute shipment.
0003Order#[5cece030d62fc30035b33bf1] invalid delivery option訂單非適用的串接物流
The delivery option is not supported.
0004Order#[5cece030d62fc30035b33bf1] integrated delivery service error串接物流商外部執行失敗
Delivery service execution error.

Note:

若執行出貨當下遇到門市關轉:

  • 全家 B2C => 會回應 0004 error code
  • 711 B2C、全家冷凍 => 不會有 error code
    [補充]
    因為 711 B2C 和 全家冷凍的執行出貨是在背景運作 (非即時),門市關轉的訊息是會在執行出貨後再用其他方式 (FTP or callback) 回傳給訂單,所以執行出貨當下應該都不會有 error code.