Skip to content

Update Inline Order

Description

更新 inline 訂單。
訂單狀態必須按順序變更 ACCEPT -> READY -> PICK_UP。

Resource

PATCH /v1/inline/order

Authorization

採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login

Request Body Parameters

Name Type Description
store_id string 門市編號
order_id string 訂單編號
state string 訂單狀態
ALLOWED VALUES:
  • ACCEPTED: 已接受
  • READY: 已準備好
  • PICKED_UP: 已取餐
  • CANCELLED: 取消
  • CUSTOM_CANCELLED: 消費者線上取消
estimated_ready_time string 訂單預計完成時間
當 status = ACCEPTED 時,為必填。
(option)
cancel_reason string 取消原因
當 status = CANCELLED 時,為必填。
ALLOWED VALUES:
  • SOLD_OUT: 售完
  • BUSY: 忙碌
  • OTHERS: 其它
  • NO_SHOW: 餐點完成但無人取餐
  • CS_ISSUE: 客服介入處理
  • PLATFORM_CUSTOM: 自定義取消
(option)
platform_custom_cancel_reason string 自定義取消原因
當 cancel_reason = PLATFORM_CUSTOM 時,為必填。
(option)
auto_refund_on_cancel boolean 取消訂單時自動退款
當 status = CANCEL 且 auto_refund_on_cancel = True,則會自動退款。
(option)

Request Example

{
  "store_id": "A001",
  "order_id": "-O29VCxut5SE5SS8rGdG",
  "state": "ACCEPTED",
  "estimated_ready_time": "2024-07-24 05:22:16.942",
  "cancel_reason": "SOLD_OUT",
  "platform_custom_cancel_reason": "string",
  "auto_refund_on_cancel": false
}

Response Body Parameters

Name Type Description
id string 訂單編號
display_id string 顯示用的訂單編號 ID
(option)
short_id string 訂單短編號
state string 訂單狀態
ALLOWED VALUES:
  • NEW: 新建
  • ACCEPTED: 已接受
  • READY: 已準備好
  • PICKED_UP: 已取餐
  • CANCELLED: 已取消
  • REFUND: 退款
  • RECEIVED: 已收到
  • FINISHED: 完成
  • FAILED: 失敗
  • STORED: 已儲存
  • DELETED: 已刪除
  • HOLD: 擱置
order_type string 訂單類型
ALLOWED VALUES:
  • TAKE_OUT: 外帶單
  • DELIVERY: 外送單
customer Customer 消費者資訊
transaction_total float 訂單總金額
transaction_amount_paid float 已支付金額
(option)
transaction_amount_refunded float 已退款金額
(option)
currency string 訂單幣別
(option)
promotion_discount float 促銷折扣
(option)
delivery_fee float 外送費
(option)
service_fee float 服務費
(option)
items Item[] 訂單細項
gifts Gift[] 促銷贈品
(option)
promotions Promotion[] 促銷明細
(option)
invoice Invoice 發票
(option)
note string 消費者備註
(option)
created_at string 訂單創建時間
accepted_at string 訂單接受時間
(option)
expected_arrival_time string 消費者預計取餐時間或外送員預計送達時間
若為 0,表示盡快
(option)
estimated_ready_time string 餐廳預計的準備完成時間
(option)
ready_at string 訂單準備完成時間
(option)
picked_up_at string 訂單被取走時間
(option)
updated_at string 訂單最新更新時間
cancelled_at string 訂單取消時間
(option)
cancel_reason string 訂單取消原因
(option)
platform_custom_cancel_reason string 平台自訂取消原因
(option)
delivery Delivery 外送資訊
(option)
payment_id string 付款編號
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
(option)

Response Body Parameters - Customer

Name Type Description
customer_id string 消費者編號
(option)
member_id string 會員編號
(option)
name string 消費者名稱
(option)
gender string 消費者性別
ALLOWED VALUES:
  • MALE: 男性
  • FEMALE: 女性
  • OTHER: 其他
(option)
language string 消費者語言
(option)
email string 消費者郵件
(option)
phone string 消費者電話
(option)

Response Body Parameters - Item

Name Type Description
item_id string 商品編號
external_item_id string 外部商品編號
(option)
promotion_id string 贈送此商品的促銷編號
(option)
item_name string 名稱
item_locale string 語系
quantity integer 數量
price float 價格
promotion_price float 促銷價格
(option)
note string 備註
(option)
special_price float 特殊價格
(option)
prepay_price float 預付價格
(option)
modifiers Modifier[] 修飾項目列表
(option)

Response Body Parameters - Gift

Name Type Description
item_id string 菜單項目編號
external_item_id string 外部菜單項目編號
(option)
promotion_id string 贈送此項目的促銷編號
(option)
item_name string 名稱
item_locale string 語系
quantity integer 數量
price float 價格
promotion_price float 促銷價格
(option)
note string 備註
(option)
special_price float 特殊價格
(option)
prepay_price float 預付價格
(option)
modifiers Modifier[] 修飾項目列表
(option)

Response Body Parameters - Modifier

Name Type Description
item_id string 項目編號
external_item_id string 外部菜單項目編號
(option)
name string 項目名稱
parent_item_id string 此項目的父項目編號
modifier_id string 此項目的修飾符編號
modifier_name string 修飾符名稱
quantity integer 項目數量
price float 原始價格
(option)

