Fetch Rolling Points Expiry

​

Enables a business to display the number of points that are expiring each month for users in the mobile app. The API returns all future dates on which points are scheduled to expire.

Prerequisite

To make API calls, the backend flag "track_reward_banked_points" and the "Expires After" (unredeemed point expiry) option in the Punchh platform must be enabled for the business. If one or both are disabled in Punchh for your business, the API will return an error with this message: "Your current loyalty program configuration does not support this feature. Please connect with your Customer Success representative for resolution of the issue."

Note: This API is currently supported for "points convert to rewards" and "points unlock redeemables" loyalty programs.

The status and lookback_period parameters are applicable to only the "points unlock redeemables" program. Currently, status supports a value of "expired", and lookback_period supports a value of "30" days. Businesses can use the parameters to fetch all check-ins / related points for users that have expired in the last 30 days.

Headers

  • Used to authorize the request with access_token. It should be supplied as Bearer ACCESS_TOKEN_GOES_HERE.

  • The signature for the API call

  • Used to identify the software, device, and application initiating the request, providing information about the client to the server. For details, see User Agent.

  • The app device ID helps Punchh identify each device so that certain rewards can be awarded individually to each device instead of per user. For example, the sign-up reward is given to each device ID to prevent fraudulent sign-ups so that a user cannot do repeated sign-ups from a single device to get rewards. It should not change even if the user resets a device. See the sample code to generate the punchh-app-device-id header.

  • Preferred language

Body

application/json
  • OAuth client ID provided by the business

  • Past duration, in days, for which the API returns the expired points for the user. The value supported for this parameter is 30.

  • Filter for check-in status. The value supported for this parameter is "expired".

Responses

  • application/json
  • application/json
Request Example for get/api2/mobile/users/points_expiry_timeline
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/users/points_expiry_timeline \
  --header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
  --header 'x-pch-digest: {{$$.env.signature}}' \
  --header 'User-Agent: AppName/AppVersion/BuildNumber (OS; Model; MANUFACTURER; MODEL; OS Version)' \
  --header 'punchh-app-device-id: APP_DEVICE_ID_GOES_HERE' \
  --header 'Accept-Language: en' \
  --header 'Content-Type: application/json' \
  --data '{
  "client": "CLIENT_GOES_HERE"
}'
{
  "points_expiry": [
    {
      "expiring_points": 1305,
      "expiring_at": "2024-05-11"
    },
    {
      "expiring_points": 1102,
      "expiring_at": "2024-09-27"
    },
    {
      "expiring_points": 403,
      "expiring_at": "2025-03-12"
    }
  ]
}