Get Archived Orders
Get Archived Orders 使用場景SHOPLINE 將依據訂單狀態封存超過一定期限的訂單資料(訂單封存條件可參考 FAQ 說明)
因此當使用
Get Order、Get Orders透過指定 訂單 ID 的方式抓取訂單資料,訂單資料標示如下時,則表示該訂單已封存,則需透過Get Archived Orders取得訂單資料
- Get Order - 收到 410 response (請參閱 Get Order)
- Get Orders - response 中標註已封存訂單 (請參閱 Get Orders)
如欲拿取超過兩年以上的訂單資料,也需要使用
Get Archived Orders取得訂單資料
Function
To search archived orders with specific conditions.
利用條件搜尋冷區訂單,並且透過 Webhook 方式通知。
由於冷區匯出所需要的時間比較長,以下 API 會使用非同步的形式設計。
詳情可以參考流程圖
Sequence Diagram
Required API Auth
Get Archived Order
URL
POST https://open.shopline.io/v1/orders/archived_orders
Request Parameter
Parameter | Type | Description | Example |
|---|---|---|---|
filters | String | 匯出冷區報表開始時間 | filters: { |
callback_url | String | 當 job 完成後會呼叫的 callback URL |
Callback_url 驗證當封存訂單處理完成後,將透過 webhook 發送 webhook payload 至對應的 callback_url。為確保 callback_url 正確性將會進行驗證,詳請參閱 Webhook Verification
Request example
Response fields
| Parameter | Type | Description | Example |
|---|---|---|---|
| message | Array | Job Identifier info |
Response example
Webhook payload
| Parameter | Type | Description | Example |
|---|---|---|---|
| topic | String | Event topic name | order/get_archived_order |
| job_id | String | Job Identifier | |
| merchant_id | String | Merchant Identifier | |
| merchant_handle | String | ||
| start_date | DateTime | 匯出冷區報表開始時間 | |
| end_date | DateTime | 匯出冷區報表結束時間 | |
| download_links | []String | 若干 S3 下載連結 | |
| status | String | 產報表的結果 | success, failed |
| error_message | String | 當產報表的結果為 failed 時的 error | |
| event | String | 事件所屬的資源分類 | Order |
| callback_url | String | 當 job 完成後會呼叫的 callback URL | |
| application_id | String | 使用 application token 時,所屬的 application id |
CSV Fields
csv 範例檔案請參考 csv sample file,可取用的欄位資訊說明如下:
Parameter | Type | Description | Example |
|---|---|---|---|
id | String | Order ID | 5d8c8b3be388095d25acbc89 |
order_number | String | Order Number | 2019052707260498 |
system_order_number | String | 系统生成的訂單號 | |
merchant_order_number | String | 店家自定義訂單號 | |
status | String | Order Status
| pending |
type | String | POS Order Type
| preorder |
order_remarks | String | Order Remarks | Please send the goods after 4p.m. |
order_payment | Order Payment Information | Please check the link on the left | |
order_delivery | Order Delivery Information | Please check the link on the left | |
delivery_address | Recipient Information | Please check the link on the left | |
delivery_data | Third-Party Delivery Information | Please check the link on the left | |
cart_page_id | String | Cart Page ID | 628604a1e388091b6fd29836 |
customer_id | String | Cutomer ID | 5cc17da1e388091b6fd299ed |
customer_name | String | Customer's Name | 郭美玉 |
customer_email | String | Customer's Email | |
customer_phone | String | Customer's Phone | 0912345678 |
customer_phone_country_code | String | Customer's Phone Country Code | 886 |
customer_info | Customer's Information | Please check the link on the left | |
currency_iso | String | Currency ISO (ISO-4217) | TWD |
subtotal | Price total for all order items | Please check the link on the left | |
order_discount | Order discount | Please check the link on the left | |
user_credit | Customer Credit | Please check the link on the left | |
total_tax_fee | Total Tax Fee | Please check the link on the left | |
total | Final price total, which includes payment fee and delivery fee | Please check the link on the left | |
order_points | Integer | Points used | 15 |
order_points_to_cash | Points used to cash | Please check the link on the left | |
invoice | Invoice Info | Please check the link on the left | |
invoices | Array | Invoices Info | 內容可參考 Invoice |
subtotal_items | Order Product Item Data | Please check the link on the left | |
promotion_items | Promotion Item Data | Please check the link on the left | |
custom_data | Array | Customized Order Fields
| {"value": "優質的店家!", "field_translations": { |
custom_discount_items | Order Custom Discount Item Data | Please check the link on the left | |
affiliate_data | Object | Live stream room data | |
ref_order_id | String | 直播間資料For third party custom order id | ORD0001 |
ref_customer_id | String | For third party custom customer id | CUS0001 |
agent |
| Please check the link on the left | |
parent_order_id | String | Parent Order ID | |
split_at | DateTime | Order Split Time | |
confirmed_at | DateTime | Order Confirmed Time
| |
updated_at | DateTime | Order Updated Time
| 2019-09-26 |
created_at | DateTime | Order Created Time
| 2019-09-26 |
edited_at | DateTime | "Order edited Time
| |
skip_fulfillment | Boolean | Is order skipping fulfillment? | false |
utm_data | UTM Data | Please check the link on the left | |
ga_tracked | Boolean | Is tracked by GA? | false |
created_by | String | Channel that created the order
| openapi |
created_from | String | Order created from
| admin_openapi |
is_guest_checkout | Boolean | true checkout as guest | |
affiliate_campaign | Object | Affiliate campaign associated with the order | |
order_source | Object | Source of the order
| |
tags | Array | All tag content of the order | |
return_from_order_id | String | Original POS order id from POS return order | |
agent_id | String | Agent id that created the order | 633fb52fd87b66000b180726 |
credit_reward_campaign_summary | Object | Credit reward campaign with the order 適用情況:有開啟「回饋活動」featureKey= credit_campaign 功能時。 | |
member_point_summary | Object | member point with the order | |
cart_attributes | Object | Snapshot of cart | |
checkout_object_data | Object | Summary of cart | |
membership_tier_data | Object | Snapshot of MembershipTier | |
product_subscription_period | Integer | Product subscription period |
Updated 13 days ago