Managing Redemptions for Program Memberships

Redemptions signify when a specific reward was redeemed

How Redemptions Work in Hang

When a reward is redeemed, a redemption is created in Hang. A redemption signifies that a user has redeemed a specific reward.

Retrieve Redemption History for a Program Membership

Retrieving redemption history for a program membership requires making a GET request to the /v2/program-memberships/:program_membership_id/redemptions endpoint.

Request Parameters

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

Example Request

curl -X GET 'https://loyalty.hang.xyz/partner-api/v2/program-memberships/12345/redemptions' \
  -H 'X-API-Key: YOUR_API_KEY'

Response

If successful, the API will return a 200 OK status along with a JSON object containing information about all the redemptions for the program membership.

Example Response

{
  "redemptions": [
    {
      "date": 1631070390,
      "description": "10% off coupon",
      "code": "ABC123",
      "type": 
    },
    // More redemptions
  ]
}

Generate a Redemption Code for a Reward

You can generate a redemption code for a given reward linked to a specific program membership by making a POST request to the following endpoint /v2/program-memberships/:program_membership_id/redemptions

Request Parameters

  • program_membership_id (required): The program membership ID.

  • reward_id (required): The UUID of the reward to be redeemed.

Example Request

curl -X POST 'https://api.yourdomain.com/v2/program-memberships/12345/redemptions' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d 'reward_id=reward_789'

Response

If successful, the API will return a 200 OK status along with a JSON object containing the generated redemption.

Example Response

{
  "redemption": {
    "uuid": "xyz789",
    "code": "ABC456",
    "promo_code": "PROMO_123",
    "state": "active",
    "expires_at": 1634070390
  }
}

Last updated