Generate a Redemption Code for Subscription Redemption

This API generates a subscription-related redemption code within the mobile application. Using this API, guests can generate the subscription-related redemption code from the mobile application and use it at the POS or in the online ordering app to redeem subscription-related benefits.

Headers
  • Accept
    Type: string
    required

    Advertises which content types the client can understand

  • Content-Type
    Type: string
    required

    Set this header to application/json

  • x-pch-digest
    Type: string
    required

    Signature generated using the request path, body, and OAuth secret provided by the business. For details, see signature.

  • Authorization
    Type: string
    required

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

  • Accept-Timezone
    Type: string

    Used to indicate the time zone in which you would like the date and time information in the response to be formatted

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

  • Accept-Language
    Type: string

    Preferred language

Body
application/json
  • client
    Type: string
    required

    OAuth client ID provided by the business

  • subscription_id
    Type: string
    required

    ID of the subscription for which the redemption code has to be generated

Responses
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/api2/mobile/redemptions/subscription
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/redemptions/subscription \
  --request POST \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'x-pch-digest: ' \
  --header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
  --header 'Accept-Timezone: Etc/UTC' \
  --header 'User-Agent: AppName/AppVersion/BuildNumber (OS; Model; MANUFACTURER; MODEL; OS Version)' \
  --header 'Accept-Language: en' \
  --data '{
  "client": "CLIENT_GOES_HERE",
  "subscription_id": "23"
}'
{
  "redemption_status": "redeemable",
  "created_at": "2023-05-09T07:44:38Z",
  "redeemable_id": null,
  "location_id": 304252,
  "redemption_image_url": "REDEMPTION_IMAGE_URL_GOES_HERE",
  "redemption_message": "",
  "updated_at": "2023-05-09T07:44:38Z",
  "redeemable_description": null,
  "redeemable_image_url": "REDEEMABLE_IMAGE_URL_GOES_HERE",
  "subscription_id": "498699",
  "subscription_plan_id": 44,
  "subscription_plan_name": "Super Value Subscription",
  "subscription_plan_description": "10% discount on entire receipt amount (capped at $20) | Redeemable Once Per Day",
  "subscription_plan_image_url": "SUBSCRIPTION_PLAN_IMAGE_URL_GOES_HERE",
  "redemption_type": "SubscriptionRedemption",
  "redemption_id": 515404156,
  "redemption_tracking_code": "8066490",
  "expiring_at": "2023-05-09T07:54:38Z",
  "redeemable_name": "REDEEMABLE_NAME_GOES_HERE",
  "redeemed_value": null
}