Cart APIAPIs
The Cart API enables UI Extensions to manage and interact with POS cart contents, such as discounts, line items, and customer details. It provides a comprehensive set of functions for adding and removing items, alongside a subscribable object that keeps the UI Extension updated with real-time changes to the cart.
Supporting targets
- pos.home.tile.render
- pos.home.modal.render
- pos.product-details.action.menu-item.render
- pos.product-details.action.render
- pos.customer-details.action.menu-item.render
- pos.customer-details.action.render
- pos.customer-details.block.render
- pos.order-details.action.menu-item.render
- pos.order-details.action.render
- pos.order-details.block.render
- pos.draft-order-details.action.menu-item.render
- pos.draft-order-details.action.render
- pos.draft-order-details.block.render
Anchor to cartapiCartApi
Add an address to the customer (Customer must be present)
Add a code discount to the cart
Adds custom properties to the cart
Add a custom sale to the cart
Add a line item by variant ID to the cart
Adds custom properties to the specified line item
Apply a cart level discount
Adds custom properties to multiple line items at the same time.
Bulk update the cart
Set line item discounts to multiple line items at the same time.
Clear the cart
Delete an address from the customer (Customer must be present)
Remove all cart and line item discounts
Remove the cart discount
Removes the specified cart properties
Remove the current customer from the cart
Remove the line item at this uuid from the cart
Remove all discounts from a line item
Removes the specified line item properties
Sets an attributed staff to all line items in the cart.
Sets an attributed staff to a specific line items in the cart.
Set the customer in the cart
Add a discount on a line item to the cart
Provides a subscription to POS cart changes. Provides an initial value and a callback to subscribe to value changes. Currently supports only one subscription. You can utilize on a
to implement multiple subscriptions. Using
or the corresponding hooks counts as a subscription.
Update the default address for the customer (Customer must be present)
Anchor to examplesExamples
Examples of using the Cart API