Herald
OpenapiExt

Get_balance_ext

GET
/api/ext/points/{realmId}/balance

Authorization

api_key
headerX-API-Key<token>

Client-app API key (third-party external API).

Path Parameters

realmId*string

Realm ID

Query Parameters

userId?string

User ID (optional)

Response Body

Balance retrieved successfully

application/json
  1. response

Balance response (SDK-compatible)

balance*integer
Formatint64
currency*string
expiresAt?|

Earliest upcoming pool expiry (RFC3339) within this balance's scope (all buckets, or the client app's covered buckets for a bound key) — MIN(points_credit_ledger.expires_at) over the same predicate as the typed balances. null ⟺ no expiring pool balance. PRD points.md §4.1 「用户可查看即将过期的池子类型积分」; mirrors the api-points wallet surfaces and the grant write response's expiresAt.

freePeriodicBalance*integer
Formatint64
grantedBalance*integer
Formatint64
registrationBalance*integer
Formatint64
subscriptionBalance*integer
Formatint64
topupBalance*integer
Formatint64
totalConsumed*integer
Formatint64
totalPaidGranted*integer

Total points granted through paid topups and subscription entitlements.

Formatint64
totalRecharged*integer

Deprecated compatibility alias for total_paid_granted.

Formatint64
unit*string
updatedAt*string
userId*string
Example Request
curl -X GET 'https://example.com/api/ext/points/string/balance'
Example Response
{
  "balance": 0,
  "currency": "string",
  "expiresAt": "string",
  "freePeriodicBalance": 0,
  "grantedBalance": 0,
  "registrationBalance": 0,
  "subscriptionBalance": 0,
  "topupBalance": 0,
  "totalConsumed": 0,
  "totalPaidGranted": 0,
  "totalRecharged": 0,
  "unit": "string",
  "updatedAt": "string",
  "userId": "string"
}