Retrieving Rewards for Program Memberships

You can retrieve all of the rewards for a specific program membership by making a GET request to the /v2/program-memberships/:program_membership_id/rewards endpoint.

Request Parameters

  • program_membership_id (required): The ID of the program membership for which to retrieve the rewards.

Example Request

curl -X GET 'https://loyalty.hang.xyz/partner-api/v2/program-memberships/12345/rewards' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'

Response

If successful, the API will return a 200 OK status along with a JSON object containing an array of rewards associated with the specified program membership.

Example Response

{
  "rewards": [
    {
      "uuid": "reward-uuid-123",
      "name": "10% Discount",
      "priority": 1,
      "description": "Enjoy 10% off some item",
      "redemption_instruction": "Use this code at checkout",
      "redemption_method": "code",
      "redemption_count": 10,
      "interval": 30,
      "limit": 100,
      "start_date": 1633046400,
      "end_date": 1635648400,
      "reward_type": "discount_percent_based",
      "reward_value": 10,
      "maximum_discount_value": 15.25,
      "last_redeemed_at": 1633050000,
      "image_url": "https://yourdomain.com/images/reward.jpg",
      "video_url": "https://yourdomain.com/images/reward.mp4",
      "terms_and_conditions": "Cannot be combined with other rewards. Only valid ...",
      "achievement_id": 1,
      "can_be_combined_with_other_rewards": false,
      "applicable_menu_item_multi_location_ids": ["guid", "guid"],
      "applicable_menu_group_multi_location_ids": ["guid", "guid"],
      "minimum_quantity": 1,
      "metadata": { internal_info: "anything" }
    },
    // More rewards
  ]
}

Reward Properties

Each reward in the returned list will have the following properties:

  • uuid: Unique identifier of the reward

  • name: The name of the reward

  • redemption_instruction: Instructions on how to redeem the reward

  • redemption_method: Method to use for redeeming the reward (e.g., 'code', 'store_link')

  • redemption_count: Number of times this reward has been redeemed

  • interval: How often the reward can be redeemed, in days. A value of 0 indicates no limit

  • limit: Maximum number of redemptions, if applicable

  • start_date: Epoch time indicating when the reward becomes available for redemption

  • end_date: Epoch time indicating the expiration date of the reward

  • reward_type: The type of the reward (e.g., 'redemption', 'discount_percent_based')

  • last_redeemed_at: Epoch time indicating the last time the reward was redeemed

  • image_url: URL of the reward's image

  • achievement_id: ID of the achievement related to the reward

  • can_be_combined_with_other_rewards: Whether this reward can be combined with other rewards

  • applicable_menu_item_multi_location_ids: A list of all the items multi location IDs a reward applies to (used for toast merchants)

  • applicable_menu_group_multi_location_ids: A list of all the groups multi location IDs a reward applies to (used for toast merchants)

  • minimum_quantity: Integer used for the minimum number of the item/group required for a reward to be applied.

  • metadata: Open JSON field for any metadata you want to add to the reward

Last updated