Create Wallet Recharge
Create a wallet recharge order and return the payment information. It is recommended to use the Place Order API with productCode=WALLET_RECHARGE; this dedicated wallet entry point is also available.
Interface Address:
text
/papi/wallet/recharge/createRequest Method:
text
POSTContent-Type:
text
application/jsonHeader Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-Access-Key | string | Yes | API access key ID. See API Rules for authentication |
| X-Signature | string | Yes | Signature value, Base64-encoded HMAC-SHA256 result |
| X-Timestamp | string | Yes | Millisecond-level Unix timestamp (13 digits) |
| X-Nonce | string | Yes | Random string, 10~32 lowercase letters and digits |
Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | string | Yes | Recharge amount, a positive integer string in cents (e.g. 1000 means 10 USD). Decimals are not allowed |
| currency | string | No | Currency code; only USD is supported |
| payCode | string | Yes | Payment method code, use an actually enabled online payment method |
| providerCode | string | Yes | Payment provider code, use the provider code of this site |
Request Example:
json
{
"amount": "1000",
"currency": "USD",
"payCode": "actual payment method code",
"providerCode": "actual provider code"
}Response Parameters:
| Parameter | Type | Description |
|---|---|---|
| code | integer | Error code. See Error Codes |
| data | object | Return data |
| ├─ rechargeNo | string | Recharge order number, same as orderNo |
| ├─ orderNo | string | Associated order number |
| ├─ amount | string | Recharge amount, in cents |
| ├─ currency | string | Currency code |
| ├─ currencySymbol | string | Currency symbol, e.g. $ for USD |
| ├─ rechargeStatus | string | Recharge status: CREATED pending confirmation, CREDITED credited |
| ├─ creditedTime | long | Credited time, Unix timestamp in milliseconds |
| ├─ paymentNo | string | System payment number |
| ├─ paymentStatus | integer | Payment status |
| ├─ payUrl | string | Payment URL provided by the channel |
| ├─ qrCodeUrl | string | Payment QR code URL |
| ├─ payParams | string | Payment channel parameters as a string, varies by channel |
| msg | string | Error message |
Response Example:
json
{
"code": 0,
"data": {
"rechargeNo": "",
"orderNo": "",
"amount": "1000",
"currency": "USD",
"currencySymbol": "$",
"rechargeStatus": "CREATED",
"creditedTime": null,
"paymentNo": "",
"paymentStatus": 0,
"payUrl": "",
"qrCodeUrl": "",
"payParams": null
},
"msg": ""
}Notes:
rechargeNois the same as the order number and can be used in Get Recharge Status.CREATEDmeans the recharge has not been confirmed yet; onlyCREDITEDmeans the recharge has been credited to the wallet.- Recharge does not support wallet payment or mixed payment;
payCodemust not beWALLET.
