Get profile tier in a loyalty program
Description
Retrieves the current tier of a loyalty program member within the requested tiers group.
Request URL
Method: POST
https://example.com/api/v1.1/loyalty/account/tiers
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| loyalty_program_id | int | 123 | Yes | Loyalty program ID |
| tiers_group_id | int | 10 | Yes | Tiers group ID (for example, 10) |
| matching | string | "email" | Yes | Profile lookup method. Possible values: "email", "phone", "profile_id", "custom" |
| field_name | string | "user_id" | Yes, if matching = custom | Custom field name used for lookup |
| field_value | string / int | 123456 | Yes, if matching = custom | Custom field value |
| string | "user@example.com" | Yes, if matching = email | Email used to find the profile | |
| phone | string | "+1234567890" | Yes, if matching = phone | Phone number in international format |
| profile_id | string | "profile123" | Yes, if matching = profile_id | Profile ID |
| token | string | "abc123def456" | Yes | API token for authorization |
Request example
- JSON
- XML
{
"loyalty_program_id": 123,
"tiers_group_id": 10,
"matching": "email",
"email": "user@example.com",
"phone": "+1234567890",
"profile_id": "profile123",
"token": "abc123def456"
}
<xml>
<loyalty_program_id>123</loyalty_program_id>
<tiers_group_id>10</tiers_group_id>
<matching>email</matching>
<email>user@example.com</email>
<phone>+1234567890</phone>
<profile_id>profile123</profile_id>
<token>abc123def456</token>
</xml>
Response example
- JSON
- XML
{
"error": 0,
"error_text": "Successful operation",
"data": [
{
"tiers_group_type": "cumulative",
"tier_eid": "silver1-2",
"tier_id": 13,
"tier_order": 1,
"reached_at": "2024-06-15T09:12:34Z"
},
{
"tiers_group_type": "cumulative",
"tier_eid": "gold1-3",
"tier_id": 14,
"tier_order": 2,
"reached_at": "2024-09-01T12:34:56Z"
}
]
}
<xml>
<data>
<tiers_group_type>cumulative</tiers_group_type>
<tier_eid>silver1-2</tier_eid>
<tier_id>13</tier_id>
<tier_order>1</tier_order>
<reached_at>2024-06-15T09:12:34Z</reached_at>
</data>
<data>
<tiers_group_type>cumulative</tiers_group_type>
<tier_eid>gold1-3</tier_eid>
<tier_id>14</tier_id>
<tier_order>2</tier_order>
<reached_at>2024-09-01T12:34:56Z</reached_at>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
| Parameter | Type | Description |
|---|---|---|
| error | int | Error code |
| error_text | string | Error text |
| tiers_group_type | string | Tiers group type |
| tier_eid | string | External tier ID |
| tier_id | int | Tier ID |
| tier_order | int | Tier order number (starting from 0) |
| reached_at | string | Tier reached date in RFC3339 format |