Ruby on Rails example app
Shopify has published a sample POS embedded app on GitHub. This app uses Ruby on Rails and it demonstrates many of the methods and capabilities of the SDK. You can clone this app locally and use ngrok to try it out using an iPad. Find out more about how to use the example POS app.
Contents of the SDK
The POS App SDK offers you a
- Cart modifications (e.g adding/removing line items, discounts, custom properties)
- Alert, confirm, and input dialogs
- Flash messages
- User and location information.
Creating an app that uses the Shopify POS App SDK
First, follow the Getting Started guide to create a development store and an app.
Click Apps in the sidebar.
Click the name of your app.
Click Edit app settings:
Scroll down to the Embedded settings section
Select the Enabled radio button for Shopify POS.
Some older apps may not see an option to enable the POS App SDK. If you are interested in using the POS App SDK and you don't see the option to enable it then reach out to us.
HTTPS, SSL certificates and mixed content restrictions
Shopify POS uses SSL for all of its communication. Security of financial data requires all embedded apps to also run on HTTPS.
Like embedded apps in the Shopify admin, publishing an embedded app in the Shopify App Store requires the app to have an SSL certificate.
OAuth will behave normally in your app, as it would for any other Shopify apps or other OAuth enabled services with one caveat:
Since the application is loaded inside an iframe it is critical that the initial OAuth request redirect escapes the iframe to make the requests. Shopify returns the
X-Frame-Options=DENY header and prevents any Shopify admin pages from being loaded inside an iframe.
This means that where the OAuth process would normally begin with:
It should now return a page containing:
The above example assumes you're using the Shopify Omniauth gem. If not, replace
/auth/shopify with the supported
Selling your POS app in the Shopify App Store
After you have written an embedded app for Shopify POS, you may want to submit it to the Shopify App Store. You can bill merchants for your app using Shopify's Billing API. Merchants can buy your app using the Billing API when they access your app using the Shopify web admin. Billing API requests cannot be made from within the POS itself. Find out about how to get your app listed in the Shopify App Store.