Get Active Discount Basket (Redemptions 2.0)

  • Get a list of discount details that have been selected by a guest. Only one active basket can exist in the system for a particular guest.
  • If a discount expires after being added to the discount basket, it is removed from the discount basket. When you make a call to the API, it validates the discounts added to the discount basket. If one or more discounts are found to be honored, expired, perished, or archived, the API returns an error message indicating that these discounts cannot be honored. The API lists the invalid discounts in the discount_basket_items object with a message stating that the discount is invalid and returns a null value in the discount_details object.
Headers
  • Accept
    Type: string
    required

    Advertises which content types the client is able to understand

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

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

  • x-pch-digest
    Type: string
    required

    The signature for the API call

  • Accept-Language
    Type: string

    Preferred language. Punchh supports multiple languages for the redeemable name, redeemable description, meta data for coupon, subscription plan name, and subscription description in the API response as per the locale specified in the Accept-Language request header. Possible values: es for Spanish, fr for French, fr-ca for French-Canada, en-CY for English-Cyprus, ro for Romania, es-US for Spanish United States, etc.
    The locales for a business are configured in the Punchh platform under Administration > Business Profile > Address > Alternate Languages. In the Punchh platform, the admin of a business has to configure in the relevant language(s) 1) the redeemable name and redeemable description when creating/editing a redeemable under Offers > All Redeemables, 2) meta data for coupons when creating/editing a coupon campaign under Campaign Management, and 3) subscription plan name and subscription description when creating/editing a subscription plan under Wallet and Passes > Subscription Plans.

Body
application/json
  • client
    Type: string
    required

    OAuth client ID provided by the business

Responses
  • application/json
  • application/json
  • application/json
Request Example for get/api2/mobile/discounts/active
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/discounts/active \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: AppIdentifier/VersionNumber/BuildNumber(OS_Type)' \
  --header 'punchh-app-device-id: APP_DEVICE_ID_GOES_HERE' \
  --header 'x-pch-digest: {{$.env.signature}}' \
  --data '{
  "client": "CLIENT_GOES_HERE"
}'
{
  "redemption_ref": "REDEMPTION_REF_GOES_HERE",
  "created_at": null,
  "discount_basket_items": [
    {
      "discount_basket_item_id": 4699,
      "discount_type": "reward",
      "discount_id": "33703164",
      "discount_value": null,
      "created_at": "2022-08-25T10:03:48Z",
      "discount_details": {
        "item_id": 777658,
        "name": "Flat $5 Off (Unlocks at 100 points)",
        "campaign_name": "Mass Campaign Offer",
        "image": "IMAGE_URL_GOES_HERE",
        "points": 100,
        "base_amount": 5,
        "description": "",
        "item_properties": null,
        "meta_detail": null,
        "start_date_tz": null,
        "end_date_tz": null,
        "created_at": "2022-09-08T18:41:16Z",
        "auto_select": false
      }
    }
  ]
}