Get points account balance
Description
Returns the current points account balance of a loyalty program member: the total number of points and the number of active points for the selected points currency.
Request URL
Method: POST
https://example.com/api/v1.1/loyalty/account/balance
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| token | string | "abc123def456" | Yes | API token |
| loyalty_program_id | int | 123 | Yes | Loyalty program ID |
| points_currency_iid | int | 1 | No | Internal points currency ID |
| points_currency_eid | string | "starts" | No | External points currency ID (for example, "starts") |
| matching | string | "email" | Yes | Profile lookup method: email, phone, profile_id, custom |
| field_name | string | "user_id" | Yes, if matching = custom | Custom field name for lookup |
| field_value | string / int | 123456 | Yes, if matching = custom | Custom field value |
| string | "user@example.com" | Yes, if matching = email | Member email | |
| phone | string | "+1234567890" | Yes, if matching = phone | Member phone number in international format |
| profile_id | string | "profile123" | Yes, if matching = profile_id | Profile ID |
Request example
- JSON
- XML
{
"token": "abc123def456",
"loyalty_program_id": 123,
"points_currency_eid": "starts",
"matching": "email",
"email": "user@example.com"
}
<xml>
<token>abc123def456</token>
<loyalty_program_id>123</loyalty_program_id>
<points_currency_eid>starts</points_currency_eid>
<matching>email</matching>
<email>user@example.com</email>
</xml>
Response example
- JSON
- XML
{
"error": 0,
"error_text": "Successful operation",
"data": {
"total_balance": "1000.00",
"active_balance": "800.50"
}
}
<xml>
<error>0</error>
<error_text>Successful operation</error_text>
<data>
<total_balance>1000.00</total_balance>
<active_balance>800.50</active_balance>
</data>
</xml>
Response parameters
| Parameter | Type | Description |
|---|---|---|
| error | int | Error code |
| error_text | string | Error text |
| total_balance | string | Total number of points in the points account (string format) |
| active_balance | string | Number of active points in the points account (string format) |