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.

Anchor to addAddress
addAddress
(address: ) => Promise<void>

Add a new address to a customer.

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

Add properties for the cart.

Anchor to addCustomSale
addCustomSale
(customSale: ) => Promise<void>

Add custom sale for the cart.

Anchor to addLineItem
addLineItem
(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.

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

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

Anchor to clear
clear
() => Promise<void>

Clear all contents from the cart.

Anchor to fetch
fetch
() => Promise<>

Fetch the current cart.

Anchor to removeAllDiscounts
removeAllDiscounts
(disableAutomaticDiscounts: boolean) => Promise<void>

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

Anchor to removeCartDiscount
removeCartDiscount
() => Promise<void>

Remove the discount applied to the whole cart.

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

Remove properties from the cart.

Anchor to removeCustomer
removeCustomer
() => Promise<void>

Remove the current customer from the cart.

Anchor to removeLineItem
removeLineItem
(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.

Anchor to setCustomer
setCustomer
(customer: ) => Promise<void>

Add a new or existing customer to the cart.

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

Apply a discount to a line item.

Anchor to subscribe
subscribe
(onSubscribe: ) =>

Subscribe the cart changes.

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

Update an address for a customer.

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

Make changes to a line item in the cart.

Close the app

Promise<void>

Retrieve device data

Promise<>

Retrieve location data

Promise<>

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

Promise<>
Examples
await shopify.pos.cart.fetch();

Preview

Was this page helpful?