Scenario
This API provides merchants to search ATM, CVS, or BARCODE Code Retrieval.
Special Note:If the order has already been paid for, no query number results will be provided, please use the Query Order API for order information.
API URLS
- Stage: https://payment-stage.ecpay.com.tw/Cashier/QueryPaymentInfo
- Production: https://payment.ecpay.com.tw/Cashier/QueryPaymentInfo
HTTPS Transfer Protocol
- Content-Type:application/x-www-form-urlencoded
- HTTP Method:POST
Request Parameters Description
MerchantID String(10)
Required
MerchantTradeNo String(20)
Required
Merchant transaction ID.
- Merchant Transaction ID transmitted to ECPay when order was created.
TimeStamp Int
Required
- Convert current time to UnixTimeStamp (see example) to verify the time interval of this interfacing.
- ECPay verification time interval is currently set to be under 3 minutes and interfacing will expire if time is exceeded.
- Reference: http://www.epochconverter.com/。
CheckMacValue String
Required
Please refer to the Appendix Checksum Mechanism.
Used by contracted platform merchants.
- For general merchants or platform merchant interfacing, please leave empty.
- For use by platform merchants, please set [MerchantID] as the parameter.
Return Parameter Detail
Return value:
- 1: success
- rest: fail
Merchant transaction ID.
- Merchant Transaction ID transmitted to ECPay when order was created.
ECPay transaction ID.
- Please save the link between the ECPay transaction ID and the merchant transaction ID [MerchantTradeNo].
The format is yyyy/MM/dd HH:mm:ss.
Merchant notes field
Please refer to the Appendix Checksum Mechanism.
When the ChoosePayment parameter is set as CVS payment
The format is yyyy/MM/dd HH:mm:ss.
When the ChoosePayment parameter is set as ATM payment
Payment deadline.
The format is yyyy/MM/dd.
When the ChoosePayment parameter is set as Barcode payment
Payment deadline.
The format is yyyy/MM/dd HH:mm:ss.
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 ATM/CVS/BARCODE Payment Info Query API
version: 1.0.0
servers:
- url: https://payment.ecpay.com.tw
description: Production Environment
- url: https://payment-stage.ecpay.com.tw
description: Testing Environment
paths:
/Cashier/QueryPaymentInfo:
post:
summary: Query payment information for ATM/CVS/BARCODE
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
MerchantID:
type: string
description: Merchant ID provided by ECPay
MerchantTradeNo:
type: string
description: Merchant trade number
TimeStamp:
type: integer
description: Unix timestamp of the request
CheckMacValue:
type: string
description: CheckMac value for verification
PlatformID:
type: string
description: Partner platform ID
required:
- MerchantID
- MerchantTradeNo
- TimeStamp
- CheckMacValue
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
RtnCode:
type: integer
description: Transaction status code
RtnMsg:
type: string
description: Transaction message
MerchantID:
type: string
description: Merchant ID
MerchantTradeNo:
type: string
description: Merchant trade number
StoreID:
type: string
description: Store ID under the merchant
TradeNo:
type: string
description: ECPay trade number
TradeAmt:
type: integer
description: Transaction amount
PaymentType:
type: string
description: Payment type selected by the merchant
TradeDate:
type: string
description: Order creation date (yyyy/MM/dd HH:mm:ss)
CustomField1:
type: string
description: Custom field 1
CustomField2:
type: string
description: Custom field 2
CustomField3:
type: string
description: Custom field 3
CustomField4:
type: string
description: Custom field 4
CheckMacValue:
type: string
description: CheckMac value
PaymentNo:
type: string
description: Payment code (for CVS payments)
PaymentURL:
type: string
description: Payment link (for CVS payments)
ExpireDate:
type: string
description: Payment deadline (yyyy/MM/dd HH:mm:ss)
BankCode:
type: string
description: Bank code (for ATM payments)
vAccount:
type: string
description: Virtual account number (for ATM payments)
Barcode1:
type: string
description: First segment of barcode (for BarCode payments)
Barcode2:
type: string
description: Second segment of barcode (for BarCode payments)
Barcode3:
type: string
description: Third segment of barcode (for BarCode payments)