Create Redemption Using Redeemable (Redemptions 1.0)

Creates a redemption for a redeemable based on a user's available loyalty points

Headers
  • x-pch-digest
    Type: string
    required

    The signature for the API call

  • Authorization
    Type: string
    required

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

  • 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

  • Accept-Language
    Type: string

    Preferred language

  • User-Agent
    Type: string
    required

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

  • punchh-app-device-id
    Type: string
    required

    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.

Body
application/json
  • client
    Type: string
    required

    OAuth client ID provided by the business

  • gps_accuracy
    Type: integer

    Accuracy of a user's device GPS

  • latitude
    Type: string

    Latitude coordinate of the redemption location. Must be provided if location_id is not passed as a parameter.

  • location_id
    Type: integer

    Location ID at which a user wants to do the redemption. If a particular location ID is provided in the request, the redemption will be valid only at that location and will not be possible at any other.

  • longitude
    Type: string

    Longitude coordinate of the redemption location. Must be provided if location_id is not passed as a parameter.

  • reedemable_id
    Type: number Format: double

    ID of the redeemable used to create a redemption code

Responses
  • application/json
  • 400
Request Example for post/api2/mobile/redemptions/redeemable
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/redemptions/redeemable \
  --request POST \
  --header 'x-pch-digest: {{$$.env.signature}}' \
  --header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'User-Agent: AppIdentifier/VersionNumber/BuildNumber(OS_Type)' \
  --header 'punchh-app-device-id: APP_DEVICE_ID_GOES_HERE' \
  --data '{
  "client": "CLIENT_GOES_HERE",
  "redeemable_id": 1102,
  "location_id": "304155",
  "latitude": 26.9167509,
  "longitude": 75.8136926,
  "gps_accuracy": 27
}'
{
  "redemption_status": "redeemable",
  "created_at": "2016-05-25T06:50:02-05:00",
  "redeemable_id": 41,
  "location_id": 304361,
  "redemption_image_url": "IMAGE_URL_GOES_HERE",
  "redemption_message": "Redeem your free Sandwich, with purchase of chips and drink",
  "updated_at": "2016-05-25T06:50:02-05:00",
  "redeemable_description": "",
  "redemption_id": 1818919,
  "redemption_tracking_code": "8723640",
  "expiring_at": "2016-05-25T08:50:02-05:00",
  "redeemable_name": "The Sandwich",
  "campaign_name": "Mass Campaign Offer",
  "redeemed_value": "0"
}