curl https://loyalty.thanxsandbox.com/api/account \
-H "Authorization: Bearer ${token}" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.thanx-v1+json" \
-H "Merchant-Key: ${merchant_key}" \
-G \
--data-urlencode "location_id=${location_id}" \
--data-urlencode "redemption_venue=online" \
--data-urlencode "reward_states[]=delivered" \
--data-urlencode "reward_states[]=active"
{
"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
}
]
}
{
"code": 401,
"message": "There was an error authenticating you."
}
Reference
Get Account
This endpoint allows the retrieval of a user account information, including the user’s rewards.
GET
/
api
/
account
curl https://loyalty.thanxsandbox.com/api/account \
-H "Authorization: Bearer ${token}" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.thanx-v1+json" \
-H "Merchant-Key: ${merchant_key}" \
-G \
--data-urlencode "location_id=${location_id}" \
--data-urlencode "redemption_venue=online" \
--data-urlencode "reward_states[]=delivered" \
--data-urlencode "reward_states[]=active"
{
"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
}
]
}
{
"code": 401,
"message": "There was an error authenticating you."
}
This endpoint returns all of the user’s usable rewards plus affordable points products — no basket filtering. To return only the rewards that would actually produce a discount against a specific basket (e.g. for an offers carousel before checkout), use Qualifying Rewards for a Basket.
Parameters
Thanx Location UID. Providing this information allows Thanx to return rewards
that can be used at this location.If
location_id is omitted or doesn’t match a Thanx location, rewards and
points products restricted to specific locations are not returned.A mapping of Thanx location identifiers can be provided by the Thanx developer
support team or fetched from the following endpoints depending on your integration type:- Consumer API Get Locations endpoint.
- Partner API Get Locations endpoint.
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.Filter rewards by state. Valid values:
delivered, active. Defaults to
delivered if not provided. Multiple states can be specified to return
rewards matching any of the specified states.Response
The user’s rewards for the merchant specified in the header. This array can
be empty.
Show rewards
Show rewards
The value of the discount. For
amount rewards, the dollar amount off
(10.0 = $10 off). For percent rewards, the percentage off (10.0 =
10% off). This field is returned for every reward type, but it does not
describe the discount for item or fixed_price rewards — do not use it
for those types. Use label to describe them.For conditional rewards (e.g. BOGO / “buy X get Y”),
products lists only the
items the reward discounts, not the items required to trigger it, and
there is no field distinguishing conditional from simple rewards. To confirm
eligibility for these, send a checkout basket and read the returned
discount.Reward IDs are not stable references — a reward leaves this list once it is
used, expired, or retired. Pull a fresh
GET /account immediately before
submitting a basket and use the current rewards[].id; a stale ID returns a
not-found error at POST /baskets.The merchant’s configured points product available for online redemption.
This array can be empty.
Show points_products
Show points_products
The value of the discount. For
amount points products, the dollar amount off
(10.0 = $10 off). For percent points products, the percentage off (10.0 =
10% off). This field is returned for every points product type, but it does not
describe the discount for item or fixed_price points products — do not use it
for those types. Use label to describe them.The maximum discount possible for the reward this points product can be
exchanged for, if applicable.
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, fixed_price) that this
points product can be exchanged for.Array of information about the configured points experiences and the current
user’s balance at each
Only present for merchants that have enabled points
Show points
Show points
ID of the points experience. This matches the IDs of the points
experiences returned in
GET /points_experiences.
curl https://loyalty.thanxsandbox.com/api/account \
-H "Authorization: Bearer ${token}" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.thanx-v1+json" \
-H "Merchant-Key: ${merchant_key}" \
-G \
--data-urlencode "location_id=${location_id}" \
--data-urlencode "redemption_venue=online" \
--data-urlencode "reward_states[]=delivered" \
--data-urlencode "reward_states[]=active"
{
"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
}
]
}
{
"code": 401,
"message": "There was an error authenticating you."
}