Program rewards

The rewards the commerce hands out on its own: welcome, birthday and member of the month.

GET/v1/me/rewardsEnd-user token

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-Idintegerheaderrequired

Id 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

eventWhen it is handed out
welcomeOn joining the program
birthdayOn the member's birthday
monthly_topTo 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

CodeWhen
401The access token is missing, expired, or does not belong to an end user.
404The commerce does not exist.
422The X-Commerce-Id header is missing.