Get Account
This endpoint allows the retrieval of a user account information, including the user’s rewards.
curl https://loyalty.thanxsandbox.com/api/account \
-H "Authorization: Bearer 945148251b603ae34561d90acfe4050e67494d6d1e65d4d3d52798407f03c0bd" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.thanx-v1+json" \
-H "Merchant-Key: cb71e3"
-d '{
"location_id": "a"
}'
{
"id": "wer23gtTT",
"email": "john.smith@example.com.com",
"rewards": [
{
"id": "gheTfR",
"value": 10,
"minimum": 20,
"maximum": 20,
"label": "A free hamburger",
"state": "redeemable",
"type": "amount",
"products": ["234234-23423423", "3458-345345"],
"fine_print": "Reward fine print",
"retire_at": "2020-05-01T20:00:00Z",
"restriction_location_ids": ["a", "b"]
}
],
"points_products": [
{
"id": "9xw6543wh8jmde0",
"points_experience_id": "590485d6f0",
"points": 10,
"value": 10,
"minimum": 20,
"maximum": 20,
"label": "Onion rings",
"state": "redeemable",
"products": ["234234-23423423", "3458-345345"],
"fine_print": "Points product fine print",
"restriction_location_ids": ["a", "b"]
}
],
"progress": {
"percentage": 20,
"towards": "$5 off next purchase"
},
"points": [
{
"points_experience_id": "590485d6f0",
"currency": {
"name": "Star",
"plural": "Stars"
},
"balance": 10.0
}
]
}
Parameters
The location identifier; this is what your system uses to identify a location. Providing this information allows Thanx to return rewards that can be used at this location.
Currently either instore
or online
, defaults to online
. This is used to
adjust which configured product IDs are returned in the applicable reward and
points product entities.
Response
The ID of user
The user’s email
The user’s rewards for the merchant specified in the header. This array can be empty.
The Reward Identifier
The value of the discount, present for ‘amount’ and ‘percent’ types
The minimum spend for this reward, if applicable
The maximum discount possible for this reward, if applicable
The reward description
The state of the reward (redeemable
, unredeemable
)
The type of reward (amount
, percent
, item
)
POS Identifiers for items this discount applies to, if applicable
Any fine print for the reward.
Time the reward will be automatically retired in ISO8601-format if a retire date is set
The list of locations the reward can be redeemed.
The merchant’s configured points product available for online redemption. This array can be empty.
The points product ID
The points experience ID
The amount of points of the given currency this points product costs
The value of the discount, present for ‘amount’ and ‘percent’ types
The minimum spend for the reward this points product can be exchanged for, if applicable.
The maximum discount possible for the reward this points product can be exchanged for, if applicable.
The description of the reward this points product can be exchanged for
The state of the points product (redeemable
, unredeemable
). This will
be redeemable
if the user has enough points for this points product and
unredeemable
if the user does not have enough points for this points
product.
The type of reward (amount
, percent
, item
) that this points product
can be exchanged for.
POS Identifiers for items the discount applies to, if applicable
Any fine print for the reward this points product can be exchanged for.
The list of locations the points product can be redeemed.
Array of information about the configured points experiences and the current user’s balance at each
ID of the points experience. This matches the IDs of the points experiences returned in GET /points_experiences.
The user’s current currency balance of the points experience
curl https://loyalty.thanxsandbox.com/api/account \
-H "Authorization: Bearer 945148251b603ae34561d90acfe4050e67494d6d1e65d4d3d52798407f03c0bd" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.thanx-v1+json" \
-H "Merchant-Key: cb71e3"
-d '{
"location_id": "a"
}'
{
"id": "wer23gtTT",
"email": "john.smith@example.com.com",
"rewards": [
{
"id": "gheTfR",
"value": 10,
"minimum": 20,
"maximum": 20,
"label": "A free hamburger",
"state": "redeemable",
"type": "amount",
"products": ["234234-23423423", "3458-345345"],
"fine_print": "Reward fine print",
"retire_at": "2020-05-01T20:00:00Z",
"restriction_location_ids": ["a", "b"]
}
],
"points_products": [
{
"id": "9xw6543wh8jmde0",
"points_experience_id": "590485d6f0",
"points": 10,
"value": 10,
"minimum": 20,
"maximum": 20,
"label": "Onion rings",
"state": "redeemable",
"products": ["234234-23423423", "3458-345345"],
"fine_print": "Points product fine print",
"restriction_location_ids": ["a", "b"]
}
],
"progress": {
"percentage": 20,
"towards": "$5 off next purchase"
},
"points": [
{
"points_experience_id": "590485d6f0",
"currency": {
"name": "Star",
"plural": "Stars"
},
"balance": 10.0
}
]
}
curl https://loyalty.thanxsandbox.com/api/account \
-H "Authorization: Bearer 945148251b603ae34561d90acfe4050e67494d6d1e65d4d3d52798407f03c0bd" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.thanx-v1+json" \
-H "Merchant-Key: cb71e3"
-d '{
"location_id": "a"
}'
{
"id": "wer23gtTT",
"email": "john.smith@example.com.com",
"rewards": [
{
"id": "gheTfR",
"value": 10,
"minimum": 20,
"maximum": 20,
"label": "A free hamburger",
"state": "redeemable",
"type": "amount",
"products": ["234234-23423423", "3458-345345"],
"fine_print": "Reward fine print",
"retire_at": "2020-05-01T20:00:00Z",
"restriction_location_ids": ["a", "b"]
}
],
"points_products": [
{
"id": "9xw6543wh8jmde0",
"points_experience_id": "590485d6f0",
"points": 10,
"value": 10,
"minimum": 20,
"maximum": 20,
"label": "Onion rings",
"state": "redeemable",
"products": ["234234-23423423", "3458-345345"],
"fine_print": "Points product fine print",
"restriction_location_ids": ["a", "b"]
}
],
"progress": {
"percentage": 20,
"towards": "$5 off next purchase"
},
"points": [
{
"points_experience_id": "590485d6f0",
"currency": {
"name": "Star",
"plural": "Stars"
},
"balance": 10.0
}
]
}