Generate a Single Scan Code
This API facilitates the single-scan flow functionality, allowing a user to generate a single-scan code from the mobile app for making a payment, redeeming a discount, adding a tip, or any combination of these in a single transaction at the POS. The API returns a single scan code containing a UUID string in the response.
For more information, see Single Scan Flow.
Note: This mobile API endpoint (POST {server-name}/api2/mobile/single_scan_tokens) is the same as the mobile API endpoint used to generate a one-time passcode (OTP) for use with Redemptions 2.0. When using this API with Redemptions 2.0, the following offers parameters must NOT be included with the request body:
reward_idredeemable_idbanked_reward_amountcouponredeemable_card_countsubscription_id
- Type: string
x -pch -digest requiredThe signature for the API call
- Type: string
Content - Type requiredSet this header to application/json.
- Type: string
Accept - Language Preferred language
- Type: string
User - Agent requiredUsed to identify the software, device, and application initiating the request, providing information about the client to the server. For details, see User Agent.
- Type: string
punchh -app -device -id requiredThe 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.
- Type: string
Authorization requiredUsed to authorize the request with access_token. It should be supplied as
Bearer ACCESS_TOKEN_GOES_HERE. Note: When authentication is performed using Advanced Authentication, you must include theid_tokenin theid-tokenheader and theaccess_tokenin theAuthorizationheader. See Access Punchh APIs Using Access and ID tokens - Type: string
id -token A token that contains identity information about the authenticated user. It is used to verify the user’s identity and is required only when authentication is performed using Advanced Authentication. This token alone does not grant access to Punchh APIs. To access the APIs, you must include the
id_tokenin theid-tokenheader and theaccess_tokenin theAuthorizationheader. See Access Punchh APIs Using Access and ID tokens
- Type: string
banked _reward _amount Amount of banked currency selected by the user for redemption
- Type: string
client requiredOAuth client ID provided by the business
- Type: string
coupon User-specific dynamically generated unique coupon codes that the POS system automatically applies in a single scan, or a comma-separated list of unique coupons if multiple coupons are selected by the user for redemption
- Type: string
gift _card _uuid The user's gift card number. Required if the payment type is gift card.
- Type: string
payment _type Payment type selected by the user when generating the single scan code. Valid values are
GiftCard,CreditCard, orrecurring. The payment type is recurring when the user selects a saved payment card from the mobile application for payments. - Type: string
redeemable _card _count Number of redeemable cards selected by the user for redemption
- Type: string
redeemable _id Unique ID of a redeemable, or a comma-separated list of redeemable IDs if multiple redeemables are selected by the user for redemption
- Type: string
reward _id Unique ID of a reward, or a comma-separated list of reward IDs if multiple rewards are selected by the user for redemption
- Type: string
subscription _id Unique ID of a subscription, or a comma-separated list of subscription IDs if multiple subscriptions are selected by the user for redemption
- Type: string
tip Amount that the user selected as a tip
- Type: string
transaction _token Unique digital identifier/token of the user's credit card, or UUID of the saved payment card if the payment type is recurring. Required if the payment type is credit card or recurring.
- Type: object
200 - Type: string
created _at Date/time when the single scan code was created in the system, in ISO 8601 format
- Type: string
expires _in Date/time when the single scan code expires and the user cannot use it at the POS, in ISO 8601 format
- Type: string
single _scan _code Single scan code of the user to be used in single scan flow at the POS
- Type: object
400 - Type: object
errors
- Type: object
401 - Type: object
errors
- Type: object
422 - Type: string
errors
{
"single_scan_code": "string",
"expires_in": "string",
"created_at": "string"
}