Mobile Application / Website / Agency Integrations

Description

Mobile applications are used to take orders in the mobile application, apply redemptions and discounts, and then transfer order processing to an online ordering system or to a POS system for order completion. They are used on the user’s mobile device by the user. These kinds of integrations use mostly Punchh Mobile APIs.

The common workflow in each of these kinds of systems looks like this:

1. Build order - In this scenario, the user builds an order of goods and services to buy.

2. Transfer to online ordering or POS - In this kind of scenario, the user’s device generates a code (single-scan code) that enables the user to transfer the transaction to an online ordering system or a POS system that looks up the code, retrieves information about the user and the order, and then completes the order by paying for it.

When integrating with Punchh, the workflow needs some extra steps:

1. Sign up / look up user - In this scenario, the user validates the user’s identity with Punchh using a loyalty sign-up or lookup. This identity is attached to the order and payment to help the loyalty system assign loyalty credits to the user for making a purchase. This workflow must occur before the order is paid.

2. Query redemptions - In this scenario, the mobile device checks the order against loyalty offers and adjusts the order with discounts from the loyalty orders, thus turning them into redemptions. This workflow occurs after the order is built and the loyalty user is authenticated, and before the order is transferred to an online ordering or POS system.

3. Check in - After the order is paid, the order is sent to the loyalty system so that loyalty credits can be properly credited to the loyalty user. With mobile users, check-ins are registered by scanning the receipt, its barcode, or its QR code.

Information Resources

Study the following to learn about integrations that use Punchh Mobile APIs.

1. Start with Getting Started With Mobile API Integrations.

2. Read Make Your First Mobile API Call. This is the first of many adjacent documents that you can read on the PAR Developer Portal to understand how Punchh Mobile APIs work.

3. The sign-up and user look-up flows authenticate a user and result in the acquisition of an access token that enables other API calls to be made on behalf of the user. These require the following API calls:

  • a. Send OTP - Sends a one time password (OTP) to the user via email or SMS message using Advanced Authentication to sign up / sign in.

  • b. Verify OTP - This verifies the OTP token and returns an access token for that user.

  • c. Sign up / Register - This enables the creation of a new loyalty user. This is a legacy method for user authentication and is not recommended for new applications. This returns an access token for that user.

  • d. Fetch User Balance - For existing loyalty users, this confirms that a user is valid, and checks the credits, rewards, and offers available to the user.

4. There are many APIs related to redemptions, but the success path of query and activate redemptions (Redemptions 2.0) flows require calls to the following APIs:

  • a. Add Selection to Discount Basket (Redemptions 2.0) - This adds selected discounts to a basket (i.e., a virtual shopping cart).

  • b. Get Active Discount Basket (Redemptions 2.0) - This fetches what is currently in the discount basket for that user within that Punchh business.

  • c. Batch Redemption Process (Redemptions 2.0) - There is no API for this Punchh Mobile APIs (unlike with Punchh Online Ordering APIs or Punchh POS APIs) because this transaction must be transferred to an online ordering system or a POS system for completion.

5. (Optional if working with a POS system) To transfer the order to a POS, a single-scan code must be generated:

  • a. Mobile API: Generate a Single Scan Code - This API is called on the mobile application to generate a single-scan code. This code provides access to information about the user, the order, and possibly payment mechanisms. This code is transferred from the mobile device to a POS terminal via a QR code.

  • b. POS API: User Look-up and Fetch Balance - This API is called on the POS with the single-scan code as an argument, and Punchh returns information about the user, the order, and possibly payment mechanisms. The POS completes the order processing here.

6. (Optional if working with an online ordering system) - To transfer the order to an online ordering system, an SSO access token can be generated:

  • a. Mobile API: Fetch Client Token, with the channel set to 'ordering' in the URL - This call is made on the mobile application and returns a client token (response_body.token). This token is used by the online ordering application to access information about the user, etc.

  • b. Online Ordering API: Create SSO Access Token - This is called on the online ordering application with the security_token argument set to the token from the previous step from the mobile application. This token is often sent as a parameter in a redirect URL. This token gives the online ordering application access to information about the user via the user’s access token returned in the response (response_body.token.access_token). The online ordering system completes the order processing here.

7. The check-in process requires the following API calls:

Sample Applications

  • x-pch-digest generator - This downloadable sample application shows how to construct an x-pch-digest HTTP header for authenticating Punchh Mobile API calls, and proves it by making Punchh Mobile API calls using a properly generated x-pch-digest HTTP header.

Postman Collections

Examples

These are examples of mobile application integrations:

  • Mobile applications by Bounteous

  • Mobile applications by PleinAir