跳到主要内容

Referral Logs

Paginated query of the current user's referral operation history.

GET /v1/referral/logs
Authorization: Bearer <token>

Query Parameters​

ParameterTypeDefaultDescription
pageint1Page number; values below 1 are clamped to 1
page_sizeint20Items per page; clamped to the range 1–100

There is no action filter — all of the user's log entries are returned, newest first. Unknown query parameters are ignored; a non-integer page/page_size returns 400.

Action Values​

Valuetarget_addressreferral_codeamountDescription
create_codenullthe new codenullCreated a referral code
bindreferrer's addressthe code boundnullBound to a referral code
unbindprevious referrer's addressthe code unboundnullUnbound from a referral code
commission_accruednullnullcommission (USDT)Commission credited to the referrer's pending balance for a referee fill
claimnullnullclaimed amount (USDT)Claimed off-chain earnings

There is no rebind action (rebinding is not supported).

Response​

{
"logs": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"action": "create_code",
"target_address": null,
"referral_code": "4DDDC2D4",
"amount": null,
"old_value": null,
"new_value": null,
"created_at": 1772010604000
},
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"action": "bind",
"target_address": "0xabc...",
"referral_code": "4DDDC2D4",
"amount": null,
"old_value": null,
"new_value": null,
"created_at": 1772020000000
},
{
"id": "550e8400-e29b-41d4-a716-446655440002",
"action": "claim",
"target_address": null,
"referral_code": null,
"amount": "45.00",
"old_value": null,
"new_value": null,
"created_at": 1772100000000
}
],
"total": 3,
"page": 1,
"page_size": 20
}

Response Fields​

FieldTypeDescription
logsarrayList of log entries
logs[].idstringUnique log ID (UUID)
logs[].actionstringAction type
logs[].target_addressstring | nullRelated address (the referrer's address for bind/unbind)
logs[].referral_codestring | nullRelated referral code
logs[].amountstring | nullAmount involved (USDT, decimal string rounded to 2 dp) — set for claim and commission_accrued
logs[].old_valuenullReserved; always null currently
logs[].new_valuenullReserved; always null currently
logs[].created_atint64Timestamp (milliseconds)
totalint64Total number of matching records
pageintCurrent page number
page_sizeintItems per page (after clamping)

Error Codes​

Error format. Referral endpoints return errors as a plain-text body (text/plain) containing the message shown in the Message column, not a JSON object. A missing or invalid Authorization: Bearer session token returns 401 with missing bearer token / invalid session.

HTTPMessageDescription
400(query rejection text)page or page_size is not an integer
401missing bearer token / invalid sessionMissing, expired or revoked session token
500(database error text)Server error

Code Examples​

Python​

import requests

BASE_URL = "https://api.rocky.exchange"
JWT_TOKEN = "your_jwt_token"

# Query referral logs with pagination
resp = requests.get(
f"{BASE_URL}/v1/referral/logs",
headers={"Authorization": f"Bearer {JWT_TOKEN}"},
params={"page": 1, "page_size": 20},
)
data = resp.json()

print(f"Total: {data['total']} (Page {data['page']}/{(data['total'] - 1) // data['page_size'] + 1})")
for log in data["logs"]:
print(f" [{log['action']}] code={log['referral_code']} addr={log['target_address']} at={log['created_at']}")