Create Loyalty Check-in by Barcode
Creates a loyalty check-in for a user when the user scans/enters the barcode printed on an order receipt. The user can scan the barcode using the mobile app of the business or enter the barcode on the website of the business.
- Type: stringx
-pch -digest requiredThe signature for the API call
- Type: stringAuthorizationrequired
Used to authorize the request with access_token. It should be supplied as
Bearer ACCESS_TOKEN_GOES_HERE. - Type: stringAccept
- Language Preferred language
- Type: stringAcceptrequired
Advertises which content types the client is able to understand
- Type: stringContent
- Type requiredSet this header to application/json.
- 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: 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: integerFormat: int32bar
_code requiredBarcode printed on the receipt
- Type: stringclientrequired
OAuth client ID provided by the business
- Type: stringgps
_accuracy Accuracy of the user's device GPS
- Type: numberFormat: doublelatitude
Latitude coordinate of the user's device GPS. The latitude of the location is required if location_id is not provided.
- Type: integerFormat: int32location
_id ID of the location where the user did the check-in. The location ID is required if both the latitude and longitude of the location are not provided. If the latitude and longitude of the location are not provided, then by default Punchh identifies location based on the barcode printed on the receipt.
- Type: numberFormat: doublelongitude
Longitude coordinate of the user's device GPS. The longitude of the location is required if location_id is not provided.
- Type: booleanmanual
True if the user entered the barcode by hand.
- application/json
- application/json
- application/json
- application/json
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/checkins/barcode \
--request POST \
--header 'x-pch-digest: {{$$.env.signature}}' \
--header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
--header 'Accept-Language: en' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'punchh-app-device-id: APP_DEVICE_ID_GOES_HERE' \
--header 'User-Agent: AppName/AppVersion/BuildNumber (OS; Model; MANUFACTURER; MODEL; OS Version)' \
--data '{
"bar_code": "BARCODE_GOES_HERE",
"client": "CLIENT_GOES_HERE",
"gps_accuracy": "27",
"latitude": "26.9167509",
"location_id": "304991",
"longitude": "75.8136926"
}'
{
"created_at": "2016-05-16T08:22:25-04:00",
"current_membership_level": "Club Lite - Level 1 (0-400)",
"location_id": 304252,
"pending_refresh": false,
"points_earned": 72,
"store_number": "",
"survey_url": "URL_GOES_HERE",
"checkin_id": 11140692,
"first_checkin": false,
"expiring_on": null
}