Add Selection to Discount Basket (Redemptions 2.0)

  • A single discount basket will be active at a time. If there is no active discount basket, the system will create a new active discount basket along with selected discounts passed in the request parameters.
  • The Punchh system will not have any validation based on points adjustments as discounts are added.
  • When a guest adds multiple discounts, and one is invalid for some reason, the entire request will fail with an error message. The guest will then be required to remove the invalid discount and resubmit.
Headers
  • Content-Type
    Type: string
    required

    Set this header to application/json.

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

  • Accept
    Type: string
    required

    Advertises which content types the client is able to understand

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

  • Authorization
    Type: string
    required

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

  • 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

  • discount_basket_items_attributes
    Type: array object[]
    required

    List of discounts to add to basket

Responses
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/api2/mobile/discounts/select
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/discounts/select \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'punchh-app-device-id: APP_DEVICE_ID_GOES_HERE' \
  --header 'Accept: application/json' \
  --header 'User-Agent: AppIdentifier/VersionNumber/BuildNumber(OS_Type)' \
  --header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
  --header 'x-pch-digest: {{$.env.signature}}' \
  --data '{
  "discount_basket_items_attributes": [
    {
      "discount_id": 131,
      "discount_type": "reward"
    },
    {
      "discount_value": 132,
      "discount_type": "reward"
    }
  ],
  "client": "CLIENT_GOES_HERE"
}'
{
  "redemption_ref": "REDEMPTION_REF_GOES_HERE",
  "created_at": "2024-05-21T15:14:02Z",
  "discount_basket_items": [
    {
      "discount_basket_item_id": 469363,
      "discount_type": "reward",
      "discount_id": "41049646877",
      "discount_value": null,
      "created_at": "2024-05-24T08:36:52Z",
      "discount_details": {
        "item_id": 48188,
        "name": "Sandwich Test | AK",
        "campaign_name": "Mass Campaign Offer",
        "image": "IMAGE_URL_GOES_HERE",
        "points": null,
        "base_amount": null,
        "description": "",
        "item_properties": "",
        "meta_detail": null,
        "start_date_tz": "2024-05-24T08:34:24Z",
        "end_date_tz": "2024-06-30T03:15:00Z",
        "created_at": "2023-08-18T08:29:36Z",
        "auto_select": false
      }
    },
    {
      "discount_basket_item_id": 541689,
      "discount_type": "reward",
      "discount_id": "41378920421",
      "discount_value": null,
      "created_at": "2024-06-11T12:56:33Z",
      "discount_details": {
        "item_id": 48188,
        "name": "Sandwich Test | AK",
        "campaign_name": "Mass Campaign Offer",
        "image": "IMAGE_URL_GOES_HERE",
        "points": null,
        "base_amount": null,
        "description": "",
        "item_properties": "",
        "meta_detail": null,
        "start_date_tz": "2024-05-31T13:25:08Z",
        "end_date_tz": "2024-06-30T03:15:00Z",
        "created_at": "2023-08-18T08:29:36Z",
        "auto_select": false
      }
    }
  ]
}