Query Rebate Records
1. Query Rebate Records (Reconciliation Statement)
Interface Path
- Get
- /api/promo/rebate/bill
Description
- The query interface uses a pagination mode. For example, if there are 350 records in the given time range, set 100 records per page
- For the first page, set the start parameter to 0 and the count parameter to 100
- For the second page, set start += 100 to 100, and count to 100
- And so on
- Time filtering is based on dispatch time (create_time). It is recommended to pull data in hourly or daily segments
Interface Frequency Description
- The query rebate records API can be called at most once every 10 seconds
Request Parameters
| Parameter | Name | Type | Required | Description |
|---|---|---|---|---|
| agent_id | Merchant ID | string | Required | Merchant ID |
| time_start | Dispatch Time Start (inclusive) | string | Optional | In milliseconds. If not provided, no lower bound is applied |
| time_end | Dispatch Time End (inclusive) | string | Optional | In milliseconds. If not provided, no upper bound is applied |
| activity_id | Activity ID | string | Optional | Exact match. If not provided, all rebate activities are queried |
| user_id | User ID | string | Optional | Exact match. If not provided, all users are queried |
| status | Status Filter | string | Optional | Not provided - all, "0" - failed, "1" - success |
| start | Pagination Start Index | int | Required | Default 0 |
| count | Records Per Page | int | Required | Default 100, minimum 1, maximum 3000 |
| timestamp | Current Timestamp | string | Required | Timestamp when calling the interface (in milliseconds, valid for ten minutes) |
| sign | Signature | string | Required | Signature algorithm details in the interface description |
Response Parameters
| Parameter | Name | Type | Description |
|---|---|---|---|
| code | Response Code | int | Error Code |
| message | Response Message | string | Error Message |
| data | Response Data | dict | Response Data Details |
| --start | Start Index | int | Pagination start index of this request |
| --page_size | Records Per Page | int | Records per page of this request |
| --total | Total Records | int | Total records matching the query |
| --list | Rebate Record List | List | Rebate Record List |
| ----id | Record ID | string | Unique rebate record ID |
| ----activity_id | Activity ID | string | ID of the associated rebate activity |
| ----user_id | User ID | string | User ID |
| ----date | Settlement Date | int | UTC millisecond timestamp of 00:00:00 on the settlement date. Convert to local timezone as needed |
| ----currency | Currency | string | Currency |
| ----turnover | Valid Turnover | string | Valid turnover amount that triggered this rebate |
| ----rate | Rebate Rate | string | Matched rebate rate, float string in % (e.g. "1.5" means 1.5%) |
| ----rebate_amount | Rebate Amount | string | Actual rebate amount issued |
| ----wallet_txn_id | Wallet Transaction ID | string | Wallet transaction ID for reconciliation. Not returned when status = 0 |
| ----status | Status | int | 0 - Failed, 1 - Success |
| ----create_time | Dispatch Time | int | Rebate dispatch time, in milliseconds |
| ----txn_ids | Associated Bet ID List | Array | List of bet record IDs that triggered this rebate |
Request Example
curl --location 'https://staging.aig1234.com/api/promo/rebate/bill?agent_id=agent001&time_start=1742256000000&time_end=1742342399000&status=1&start=0&count=100×tamp=1742300000000&sign=a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4'
Response Example
{
"code": 200,
"message": "success",
"data": {
"start": 0,
"page_size": 100,
"total": 2,
"list": [
{
"id": "67d1a2b3c4e5f6789abcdef0",
"activity_id": "67c0a1b2c3d4e5f678901234",
"user_id": "user888",
"date": 1742256000000,
"currency": "CNY",
"turnover": "5800.00",
"rate": "1",
"rebate_amount": "58.00",
"wallet_txn_id": "68a3c4d5e6f7890abcdef123",
"status": 1,
"create_time": 1742300123456,
"txn_ids": [
"67f1a2b3c4e5f6789abc0001",
"67f1a2b3c4e5f6789abc0002"
]
},
{
"id": "67d1a2b3c4e5f6789abcdef1",
"activity_id": "67c0a1b2c3d4e5f678901234",
"user_id": "user999",
"date": 1742256000000,
"currency": "CNY",
"turnover": "12000.00",
"rate": "2",
"rebate_amount": "240.00",
"wallet_txn_id": "68a3c4d5e6f7890abcdef456",
"status": 1,
"create_time": 1742300456789,
"txn_ids": [
"67f1a2b3c4e5f6789abc0010"
]
}
]
}
}
Error Codes
200 Success
408000 Request Parameter Error
408003 Whitelist Restriction
600100 Invalid Signature
600101 Invalid Parameter
700101 Merchant Does Not Exist