Confirm Order
Description
確認訂單。
Resource
PATCH /v2/order/confirm
Authorization
採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login。
Request Body Parameters
| Name | Type | Description |
|---|---|---|
| id | string | 訂單編號 |
| payments | Payment[] | 付款資訊 (optional) |
| receipt | bool | 是否開立發票 |
| number | string | 取餐號碼 (optional) |
| store_id | string | 門市編號 (optional) |
| external_id | string | 外部編號 (optional) |
| has_print_receipt | bool | 是否有列印發票 (optional) |
| receipt_info | Receipt | 發票資訊,發票組合詳細範例 (optional) |
Request Body Parameters - Payment
| Name | Type | Description |
|---|---|---|
| type | Payment | 付款方式 |
| payment_amount | int | 支付金額 |
| transaction_id | string | 交易代碼 |
| relate_id | string | 其他代碼 (optional) |
| detail | Detail | 付款明細(信用卡及現金券需填入) (optional) |
Request Body Parameters Payment Instruction
| type | name |
|---|---|
| LINE_PAY | LINE Pay |
| PI_PAY | Pi Pay |
| CREDIT_CARD | 信用卡 |
| EASY_CARD | 悠遊卡 |
| CASH | 臨櫃結帳 |
| MWD_PAY | 麥味登Pay |
| Easy_Wallet | 悠遊付 |
| APPLE_PAY | Apple Pay |
| GOOGLE_PAY | Google Pay |
| CASH_TICKET | 禮券 |
| POINT_DISCOUNT_AMOUNT | 點數折抵金額 |
| NCCC_EASY_CARD | NCCC悠遊卡 |
| NCCC_IPASS | NCCC一卡通 |
| NCCC_ICASH | NCCC iCash |
| NCCC_HAPPY_CASH | NCCC有錢卡 |
| CASH_CAR | 現金 |
| CHARGE_CARD | 簽帳 |
| MOTORCADE | 車隊 |
| CREDIT_CARD_CAR | 信用卡 |
| CTBC_CARD | 中信卡 |
| BARCODE_PAY | 條碼支付 |
| TAIWAN_PAY | 台灣 Pay |
| JkoPay | 街口支付 |
| CUSTOMIZE | 自定義金流 |
| TK01 | 門票折抵 |
| HAO_SPEED | 全家外送自取 |
| EC | EC |
| HSA_EXTRA | 異質POS |
| PX_PAY | 全支付 |
| CASH_ON_DELIVERY | 貨到付款 |
| NEWEB_PAY | 藍新金流 |
| CASH_MODULE | 現金模組 |
| I_CASH_PAY | 愛金卡支付 |
| DD_PAY | 信用卡(DD_PAY) |
Request Body Parameters - Detail
| Name | Type | Description |
|---|---|---|
| resource_number | string | 信用卡卡號或是現金卷的票號 |
| terminal_data | string | Receipt No + Terminal ID |
| auth_code | string | 授權碼 |
| reference_no | string | 參考編號 |
Request Body Parameters - Receipt
| Name | Type | Description |
|---|---|---|
| tax_ID_number | string | 統一編號 (optional) |
| npoban | string | 捐贈碼 (https://i.imgur.com/5LAsOF4.jpg) (optional) |
| carrier_type | string | 買方載具類別 (optional) |
| carrier | string | 買方載具 (optional) |
Response Body Parameters
| Name | Type | Description |
|---|---|---|
| code | Code Instruction | 回傳代碼(optional) |
| message | Code Instruction | 回傳訊息(optional) |
| confirm_failed_tickets | Confirm Failed Ticket[] | 核銷票券失敗列表(optional) |
| current_state | string (enum) |
訂單狀態,手動接單時回傳 CREATED,自動接單時回傳 ACCEPTED,拒絕接單時回傳 CANCELLED ALLOWED VALUES:
|
| take_meal_number | string | 取餐號碼(optional) |
| receipt | Receipt | 發票資訊,發票組合詳細範例 (optional) |
| points | Points | 點數資訊 (optional) |
Response Body Parameters - Points
| Name | Type | Description |
|---|---|---|
| before_transaction | integer | 本次交易前持有點數 |
| exchange_amount | integer | 本次交易可折抵金額 |
| after_transaction | integer | 本次交易後點數餘額 |
| add | integer | 本次交易後新增點數 |
| use | integer | 本次交易使用點數 |
Response Body Parameters - Receipt
| Name | Type | Description |
|---|---|---|
| tax_ID_number | string | 統一編號 (optional) |
| npoban | string | 捐贈碼 (https://i.imgur.com/5LAsOF4.jpg) (optional) |
| carrier_type | string | 買方載具類別 (optional) |
| carrier | string | 買方載具 (optional) |
| receipt_number | string | 統一編號 (optional) |
| random_number | string | 隨機碼 (optional) |
| AESKey | string | AESKey (optional) |
| title | string | 發票標題 (optional) |
| begin_ym | string | 起始年月 (optional) |
| end_ym | string | 結束年月 (https://i.imgur.com/5LAsOF4.jpg) (optional) |
| gui_number | string | 賣方統一編號 (optional) |
Response Body Parameters - Code Instruction
| code | message |
|---|---|
| 4401 | 確認訂單成功,部分票券核銷失敗 |
| 4402 | 益欣票券核銷失敗 |
| 4403 | 墨攻票券核銷失敗且訂單無其他商品 |
Response Body Parameters - Confirm Failed Ticket
| Name | Type | Description |
|---|---|---|
| number | string | 票券號碼 |
| encrypt_number | string | 加密券號 |
| sale_from | string | 通路來源 |
| code | string | 核銷票券 API 回傳代碼 |
| message | string | 核銷票券 API 回傳訊息 |
Response - 重複確認訂單
Status-Code: 200
{
"code": "1123",
"message": "此筆訂單已確認,不需重複確認",
"current_state": "ACCEPTED",
"take_meal_number": "k007",
"receipt": {
"tax_ID_number": "",
"npoban": "",
"carrier_type": "",
"carrier": "",
"receipt_number": "WI70000225",
"random_number": "4386",
"AESKey": "DE92AE7B79AE53D56B32F89D8B57C587",
"title": "",
"begin_ym": "202407",
"end_ym": "202408",
"gui_number": "24436074"
},
"points": {
"before_transaction": 890921,
"exchange_amount": 0,
"after_transaction": 890926,
"add": 5,
"use": 0
}
}
Response Example - 墨攻票券部分核銷失敗且訂單有其他商品
Status-Code: 200
{
"code": "4401",
"message": "確認訂單成功,部分票券核銷失敗",
"confirm_failed_tickets": [
{
"number": "AA0001",
"encrypt_number": "AAx12k",
"sale_from": "KKDAY",
"code": "0002",
"message": "票券優惠期間已過,如有疑問請洽票券原購買平台商"
}
],
"current_state": "ACCEPTED",
"take_meal_number": "k007",
"receipt": {
"tax_ID_number": "",
"npoban": "",
"carrier_type": "",
"carrier": "",
"receipt_number": "WI70000225",
"random_number": "4386",
"AESKey": "DE92AE7B79AE53D56B32F89D8B57C587",
"title": "",
"begin_ym": "202407",
"end_ym": "202408",
"gui_number": "24436074"
},
"points": {
"before_transaction": 890921,
"exchange_amount": 0,
"after_transaction": 890926,
"add": 5,
"use": 0
}
}
Response Example - 益欣票券核銷失敗
Status-Code: 400 Bad Request
{
"code": "4402",
"message": "00003023112000080訂單取消成功",
"confirm_failed_tickets": [],
"current_state": "ACCEPTED",
"take_meal_number": "k007",
"receipt": {
"tax_ID_number": "",
"npoban": "",
"carrier_type": "",
"carrier": "",
"receipt_number": "WI70000225",
"random_number": "4386",
"AESKey": "DE92AE7B79AE53D56B32F89D8B57C587",
"title": "",
"begin_ym": "202407",
"end_ym": "202408",
"gui_number": "24436074"
},
"points": {
"before_transaction": 890921,
"exchange_amount": 0,
"after_transaction": 890926,
"add": 5,
"use": 0
}
}
Response Example - 墨攻票券核銷失敗且訂單無其他商品
Status-Code: 400 Bad Request
{
"code": "4403",
"message": "00003023112000080訂單取消成功",
"confirm_failed_tickets": [
{
"number": "AA0001",
"encrypt_number": "AAx12k",
"sale_from": "KKDAY",
"code": "0002",
"message": "票券優惠期間已過,如有疑問請洽票券原購買平台商"
}
],
"current_state": "ACCEPTED",
"take_meal_number": "k007",
"receipt": {
"tax_ID_number": "",
"npoban": "",
"carrier_type": "",
"carrier": "",
"receipt_number": "WI70000225",
"random_number": "4386",
"AESKey": "DE92AE7B79AE53D56B32F89D8B57C587",
"title": "",
"begin_ym": "202407",
"end_ym": "202408",
"gui_number": "24436074"
},
"points": {
"before_transaction": 890921,
"exchange_amount": 0,
"after_transaction": 890926,
"add": 5,
"use": 0
}
}