Response Body Parameters - Promotion

Name Type Description
id string 促銷編號
type string 促銷代碼類型
ALLOWED VALUES:
  • DISCOUNT_DOLLAR
  • DISCOUNT_SIMPLE_MULTIPLES
  • DISCOUNT_PERCENTAGE
name string 促銷名稱
(option)
redeem_code string 促銷驗證碼
(option)
min_order_amount float 促銷適用的最低訂單金額
(option)
discount Discount 折扣資訊
(option)

Response Body Parameters - Discount

Name Type Description
is_percentage boolean 是否為百分比折扣
value float 折扣值
10 表示 $10 或 10%
discount_price float 促銷折扣後的價格

Response Body Parameters - Invoice

Name Type Description
type string 發票類型
ALLOWED VALUES:
  • TW_DUPLICATE_UNIFORM_INVOICE: 二聯式
  • TW_TRIPLICATE_UNIFORM_INVOICE: 三聯式
(option)
business_id_number string 公司的營業登記號碼
(option)
business_title string 公司的名稱
(option)
issued_timestamp string 發票開立時間
(option)

Response Body Parameters - Delivery

Name Type Description
distance integer 餐廳與目標地址之間的距離 (公尺)
(option)
address Address 地址資訊
note string 給運送員的備註
(option)
contact_method string 與顧客的聯繫方式
ALLOWED VALUES:
  • OUTSIDE_ORDER: 外送員將食物放在門外
  • MEET_UP: 外送員直接交給顧客

Response Body Parameters - Address

Name Type Description
line1 string 國家、城市、街道和門牌號碼
line2 string 公寓、套房、單元、樓層等
(option)
lat float 緯度
lng float 經度

Response Example

{  
  "id": "123",
  "display_id": "AB19B",
  "short_id": "Q-2ZC",
  "state": "NEW",
  "order_type": "TAKE_OUT",
  "customer": {
    "customer_id": "my-id",
    "member_id": "AB12345678",
    "name": "inline customer",
    "gender": "MALE",
    "language": "zh",
    "email": "[email protected]",
    "phone": "+886111222333"
  },
  "transaction_total": 0.0,
  "transaction_amount_paid": 0.0,
  "transaction_amount_refunded": 0.0,
  "currency": "string",
  "promotion_discount": 0.0,
  "delivery_fee": 0.0,
  "service_fee": 0.0,
  "items": [
    {
      "item_id": "string",
      "external_item_id": "string",
      "promotion_id": "string",
      "item_name": "小籠包",
      "item_locale": "zh-tw",
      "quantity": 0,
      "price": 0.0,
      "promotion_price": 0.0,
      "note": "string",
      "special_price": 0.0,
      "prepay_price": 0.0,
      "modifiers": [
        {
          "item_id": "150",
          "external_item_id": "string",
          "name": "微糖",
          "parent_item_id": "123",
          "modifier_id": "1",
          "modifier_name": "甜度",
          "quantity": 10,
          "price": 0.0,
          "modifiers": [
            {}
          ]
        }
      ]
    }
  ],
  "gifts": [
    {
      "item_id": "string",
      "external_item_id": "string",
      "promotion_id": "string",
      "item_name": "小籠包",
      "item_locale": "zh-tw",
      "quantity": 0,
      "price": 0.0,
      "promotion_price": 0.0,
      "note": "string",
      "special_price": 0.0,
      "prepay_price": 0.0,
      "modifiers": [
        {
          "item_id": "150",
          "external_item_id": "string",
          "name": "微糖",
          "parent_item_id": "123",
          "modifier_id": "1",
          "modifier_name": "甜度",
          "quantity": 10,
          "price": 0.0,
          "modifiers": [
            {}
          ]
        }
      ]
    }
  ],
  "promotions": [
    {
      "id": "string",
      "type": "string",
      "name": "Get $10 for every $100 spent",
      "redeem_code": "string",
      "min_order_amount": 0.0,
      "discount": {
        "is_percentage": true,
        "value": 0.0,
        "discount_price": 0.0
      }
    }
  ],
  "invoice": {
    "type": "TW_DUPLICATE_UNIFORM_INVOICE",
    "business_id_number": "52384127",
    "business_title": "inline Apps Ltd.",
    "issued_timestamp": "2024-07-24 05:22:16.942"
  },
  "note": "string",
  "created_at": "2024-07-24 05:22:16.942",
  "accepted_at": "2024-07-24 05:22:16.942",
  "expected_arrival_time": "2024-07-24 05:22:16.942",
  "estimated_ready_time": "2024-07-24 05:22:16.942",
  "ready_at": "2024-07-24 05:22:16.942",
  "pickedup_at": "2024-07-24 05:22:16.942",
  "updated_at": "2024-07-24 05:22:16.942",
  "cancelled_at": "2024-07-24 05:22:16.942",
  "cancel_reason": "string",
  "platform_custom_cancel_reason": "string",
  "delivery": {
    "distance": 0,
    "address": {
      "line1": "string",
      "line2": "string",
      "lat": 22.9997,
      "lng": 120.2270
    },
    "note": "string",
    "contact_method": "OUTSIDE_ORDER"
  },
  "payment_id":   "string"
}