Skip to main content

POS

The POS API provides the ability to retrieve POS user, device, and location data, while also interacting with the cart and closing the app.

Tip

It is recommended to use POS UI extensions for your development needs as they provide a faster, more robust, and easier to use solution for merchants using apps on POS. To learn more about the benefits and implementation details, refer to POS UI Extensions.

Retrieve cart data and perform actions.

(address: ) => Promise<void>

Add a new address to a customer.

(properties: Record<string, string>) => Promise<void>

Add properties for the cart.

(customSale: ) => Promise<void>

Add custom sale for the cart.

(variantId: number, quantity: number) => Promise<void>

Add a product to the cart.

Anchor to addLineItemProperties
addLineItemProperties
(uuid: string, properties: Record<string, string>) => Promise<void>

Add properties to a line item.

Anchor to applyCartCodeDiscount
applyCartCodeDiscount
(code: string) => Promise<void>

Apply a code discount to the whole cart.

(type: , discountDescription: string, amount: string) => Promise<void>

Apply a percentage or fixed amount discount to the whole cart.

() => Promise<void>

Clear all contents from the cart.

() => Promise<>

Fetch the current cart.

(disableAutomaticDiscounts: boolean) => Promise<void>

Clears all applied discounts from the cart and optionally disables automatic discounts.

() => Promise<void>

Remove the discount applied to the whole cart.

Anchor to removeCartProperties
removeCartProperties
(keys: string[]) => Promise<void>

Remove properties from the cart.

() => Promise<void>

Remove the current customer from the cart.

(uuid: string) => Promise<void>

Remove a line item in the cart.

Anchor to removeLineItemDiscount
removeLineItemDiscount
(uuid: string) => Promise<void>

Remove a discount from a line item.

Anchor to removeLineItemProperties
removeLineItemProperties
(uuid: string, properties: string[]) => Promise<void>

Remove properties from a line item.

(customer: ) => Promise<void>

Add a new or existing customer to the cart.

(uuid: string, type: , discountDescription: string, amount: string) => Promise<void>

Apply a discount to a line item.

(onSubscribe: ) =>

Subscribe the cart changes.

(index: number, address: ) => Promise<void>

Update an address for a customer.

(uuid: string, quantity: number) => Promise<void>

Make changes to a line item in the cart.

Was this section helpful?

Close the app

Promise<void>
Was this section helpful?

Retrieve device data

Promise<>
Was this section helpful?

Retrieve location data

Promise<>
Was this section helpful?

Refer to the user API to learn more about retrieving POS user data.

Promise<>
Was this section helpful?

Fetch the POS cart

await shopify.pos.cart.fetch();

Examples for retrieving and interacting with data on the POS

Fetch the cart

await shopify.pos.cart.fetch();

Was this section helpful?

Dismiss the screen

await shopify.pos.close();

Was this section helpful?

Retrieve POS device data

await shopify.pos.device();

Was this section helpful?

Retrieve POS location data

await shopify.pos.location();