POS cart app extension overview
Shopify merchants can use apps to manage loyalty programs and discounts for Shopify POS. You can add the POS cart app extension to your app so that merchants can easily manage loyalty points and apply discounts directly in Shopify POS.
The POS cart app extension provides JSON objects that can be used to load template and action data inside Shopify POS. To learn more about the JSON fields, see the POS cart app extension reference.
To integrate with Shopify and Shopify POS, you need to create the POS cart app extension endpoints.
App extension architecture
The POS cart app extension is based on three endpoints:
See the POS cart app extension endpoints for more information.
The promotions endpoint
When a new order is started in Shopify POS (i.e. the cart is empty) or the customer on the cart changes, Shopify sends a request to your app's
promotions endpoint. This request contains the supported templates and actions that your app can use when returning data to Shopify. Your app's response includes the chosen template, the customer's loyalty points, and any applicable actions. Each action is a promotion that can be applied to the cart.
A response that contains a customer's points and an action to apply a $5 flat discount renders as follows:
The perform_action endpoint
After your app has returned the template and actions array, Shopify POS renders the information and the merchant can tap a promotion to apply it to the cart. The performed action is sent to Shopify, which proxies the action to your app's
perform_action endpoint. The request contains the
action_id field to properly identify the action.
The revert_action endpoint
After a successful call to your app's
perform_action endpoint, it's possible for the action to be reverted. For example, the order could be abandoned or the discount deleted from the cart. In these cases, Shopify sends a request to your app's
revert_action endpoint with the ID of the action to be reverted.
- Learn about the different steps that are required to integrate your app with the POS cart app extension by following the Getting started guide.