https://{$api_host}/api/pay
| Field | Key | Required | Signed | Type | Example | Description |
|---|
| Merchant ID | merid | Yes | Yes | string | 10086 | Merchant ID assigned by the platform. |
| Merchant Order No. | tno | Yes | Yes | string | tno1234578910jqk | Merchant order number (max 32 chars, alphanumeric). |
| Amount | amt | Yes | Yes | string | 126.35 | Total amount (2 decimals). |
| Channel | chnl | Yes | Yes | string | CHNL_CODE | Channel code. It differs per merchant. Select in Merchant Console (type dp). |
| Client IP | client_ip | No | Yes | string | 127.0.0.1 | Client IP address used to initiate the payment. Helps improve success rate by region. |
| Notify URL | notify_url | Yes | Yes | string | https://www.baidu.com | Async callback URL (retry at 5s/10s/30s/180s/600s on success). |
| Return URL | return_url | No | Yes | string | https://www.baidu.com | Redirect URL after completion. |
| Extra | extra | No | Yes | string | | Extra parameters required by some channels, and extra data returned by some channels on success. |
| Payer Account | acct | No | Yes | object | | See Account (Acct). Currently channels prefixed with ph_ do not require this field. |
| Signature | sign | Yes | No | string | c380be5... | Signature. See Signature. |
!! Important:
- Non-required fields must be removed from the signature string when empty.
- URL fields must be URL-encoded before signing.
- Amount keeps 2 decimals. Note that
.00 may be omitted; pay special attention during signing. - If
acct is provided, it must be flattened during signing. See Signature. acct fields are shown in the “acct examples”. If you are unsure, you can ignore it for now.- Even if a channel does not require
acct, if you provide it, it will still be included in signature verification.
{
"merid": "10086",
"tno": "sn1234578910jqk",
"amt": "50.00",
"chnl": "cscn_cspb",
"client_ip": "127.0.0.1",
"return_url": "https://www.baidu.com",
"notify_url": "https://www.baidu.com",
"extra": "",
"sign": "9a9cba23f9075ff01b2ed2050f52f42d"
}
| Field | Key | Type | Example | Description |
|---|
| Platform Order No. | sn | string | sn12345678 | Platform order number. |
| Merchant Order No. | tno | string | tno1234578910jqk | Merchant order number. |
| Amount | amt | string | 1200.20 | Order amount. Formatted string. Convert type when needed. |
| Fee | fee | string | 12.20 | Fee amount. Formatted string. Convert type when needed. |
| Create Time | ctm | string | 2008-08-08 08:08:08 | Order creation time. |
| Expire Time | etm | string | 2008-08-08 12:17:12 | Expiry time. May not exist. |
| Data | data | string | base64 or array | For QR images etc, returns base64. |
| Redirect / Cashier URL | url | string | url | For redirect/cashier flows, returns the URL. |
| Receiver Account | acct | object | returned by some channels | |
{
"data": {
"sn": "sn12345678",
"tno": "tno1234578910jqk",
"amt": "100.00",
"ctm": "2008-08-08 08:08:08",
"etm": "2008-08-08 12:17:12",
"url": "http://abc.com/payment/pay/A20191107055050B07115.html",
"acct": {
"name": "Zhang San",
"acct": "1234567890"
}
}
}
- For redirect flows, only the cashier URL is returned and
acct is not included. - For cashier flows, the response may include both
url and acct. Some channels return acct for building your own cashier page; you need to display it.
https://{$api_host}/api/pay/query
| Field | Key | Required | Type | Example | Description |
|---|
| Merchant ID | merid | Yes | string | 10086 | Merchant ID assigned by the platform (not the login account). |
| Platform Order No. | sn | Yes | string | sn1234578910jqk | Platform order number (not your business order number). |
| Merchant Order No. | tno | Yes | string | tno1234578910jqk | Merchant order number. |
| Signature | sign | Yes | string | c380bec2bfd727a4..... | Signature. See the signature algorithm. |
!! Important:
- Platform order number and merchant order number must be provided. At least one must be provided.
- Merchant order number can only query the last 3 days of data.
{
"merid": "10086",
"sn": "sn1234578910jqk",
"sign": "9a9cba2119075ff01b2ed2050f52f42d"
}
| Field | Key | Type | Example | Description |
|---|
| Merchant ID | merid | string | 10086 | Merchant ID assigned by the platform (not the login account). |
| Platform Order No. | sn | string | sn12345678 | Platform order number. |
| Merchant Order No. | tno | string | tno1234578910jqk | Merchant order number. |
| Create Time | ctm | string | 2008-08-08 08:08:08 | Order creation time. |
| Amount | amt | float | 1260.35 | Order amount. |
| Fee | fee | float | 12.35 | Order fee. |
| Status | sts | string | success | success indicates paid successfully. |
| Signature | sign | string | 1d48ac07237fa.. | Used to verify data integrity. |
{
"data": {
"merid": "10086",
"sn": "sn123456",
"tno": "tno12345678910jqk",
"amt": "1000.00",
"fee": "12.35",
"ctm": "2000-10-10 08:08:08",
"sts": "submit",
"acct": {
"name": "Zhang San",
"acct": "1234567890"
}
}
}
| Status | Description |
|---|
| submit | Submitted |
| paying | Paying |
| fail | Failed |
| success | Success |
| close | Closed |