Fetch Redemption Code (Redemptions 1.0)

This endpoint generates an internal tracking code, which can be used to look up a user on the POS system and redeem the selected reward or banked currency at the POS. To generate an internal tracking code via this endpoint, you must supply either a reward ID in the reward_id parameter or a value for the banked currency to redeem in the redeemed_points parameter. While the internal tracking code is active, the selected reward or banked currency value is eligible for redemption at the POS using the value of the internal tracking code as the redemption_code in the POS Redemption API endpoint.

User authentication required

This API requires authentication_token to be supplied as HTTP_AUTHORIZATION header or in the authentication_token parameter.

Headers
  • x-pch-digest
    Type: string
    required

    The signature for the API call

  • Content-Type
    Type: string
    required

    Set this header to application/json.

  • Accept
    Type: string
    required

    Advertises which content types the client is able to understand

  • User-Agent
    Type: string
    required

    For details, see User Agent.

  • Authorization
    Type: string
    required

    You may pass the access_token instead of the authentication_token in Online Ordering endpoints to authorize the request. It must be supplied as Bearer ACCESS_TOKEN_GOES_HERE.

Body
application/json
  • client
    Type: string
    required

    Client key of the business

  • redeemed_points
    Type: number Format: double
    required

    Value of banked currency to redeem. Use this field only if you have a Points Convert to Currency program type and you are trying to redeem banked currency. Otherwise, use the reward_id field only.

  • reward_id
    Type: integer Format: int64
    required

    Reward ID (required if redeemed_points is not provided)

  • authentication_token
    Type: string

    The authentication token of the user. You can retrieve this from the response of a successful sign-in API call or through the SSO process.

  • gps_accuracy
    Type: integer

    GPS accuracy

  • latitude
    Type: string

    Latitude of the redemption location

  • locale
    Type: string

    Locale used for language

  • location_id
    Type: integer Format: int32

    Location ID of the redemption

  • longitude
    Type: string

    Longitude of the redemption location

  • store_number
    Type: string

    Store number of the location. This can be used as an alternative to specify the location if location_id/latitute/longitude are not provided.

Responses
  • application/json
  • 401

    Sending invalid credentials

  • 412

    Sending invalid Signature

  • 422

    Sending invalid Entity

Request Example for post/api/auth/redemptions
curl https://SERVER_NAME_GOES_HERE.punchh.com/api/auth/redemptions \
  --request POST \
  --header 'x-pch-digest: SIGNATURE_GOES_HERE' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'User-Agent: Punchh/OnlineOrder/1.0/Web/BrowserVersion/OS_Type' \
  --header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
  --data '{
  "authentication_token": "AUTHENTICATION_TOKEN_GOES_HERE",
  "client": "CLIENT_GOES_HERE",
  "location_id": 304155,
  "locale": "",
  "longitude": "75.8136926",
  "latitude": "26.9167509",
  "redeemed_points": null,
  "reward_id": 12345,
  "gps_accuracy": 27,
  "store_number": "12"
}'
{
  "internal_tracking_code": "2142353",
  "expiry_hours": "24"
}