Generate Loyalty Short Code
Generates a short code from the mobile app, which the loyalty user can share verbally at the drive-thru window, enabling faster and more convenient account look-up at the POS.
The loyalty short code is intended for drive-thru identification only and cannot be used for payments. To generate a loyalty short code that supports both identification and payments, use the Generate Single-Scan Code or Short Code API.
Note: To generate the code, the drive-thru loyalty identification must be enabled for the business on the Punchh platform. Contact your Punchh representative to update this Punchh platform configuration setting.
- Type: stringAcceptrequired
Advertises which content types the client is able to understand
- Type: stringAuthorizationrequired
Used to authorize the request with access_token. It should be supplied as
Bearer ACCESS_TOKEN_GOES_HERE. - Type: stringContent
- Type requiredSet this header to application/json.
- Type: stringUser
- 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: stringpunchh
-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: stringAccept
- Language Preferred language
- Type: stringx
-pch -digest requiredThe signature for the API call
- Type: stringclientrequired
OAuth client ID provided by the business
- Type: numberlocation
_id ID of the location for which the short code is requested. This parameter is required only when the location-level short code strategy is selected in the Punchh platform for the business. Contact your Punchh representative to update this Punchh platform configuration setting.
- application/json
- application/json
- application/json
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/drivethru_code \
--request POST \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
--header 'Content-Type: application/json' \
--header 'User-Agent: AppName/AppVersion/BuildNumber (OS; Model; MANUFACTURER; MODEL; OS Version)' \
--header 'punchh-app-device-id: APP_DEVICE_ID_GOES_HERE' \
--header 'Accept-Language: en' \
--header 'x-pch-digest: {{$$.env.signature}}' \
--data '{
"client": "CLIENT_GOES_HERE",
"location_id": 1
}'
{
"short_code": "CODE_GOES_HERE",
"expiring_at": "2025-11-04T07:58:07Z",
"new_short_code_generated": true
}