v1

latestOpenAPI 3.0.0Apache 2.02026-07-143281,4552.1 MB
Loyalty

CreateLoyaltyReward

Creates a loyalty reward. In the process, the endpoint does following:

  • Uses the reward_tier_id in the request to determine the number of points to lock for this reward.
  • If the request includes order_id, it adds the reward and related discount to the order.

After a reward is created, the points are locked and not available for the buyer to redeem another reward.

post/v2/loyalty/rewards

Request body

idempotency_keystring required

A unique string that identifies this CreateLoyaltyReward request. Keys can be any valid string, but must be unique for every request.

Example request

{
  "idempotency_key": "18c2e5ea-a620-4b1f-ad60-7b167285e451",
  "reward": {
    "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
    "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY",
    "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f"
  }
}

Response

Success

Example response

{
  "reward": {
    "created_at": "2020-05-01T21:49:54Z",
    "id": "a8f43ebe-2ad6-3001-bdd5-7d7c2da08943",
    "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
    "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY",
    "points": 10,
    "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f",
    "status": "ISSUED",
    "updated_at": "2020-05-01T21:49:54Z"
  }
}