Scenario
Merchants can download their statements in CSV format.
- Step 1. Merchant: Transmit the specific order details and category to ECPay via POST (HTTP Method).
- Step 2. ECPay : Upon receiving a merchant’s order inquiry and checking the details, return a CSV file for the merchant to download.
Special Note:
- The API has restrictions on IP access. Please set up the IP on “Merchant’s Admin Website -> System development management -> System onterface setting.”
- Only 1 CSV may be downloaded per minute.
API URLS
- Stage:https://vendor-stage.ecpay.com.tw/PaymentMedia/TradeNoAio
- Production :https://vendor.ecpay.com.tw/PaymentMedia/TradeNoAio
HTTPS Transfer Protocol
- Content Type :application/x-www-form-urlencoded
- HTTP Method :POST
Request Parameters Description
MerchantID String(10)
Required
DateType String(1)
Required
The date category to be inquired
- 2: Check date paid
- 4: Check date disbursed date
- 6: Check order date
BeginDate String(10)
Required
The start date of the query Date format is “yyyy-MM-dd“.
EndDate String(10)
Required
The end date of the query Date format is “yyyy-MM-dd“.
Payment method.
Check the payment method for an order
- 01: Credit cards
- 02: WebATM
- 03: ATM
- 04: Convenience store codes
- 05: Convenience store barcodes
- 08: Credit card (OTP)
- 10: FamilyMart barcode
- 11: Flexible Installment
- 12: OPAY TWQR
- Ignore this parameter: search all
PlatformStatus String(1)
The order category to be inquired
- 1: General order
- 2: Platform order
- Ignore this parameter: search all
PaymentStatus String(1)
The order payment status to be inquired
- 0: Unpaid orders
- 1: Paid orders
- 2: Failed orders
- Ignore this parameter: All orders
AllocateStatus String(1)
The disbursement status of the order to be inquired
- 0: Order has not been disbursed
- 1: Order has been disbursed
- Ignore this parameter: All order
MediaFormated String(1)
Required
The format of the file to be downloaded
- 0: Old file format
- 1: New file format
File encoding format to download
- If it is in Big5 format, please bring 1 parameter.
- If it is in UTF8 format, please bring 2 parameters.
- If this parameter is not passed in or is null, the default is Server Default encoding format.
CheckMacValue String
Required
Please refer to the Appendix Checksum Mechanism.
Response CSV Old File Format Details: (Chinese only)
The default format is yyyy-MM-dd hh:mm:ss
The default format is yyyy-MM-dd hh:mm:ss
The default format is yyyy-MM-dd hh:mm:ss
Response CSV New File Format Details: (Chinese only)
The default format is yyyy-MM-dd hh:mm:ss
The default format is yyyy/MM/dd hh:mm:ss
Special Note:
- The download format is the same as the “General order inquiry/Overall payments” in the admin website for merchants.
- If there is no data, the statement file will only contain the field names.
- If an error occurs, the statement fill will include a data entry recording the messages returned at the time of execution at the “Notes” or “Merchant Notes” section, in addition to the field names. All remaining fields will be empty.
- The file’s default encryption method is BIG-5.
YAML
The provided YAML file is used to define information such as the configuration, structure, operations, and infrastructure management of the API, making it easier for developers to understand and use the API.
openapi: 3.1.0
info:
title: ECPay Reconciliation File Download API
version: 1.0.0
servers:
- url: https://vendor.ecpay.com.tw
description: Production Environment
- url: https://vendor-stage.ecpay.com.tw
description: Testing Environment
paths:
/PaymentMedia/TradeNoAio:
post:
summary: Download reconciliation file
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
MerchantID:
type: string
description: Merchant ID provided by ECPay
DateType:
type: string
description: Date type for query (2 is payment date, 4 is allocation date, 6 is order date)
BeginDate:
type: string
description: Start date for the query (yyyy-MM-dd)
EndDate:
type: string
description: End date for the query (yyyy-MM-dd)
PaymentType:
type: string
description: Payment method (optional)
PlatformStatus:
type: string
description: Order type (optional)
PaymentStatus:
type: string
description: Payment status (optional)
AllocateStatus:
type: string
description: Allocation status (optional)
MediaFormated:
type: string
description: CSV format (0 is old format, 1 is new format)
CharSet:
type: string
description: File encoding format (optional)
CheckMacValue:
type: string
description: CheckMac value for verification
required:
- MerchantID
- DateType
- BeginDate
- EndDate
- MediaFormated
- CheckMacValue
responses:
'200':
description: Successful response
content:
text/csv:
schema:
oneOf:
- type: string
format: binary
description: |
當 `MediaFormated=0` 時,CSV 格式如下:
```
交易日期,綠界交易序號,特店訂單編號,ATM條碼,交易金額,付款方式,付款結果,付款日期,款項來源,通路費,交易服務費率,交易服務費金額,應收款項,撥款狀態,撥款日期,備註
```
- type: string
format: binary
description: |
當 `MediaFormated=2` 時,CSV 格式如下:
```
訂單日期, 廠商訂單編號, 綠界訂單編號, 店鋪代號, 平台名稱, 付款方式, 費率(每筆), 信用卡授權單號, 信用卡卡號末4碼, 超商資訊/ATM繳款帳號, 付款狀態, 交易金額, 退款日期, 退款金額, 交易手續費, 交易服務費金額, 應收款項(淨額), 撥款狀態, 備註, 廠商備註, 商品名稱, 交易描述, 付款人姓名, 付款人手機, 付款人Email, 收件人姓名, 收件人手機, 收件人地址, 收件人Email, 統一編號
```