Skip to content

DDPay Get Order

Description

主動查詢 DDPay 線上訂單付款狀態。傳入我方訂單編號,回傳 DDPay 最新訂單狀態,適用於未收到付款完成通知(notify)時的備援查詢。

Resource

GET /v1/payment/ddpay/orders/{merchant_order_id}

Authorization

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

Path Parameters

Name Type Description
merchant_order_id string 我方訂單編號

Request

/v1/payment/ddpay/orders/STORE001-20260616-001

Response Body Parameters

Name Type Description
ddpayOrderId string DDPay 訂單編號
merchantOrderId string 我方訂單編號
status string(enum) 訂單狀態
ALLOWED VALUES:
  • issued:等待付款
  • done:付款完成
  • cancelled:已取消
  • failed:付款失敗
mode string 付款模式:sd(線上)、ttp(感應)、cpm(被掃)
payment object|null 付款資訊,付款完成前為 null
payment.amount integer 實際付款金額(元)
payment.service string 付款服務,如 linepayjko
payment.paidAt integer 付款完成時間(Unix timestamp)
payment.invoiceCarrier object|null 電子發票載具;無載具時不帶此欄位

Response Example — 等待付款中

{
    "ddpayOrderId": "250610154305QjDVpx",
    "merchantOrderId": "STORE001-20260616-001",
    "status": "issued",
    "payment": null
}

Response Example — 付款完成

{
    "ddpayOrderId": "250610154305QjDVpx",
    "merchantOrderId": "STORE001-20260616-001",
    "status": "done",
    "mode": "sd",
    "payment": {
        "amount": 480,
        "service": "linepay",
        "paidAt": 1749560400
    }
}

Error Response

HTTP Status Description
400 請求參數錯誤或格式不符、訂單不存在
401 Authorization token 無效或過期
500 伺服器內部錯誤
{ "message": "錯誤說明文字" }