Obtaining reconciliation files
Introduction
You can obtain the reconciliation files by this API.
If a merchant has multiple stores, the records will be merged into one file.
The reconciliation files are generated after 9:00am on T + 1 (T is the transaction day), and if there's no transaction on T day, there's no file generated.
Both the settlement time and the trading time are in Beijing Time (GMT+8).
Service URL
POST
https://pay.scanforpay.com/api/common/checklist
Request Body
| Name | Parameter | Type | Required | Description |
|---|---|---|---|---|
| Merchant ID | merchantNo | String (15) | Y | Assigned by ScanForPay |
| Trade date | tradeDate | String(8) | Y | Format: yyyyMMdd, timezome: GMT+8 |
| Type | type | int | Y | 0:transaction file 1:settlement file |
Sample
{
"request": {
"header": {
"requestTime": "2018-07-25T18:06:05+08:00",
"partnerNo": "10001",
"signType": "SHA256",
"version": "1.0",
"reqMsgId": "fd03f269-3180-4575-8af0-8f6cf324fb0f"
},
"body": {
" merchantNo": "100010000000002",
" tradeDate ": "20181029",
"type": 0,
}
},
"signature": "2d2d5c66a67a24b5e13705cc38f34d93c395a7d9e0e4ff9425c9ce07b806a1cc"
}
Response body
| Name | Parameter | Type | Required | Description |
|---|---|---|---|---|
| Response code | code | int(5) | Y | 1:Success Other: Fail |
| Response message | msg | varchar (100) | Y | Response message |
| Is there data? | flag | int | Y | 0:No 1:Yes |
| Download url | url | varchar(100) | N | The download url of the transaction file or settlement file. The url will expire in 10 minutes, please fetch again after expired. |
Sample
Successful response sample
{
"response": {
"header": {
"partnerNo": "10001",
"respTime": "2018-07-25T18:06:12+08:00",
"signType": "SHA256",
"version": "1.0",
"reqMsgId": "213ca19e-c75f-450d-9acf-46e860570bb9"
},
"body": {
"code": 1,
"msg": "success",
"flag ": 1,
"url": "https://file.scanforpay.com/sfagdkfhgf-9812312fd0fdasf-bmzd2"
}
},
"signature": "0710b2630b467c14b3d54295def7f89be61097c21472547823b43c58f3466b08"
}
Failed response sample
{
"response": {
"header": {
"partnerNo": "10001",
"respTime": "2018-07-25T17:37:14+08:00",
"signType": "SHA256",
"version": "1.0",
"reqMsgId": "c11fe1c7-069b-4399-be00-31830a5de63d"
},
"body": {
"code": 30
"msg": "Order does not exist",
}
},
"signature": "5719065ecea463366cbf39b728b9b8cba940365c0c053dd96effde57f7edc1f8"
}
Transaction file format
Filename:MerchantID + "_transaction_" +transaction date+ ".csv
For example: MerchantID is 100300021, transaction date is 20190106, so the filename is
100300021_transaction_20190106.csv
Transaction file only includes the successful transaction records.
The first row of the file is header, from the second is the data. Fields are separated by ,.
Record detail
| Name | Parameter | Type | Description |
|---|---|---|---|
| Transaction time | transTime | String(25) | Date time with timezone, see RFC 3339 Section 5.6 for details. 2018-07-25T17:54:00+08:00 |
| Store Id | storeNo | String (15) | Assigned by ScanForPay |
| Order number | orderNo | varchar(32) | Generated by ScanForPay |
| Transation type | transType | varchar(10) | payment, refund |
| Paterner order number | partnerOrderNo | String (32) | Generated by merchant 20180802100000001 |
| Currency | currency | varchar(5) | eg: JPY |
| Transaction amount | orderAmount | int | The unit of the transaction amount is the smallest unit of the currency If the currency is RMB, the unit is Fen. So if the transaction amount is 1 Yuan, 100 should be passed;if currency is JPY, the unit is Japanese Yen |
| Settlement currency | orgCurrency | varchar(5) | eg:JPY |
| Transaction amount in settlement currency | orgOrderAmount | int | When currency is different from settlement currency, this is the real amount of a transaction. |
| Exchange rate | exchangeRate | num(20,8) | The exchange rate between currency and Settlement currency. If same, the value is 1. |
| Fee | feeAmount | int | When refund, (refund amount * service fee rate) will be returned to merchant. |
Settlement file format
Filename:MerchantID + "_settlement_" +transaction date+ ".csv
For example: MerchantID is 100300021, transaction date is 20190106, so the filename is100300021_settlement_20190106.csv
The first row of the file is header, from the second is the data. Fields are separated by ,.
Record detail
| Name | Parameter | Type | Description |
|---|---|---|---|
| Transaction time | transTime | String(25) | Date time with timezone, see RFC 3339 Section 5.6 for details. 2018-07-25T17:54:00+08:00 |
| Store Id | storeNo | String (15) | Assigned by ScanForPay |
| Order number | orderNo | varchar(32) | Generated by ScanForPay |
| Transation type | transType | varchar(10) | payment, refund |
| Paterner order number | partnerOrderNo | String (32) | Generated by merchant 20180802100000001 |
| Currency | currency | varchar(5) | eg: JPY |
| Transaction amount | orderAmount | int | The unit of the transaction amount is the smallest unit of the currency If the currency is RMB, the unit is Fen. So if the transaction amount is 1 Yuan, 100 should be passed;if currency is JPY, the unit is Japanese Yen |
| Settlement currency | orgCurrency | varchar(5) | eg:JPY |
| Transaction amount in settlement currency | orgOrderAmount | int | When currency is different from settlement currency, this is the real amount of a transaction. |
| Exchange rate | exchangeRate | num(20,8) | The exchange rate between currency and Settlement currency. If same, the value is 1. |
| Fee | feeAmount | int | When refund, (refund amount * service fee rate) will be returned to merchant. |
| Settlement amount | settlement | int | The amount will be settled to the merchant. Payment transaction: Settlement amount=Transaction amount-Fee Refundament transaction:Settlement amount=Fee-Refund amount |