API 適用的买方用户區域:台灣
下載直接整合物流發票。您要下載為發票的訂單資訊必須在直接整合物流上可用。訂單資訊透過安排出貨轉移至物流商。
注意:此介面在訂單付款完成狀態和運送完成七天之後不返回發票檔案。
當前可用的物流公司有(deliveryCompanyCode):
| 物流公司名稱 | 類型 | deliveryCompanyCode |
| 宅配-嘉里 | Home delivery | TWL_KERRY |
| 宅配-新竹 | Home delivery | TWL_HCT |
| 便利商店-全家 | CVS | TWL_FM |
| 便利商店-7-11 | CVS | TWL_711 |
路徑
POST
/v2/providers/openapi/apis/api/v1/vendors/{vendorId}/orders/directIntegration/downloadInvoices
範例
請求引數
路徑引數
| 名稱 | 是否必須 | 型別 | 描述 |
| vendorId | O | String | Vendor ID 酷澎提供給賣家的固有程式碼 e.g. A158000ABC |
Request Body Parameter
| 名稱 | 是否必須 | 型別 | 描述 | |
| deliveryCompanyCode | O | String | 物流公司程式碼 請輸入正確的物流公司程式碼,否則請求會失敗 - 宅配-新竹: TWL_HCT - 宅配-嘉里: TWL_KERRY - 便利商店-全家 : TWL_FM - 便利商店 7-11 : TWL_711 |
|
| invoicePrintDtoList | O | Array | invoicePrintDto 清單。 invoicePrintDtoList 的最大大小. - TWL_KERRY : 5 - TWL_HCT : 5 - TWL_FM : 30 - TWL_711: 40 |
|
| shipmentBoxId | O | Number | 合併配送號碼 (可以通過訂單查詢接口獲得) | |
| invoiceNumber | O | String | 運單號碼 | |
請求體範例
宅配請求:
{
"deliveryCompanyCode": "TWL_KERRY",
"invoicePrintDtoList": [
{
"shipmentBoxId": 595428823171074,
"invoiceNumber": "17736737875"
},
{
"shipmentBoxId": 595428823171073,
"invoiceNumber": "17736737871"
}
]
}
便利商店請求:
{
"deliveryCompanyCode": "TWL_FM",
"invoicePrintDtoList": [
{
"shipmentBoxId": 595462662815744,
"invoiceNumber": "15314703241"
},
{
"shipmentBoxId": 595481864355841,
"invoiceNumber": "23415470849"
}
]
}
返回訊息
返回訊息是一個檔案,內容類型因物流公司而異。
- TWL_KERRY
發票檔案為 pdf
content-type = application/pdf;charset=UTF-8 - TWL_HCT
發票檔案為 pdf
content-type = application/pdf;charset=UTF-8 - TWL_FM
發票檔案為 html
content-type = text/html;charset=UTF-8 - TWL_711
發票檔案為 html
content-type = text/html;charset=UTF-8
返回訊息範例
TWL_KERRY :
HTTP/1.1 200 OK
content-type: application/pdf;charset=UTF-8
content-length: 183409
content-disposition: attachment; filename="7e1beb74-11e9-407c-9775-04696ea3db2f.pdf"
accept-ranges: bytes
TWL_FM :
HTTP/1.1 200 OK
content-type: text/html;charset=UTF-8
vary: Accept-Encoding
content-disposition: attachment; filename="e4d3dfd5-c027-4fc8-9004-054e4fe76805.html"
content-encoding: gzip
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
...
</html>
TWL_711 :
HTTP/1.1 200 OK
content-type: text/html;charset=UTF-8
vary: Accept-Encoding
content-disposition: attachment; filename="dbd98df5-f377-4f5b-bb6e-9a643782fd8a.html"
content-encoding: gzip
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
......
</html>
錯誤程式碼
| HTTP狀態程式碼(錯誤型別 | 錯誤訊息 | 解決方案 |
| 400 | Invalid vendor ID | 路徑或標頭(X-Requested-By)中的 vendorId 無效或不相等,請檢查並保持相同的 vendorId |
| 400 | Unsupported deliveryCompanyCode | 不支持的 deliveryCompanyCode。支持的物流公司為 TWL_KERRY、TWL_FM、TWL_711、TWL_HCT |
| 400 | Empty deliveryCompanyCode, please input deliveryCompanyCode | 請輸入 deliveryCompanyCode。支持的物流公司為 TWL_KERRY、TWL_FM、TWL_711、TWL_HCT |
| 400 | Empty invoicePrintDtoList, please input invoicePrintDtoList | 請輸入 invoicePrintDtoList |
| 400 | Request size exceeds maximum limit of 5. requestSize: 6 | 檢查 InvoicePrintDtoList 的最大允許大小 - TWL_KERRY : 5 - TWL_HCT : 5 - TWL_FM : 30 - TWL_711: 40 |
介面名稱
DOWNLOAD_INVOICE