Program rewards
The rewards the commerce hands out on its own: welcome, birthday and member of the month.
Rewards the commerce hands out on its own when something happens: the welcome one on joining, the birthday one, the member-of-the-month one.
Each one says whether it gives a benefit or points. It exists to show the user what they get beyond redeeming points.
Headers
X-Commerce-IdintegerheaderrequiredId of the commerce integrating the API. Every response is scoped to this commerce.
Response
An array of Automatic reward.
curl https://loybox-public-api-752998171300.southamerica-west1.run.app/v1/me/rewards \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "X-Commerce-Id: 87"// 200 OK
[
{
"event": "welcome",
"reward_type": "benefit",
"benefit": {
"id": "b_4c81",
"type": "free_product",
"description": "Café de regalo",
"cost": 0,
"expiration": null,
"benefit_type": "welcome",
"color": "#f1a10d",
"buy_limit": 1,
"prize": null,
"tiendanube_coupon": null
},
"points": null
},
{
"event": "birthday",
"reward_type": "points",
"benefit": null,
"points": 200
}
]The three events
event | When it is handed out |
|---|---|
welcome | On joining the program |
birthday | On the member's birthday |
monthly_top | To the member who bought the most in the month |
The reward_type says where to look: if it is benefit, the reward is in
benefit; if it is points, it is in points. The other field comes back null.
It is a list of what the program offers
It returns the rewards the commerce configured, not the ones the user already
received. For that there is
my history, where point rewards show up as
points_special_reward items.
Errors
| Code | When |
|---|---|
401 | The access token is missing, expired, or does not belong to an end user. |
404 | The commerce does not exist. |
422 | The X-Commerce-Id header is missing. |