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.

Headers

  • The signature for the API call

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

  • Preferred language

  • Advertises which content types the client is able to understand

  • Set this header to application/json.

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

  • Used to identify the software, device, and application initiating the request, providing information about the client to the server. For details, see User Agent.

Body

application/json
  • Barcode printed on the receipt

  • OAuth client ID provided by the business

  • Accuracy of the user's device GPS

  • Latitude coordinate of the user's device GPS. The latitude of the location is required if location_id is not provided.

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

  • Longitude coordinate of the user's device GPS. The longitude of the location is required if location_id is not provided.

  • True if the user entered the barcode by hand.

Responses

  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/api2/mobile/checkins/barcode
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
}