Gateway URL
Common Response
When successful, `code` is 0. When failed, a non-zero business code is used and error information is returned
| Field | Type | Description |
|---|---|---|
| code | number | Business status code, 0 means success |
| message | string | Response message |
| data | object | API business data, may be empty on failure |
{
"code": 0,
"message": "ok",
"data": {}
}
API Authentication
All APIs require X-App-Id and X-Sign request headers
The signature source is app_id and app_secret concatenated directly, then calculated with sha256
Creating an order only generates a pending order, does not deduct agent balance, and does not return wallet fields
Agent balance is deducted and cloud recharge is executed only when paying the order
Repeated payment for a successful order returns: Order has been recharged successfully, please do not confirm repeatedly
If agent balance is insufficient when paying the order, no deduction is made and cloud recharge is not executed
When cloud recharge fails, it returns: Cloud recharge failed, agent balance has been deducted, please contact backend support
Orders that are not successful but have been deducted can be manually refunded by the backend
1. Call POST /api/uid to query account and balance
2. Call POST /api/orders to create an agent order
3. After confirming downstream payment receipt, the agent calls POST /api/orders/{sn}/pay
4. Call GET /api/orders/{sn} to query cloud recharge status
| HTTP Status | Business Code | message |
|---|---|---|
| 401 | 401 | Agent authentication failed |
| 403 | 403 | IP is not in the whitelist |
| 422 | 422 | channel, uid, and money cannot be empty |
| 422 | 422 | channel can only be qcloud or aliyun |
| 422 | 422 | Invalid amount format |
| 422 | 422 | Amount cannot be less than 1 |
| 402 | 402 | Insufficient agent balance |
| 404 | 404 | Account does not exist |
| 404 | 404 | Order does not exist |
| 409 | 409 | Order has been recharged successfully, please do not confirm repeatedly |
| 409 | 409 | Order has been refunded and cannot be paid |
| 409 | 409 | Order is processing, please do not pay repeatedly |
| 409 | 409 | Order recharge failed, please contact backend support |
| 500 | 500 | Cloud recharge failed, agent balance has been deducted, please contact backend support |
Account Lookup and Balance
Tencent Cloud uses UID lookup. Alibaba Cloud supports UID or email. The API requires agent authentication request headers
| Field | Type | Required | Description |
|---|---|---|---|
| channel | string | Yes | Select channel, values: qcloud (Tencent Cloud), aliyun (Alibaba Cloud) |
| uid | string | Yes | Account identifier; Tencent Cloud uses UID, Alibaba Cloud uses UID or email |
| Field | Type | Description |
|---|---|---|
| channel | string | Actual recharge channel, values: qcloud (Tencent Cloud), aliyun (Alibaba Cloud), kelly_qcloud (Kelly Tencent Cloud channel), kelly_aliyun (Kelly Alibaba Cloud channel) |
| uid | string | Cloud account UID |
| balance | number|string | Current account balance |
| currency | string | Balance currency, fixed as USD |
| rate | number|string | Recharge exchange rate, used to calculate received amount |
| payment_method | string | Payment method, fixed as USDT_TRC20 |
Request
{
"channel": "qcloud",
"uid": "200000000000"
}
Response
{
"code": 0,
"message": "ok",
"data": {
"channel": "qcloud",
"uid": "200000000000",
"balance": "100.00",
"currency": "USD",
"rate": "1.00",
"payment_method": "USDT_TRC20"
}
}
Create Order
Create an agent recharge order, only generating a pending order without deducting agent balance
| Field | Type | Required | Description |
|---|---|---|---|
| channel | string | Yes | Select channel, values: qcloud (Tencent Cloud), aliyun (Alibaba Cloud) |
| uid | string | Yes | Cloud account UID |
| money | number|string | Yes | Recharge amount, must be greater than or equal to 1, with at most 2 decimal places |
| Field | Type | Description |
|---|---|---|
| sn | string | Order number |
| channel | string | Actual recharge channel, values: qcloud, aliyun, kelly_qcloud, kelly_aliyun |
| uid | string | Cloud account UID |
| money | number|string | Recharge amount submitted by the user |
| recharge_amount | number|string | Agent balance deduction amount when paying the order, calculated by dividing recharge amount by exchange rate |
| status | string | Order status, values: pending (pending payment), paid (recharged) |
| created_at | string|null | Order creation time |
| paid_at | string|null | Cloud recharge success time, null when not successful |
Request
{
"channel": "qcloud",
"uid": "200000000000",
"money": "100"
}
Response
{
"code": 0,
"message": "ok",
"data": {
"sn": "ba202606161234567890",
"channel": "qcloud",
"uid": "200000000000",
"money": "100",
"recharge_amount": "100.00",
"status": "pending",
"created_at": "2026-06-16 12:00:00",
"paid_at": null
}
}
Pay Order
After confirming downstream payment receipt, the agent calls this API, and the system executes cloud recharge and updates order status
| Field | Type | Required | Description |
|---|---|---|---|
| sn | string | Yes | Path parameter, order number |
| Field | Type | Description |
|---|---|---|
| sn | string | Order number |
| channel | string | Actual recharge channel, values: qcloud, aliyun, kelly_qcloud, kelly_aliyun |
| uid | string | Cloud account UID |
| money | number|string | Recharge amount submitted by the user |
| recharge_amount | number|string | Agent balance deduction amount when paying the order, calculated by dividing recharge amount by exchange rate |
| status | string | Returns paid status when cloud recharge succeeds |
| created_at | string|null | Order creation time |
| paid_at | string|null | Cloud recharge success time |
Response
{
"code": 0,
"message": "ok",
"data": {
"sn": "ba202606161234567890",
"channel": "qcloud",
"uid": "200000000000",
"money": "100",
"recharge_amount": "100.00",
"status": "paid",
"created_at": "2026-06-16 12:00:00",
"paid_at": "2026-06-16 12:05:00"
}
}
Order Details
Query agent order status, recharge amount, deduction amount, and received time by order number
| Field | Type | Required | Description |
|---|---|---|---|
| sn | string | Yes | Path parameter, order number |
| Field | Type | Description |
|---|---|---|
| sn | string | Order number |
| channel | string | Actual recharge channel, values: qcloud, aliyun, kelly_qcloud, kelly_aliyun |
| uid | string | Cloud account UID |
| money | number|string | Recharge amount submitted by the user |
| recharge_amount | number|string | Agent balance deduction amount when paying the order, calculated by dividing recharge amount by exchange rate |
| status | string | Order status, values: pending (pending payment), paid (recharged) |
| created_at | string|null | Order creation time |
| paid_at | string|null | Cloud recharge success time, null when not successful |
Response
{
"code": 0,
"message": "ok",
"data": {
"sn": "ba202606161234567890",
"channel": "qcloud",
"uid": "200000000000",
"money": "100",
"recharge_amount": "100.00",
"status": "pending",
"created_at": "2026-06-16 12:00:00",
"paid_at": null
}
}