POS
Provides a mechanism for closing the app when it's running in Shopify POS, and for retrieving information about a Shopify POS device.
Requirements
Anchor link to section titled "Requirements"- User and location data are available in all version of Point of Sale Android and iOS.
- Device data is available in following app version:
- Point of Sale iOS version 5.36.0 or above
- Point of Sale Android version 3.29.0 or above
- Close is available in the following app version:
- App Bridge version 1.18.0 or above is required
- Point of Sale iOS version 5.50.0 or above
- Point of Sale Android version 3.43.0 or above
Create an app and import the Pos
module from @shopify/app-bridge/actions
. Note that we'll be referring to this sample application throughout the examples below.
Close an app embedded in Shopify POS
Anchor link to section titled "Close an app embedded in Shopify POS"Create a Pos object that can be used to close the embedded app. You might close the embedded app after the user successfully completes an action to return them to the Shopify POS app.
To close the embedded app, use the Pos object to dispatch the CLOSE
action.
Get POS data
Anchor link to section titled "Get POS data"POS data is available in the state and accessible through app.getState(). There are several ways to get the data:
Option 1: get all state
Option 2: get only pos
Option 3: get only pos user
Option 4: get only pos location
Option 5: get only pos device
POS Payload
Anchor link to section titled "POS Payload"Key | Type | Description |
---|---|---|
user |
User | User info. |
location |
Location | Location info. |
device |
Device | Device info. |
User Payload
Anchor link to section titled "User Payload"Key | Type | Description |
---|---|---|
id |
Number | The ID of login user. |
firstName |
String | The first name of login user. |
lastName |
String | The last name of login user. |
email |
String | The email name of login user. |
accountOwner |
Boolean | Indicate if login user is the shop owner. |
userType |
String | The type of login user. |
Location Payload
Anchor link to section titled "Location Payload"Key | Type | Description |
---|---|---|
id |
Number | The ID of current location. |
active |
Boolean | The status of current location. |
name |
String | The name of current location. |
locationType |
String? | The type of current location. |
address1 |
String? | The primary address of current location. |
address2 |
String? | Any extra information associated with the address (Apartment #, Suite #, Unit #, etc.). |
zip |
String? | The ZIP or postal code of the address. |
city |
String? | The name of the city. |
province |
String? | The province or state of the address. |
countryCode |
String? | The Country Code in ISO 3166-1 (alpha-2) format. |
countryName |
String? | The country of the address. |
phone |
String? | The phone number of the location. |
Device Payload
Anchor link to section titled "Device Payload"Key | Type | Description |
---|---|---|
name |
String | The name of the device |
serialNumber |
String | The unique ID associated device ID and app ID. |