Create Redemption Using Banked Currency (Redemptions 1.0)

​

Creates a redemption using a currency amount. The amount is deducted from a user's available banked currency.

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

  • Set this header to application/json.

  • Preferred language

  • Advertises which content types the client is able to understand

  • 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.

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

Body

application/json
  • OAuth client ID provided by the business

  • The amount of banked currency with which a redemption code has to be created

  • Accuracy of a user's device GPS

  • Latitude coordinate of the redemption location

  • Location ID at which the redemption code is generated. If no location ID is provided, then it returns the ID of the default location.

  • Longitude coordinate of the redemption location

Responses

  • application/json
Request Example for post/api2/mobile/redemptions/banked_currency
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/redemptions/banked_currency \
  --request POST \
  --header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
  --header 'x-pch-digest: {{$$.env.signature}}' \
  --header 'Content-Type: application/json' \
  --header 'Accept-Language: en' \
  --header 'Accept: application/json' \
  --header 'punchh-app-device-id: APP_DEVICE_ID_GOES_HERE' \
  --header 'User-Agent: AppIdentifier/VersionNumber/BuildNumber(OS_Type)' \
  --data '{
  "client": "CLIENT_GOES_HERE",
  "banked_currency": 10,
  "location_id": 304155,
  "latitude": "26.9167509",
  "longitude": "75.8136926",
  "gps_accuracy": 27
}'
{
  "redemption_status": "redeemable",
  "created_at": "2016-05-25T06:41:37-04:00",
  "redeemable_id": null,
  "location_id": 304361,
  "redemption_image_url": "IMAGE_URL_GOES_HERE",
  "redemption_message": "Message associated with the redemption.",
  "updated_at": "2016-05-25T06:41:37-04:00",
  "redeemable_description": "",
  "redemption_id": 1822896,
  "redemption_tracking_code": "7246338",
  "expiring_at": "2016-05-25T08:41:37-04:00",
  "redeemable_name": null,
  "campaign_name": "Mass Campaign Offer",
  "redeemed_value": "10"
}