| Previous Topic | Next Topic | |
|---|---|---|
| POS Module 9: Print Check - Concepts | POS Module 10: Handling POS Disconnections - Concepts |
POS API Certification Tutorial - Module 9: Print Check - Example Scenarios
Prerequisites
- You must have read the scenario assumptions.
- Review Module 9: Print Check - Concepts
- Review Module 8b: Updating/Voiding Transactions - Example Scenarios
General Tasks for Printing a Receipt
The POS usually prints the receipt after the check is paid and closed and the POS sends receipt details for the transaction to Punchh using the Receipt Details API. The Location Configuration API lets you fetch the store configurations including the messages that are printed on the receipt. The POS should save configuration information locally. The receipt message parameters returned in the API response are header, trailer_1, trailer_2, trailer_3, trailer_4, and trailer_5. The header message is printed at the top of the receipt and the trailer messages are printed under the barcode on the receipt.
The barcode is generated by the POS and printed on the receipt so that the user can scan the barcode using the brand's mobile application and earn loyalty points on the transaction. The barcode is usually printed 1) for guests who are non-loyalty users, 2) for loyalty users who do not want to check in at the POS, and 3) when POS connectivity to Punchh is lost.
Platform Configurations for Displaying Static Receipt Message
The Punchh platform enables businesses to add the header and footer messages that they want to print on the receipt for one or more POS locations. To configure a receipt message in the Punchh platform, go to Store Locations > Receipt Messages and click Add New Receipt Message. The Add New Receipt Message form has these fields:
-
Header - The line entered in this field is displayed at the top of the receipt.
-
Barcode Message Line #1 - Line 1 under the barcode on the receipt
-
Barcode Message Line #2 - Line 2 under the barcode on the receipt
-
Barcode Message Line #3 - Line 3 under the barcode on the receipt
-
Barcode Message Line #4 - Line 4 under the barcode on the receipt
-
Barcode Message Line #5 - Line 5 under the barcode on the receipt
The Location Configuration API response returns Header as header, Barcode Message Line #1 as trailer_1, and subsequent barcode message lines as trailer_2, trailer_3, trailer_4, and trailer_5.
Sample Receipt Message Content
Header (header) - Thank you for visiting Central Punchh Coffee!
Barcode Message Line #1 (trailer_1) - If you would like to join our Central Punchh Coffee
Barcode Message Line #2 (trailer_2) - loyalty program to earn credit for your
Barcode Message Line #3 (trailer_3) - purchase and receive rewards like a
Barcode Message Line #4 (trailer_4) - Free Birthday Burger, please visit
Barcode Message Line #5 (trailer_5) - CentralPunchhCoffee.com/Loyalty to sign up.
Possible Scenario
The following scenario is based on the assumptions here.
Story Line
Monica wants to order a hot latte to start off her morning. However, when Rachel tries to look up Monica’s account, she realizes that the Punchh servers are down! Monica is upset, as she would like to be rewarded for today’s purchase. Rachel apologizes and explains that she can provide a printed receipt (as usual), but with a bit of information on the receipt that is normally not provided when a check is assigned to a loyalty guest. There is a barcode or QR code that Monica can scan on the mobile app to earn points for her purchase, which will be applied to her account depending on whether the pending points setting is enabled or disabled. As the pending points setting is enabled and is set to 2 hours for the business, Rachel tells Monica that, after scanning the barcode or QR code, the points will be applied to her account after 2 hours.
Code Sample (Direct API Integration)
The POS needs to handle the printing of receipts. There is no Punchh API that the POS needs to call for printing the receipts at the store. As discussed in the previous section, the POS needs to make a call to the Location Configuration API to fetch the receipt header and trailer messages to be printed on receipts for a store location. The POS needs to save this information locally and retrieves this information when printing receipts. The following code sample contains the API request and response for the Location Configuration API. Here is a sample Location Configuration API response that contains header and trailer messages:
- Business name: Central Punchh Coffee
- Location ID: 327922
- Location Name: Central Punchh Coffee location-1
- Receipt Header: Thank you for visiting Central Punchh Coffee!
- Receipt trailer message line 1: If you would like to join our Central Punchh Coffee
- Receipt trailer message line 2: loyalty program to earn credit for your
- Receipt trailer message line 3: purchase and receive rewards like a
- Receipt trailer message line 4: Free Birthday Burger, please visit
- Receipt trailer message line 5: CentralPunchhCoffee.com/Loyalty to sign up.
The relevant parameters are made bold in the API response sample below. See Location Configuration API and "Module 1: Location Configuration and Program Meta" Concepts and Example Scenarios topics for additional information about the API.
| Request Body | Response Body |
| API endpoint name: Location Configuration GET {server-name}/api/pos/locations/configuration A combination of the API key (i.e., location key) and business key needs to be passed in the Authorization header to make API calls. N/A - This request does not have a body. For examples of how to make this call using various programming languages, see Module 1: Example Code. |
{ "banked_rewards_mode": "1", "business_name": "Central Punchh Coffee", "header": "Thank you for visiting Central Punchh Coffee!", "location_id": "327922", "location_name": "Central Punchh Coffee location-1", "log_level": "6", "points_unlock_mode": "0", "print_barcodes": "1", "send_to_datasink": "1", "short_key": "6624", "trailer_1": "If you would like to join our Central Punchh Coffee", "trailer_2": "loyalty program to earn credit for your", "trailer_3": "purchase and receive rewards like a", "trailer_4": "Free Birthday Burger, please visit", "trailer_5": "CentralPunchhCoffee.com/Loyalty to sign up.", "update_interval": "60", "visits_mode": "0" } |