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](/docs/api/pos-ui-extensions/targets/smart-grid/pos-home-tile-render) - [pos.home.modal.render](/docs/api/pos-ui-extensions/targets/smart-grid/pos-home-modal-render) - [pos.product-details.action.menu-item.render](/docs/api/pos-ui-extensions/targets/product-details/pos-product-details-action-menu-item-render) - [pos.product-details.action.render](/docs/api/pos-ui-extensions/targets/product-details/pos-product-details-action-render) - [pos.customer-details.action.menu-item.render](/docs/api/pos-ui-extensions/targets/customer-details/pos-customer-details-action-menu-item-render) - [pos.customer-details.action.render](/docs/api/pos-ui-extensions/targets/customer-details/pos-customer-details-action-render) - [pos.customer-details.block.render](/docs/api/pos-ui-extensions/targets/customer-details/pos-customer-details-block-render) - [pos.order-details.action.menu-item.render](/docs/api/pos-ui-extensions/targets/order-details/pos-order-details-action-menu-item-render) - [pos.order-details.action.render](/docs/api/pos-ui-extensions/targets/order-details/pos-order-details-action-render) - [pos.order-details.block.render](/docs/api/pos-ui-extensions/targets/order-details/pos-order-details-block-render) - [pos.draft-order-details.action.menu-item.render](/docs/api/pos-ui-extensions/targets/draft-order-details/pos-draft-order-details-action-menu-item-render) - [pos.draft-order-details.action.render](/docs/api/pos-ui-extensions/targets/draft-order-details/pos-draft-order-details-action-render) - [pos.draft-order-details.action.render](/docs/api/pos-ui-extensions/targets/draft-order-details/pos-draft-order-details-block-render)
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.
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 `makeStatefulSubscribable` on a `RemoteSubscribable` to implement multiple subscriptions. Using `makeStatefulSubscribable` or the corresponding hooks counts as a subscription.
Update the default address for the customer (Customer must be present)
'Percentage' | 'FixedAmount' | 'Code'
Parameters for adding custom properties to a line item.
The uuid belonging to the line item which should receive the custom properties.
The custom properties to apply to the line item.
Parameters for adding a line item discount.
The discount to be applied to the line item.
The uuid belonging to the line item which should receive the discount.
The percentage or fixed amount for the discount.
The title of the line item discount.
The discount type.
'Percentage' | 'FixedAmount'
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](/docs/api/pos-ui-extensions/targets/smart-grid/pos-home-tile-render) - [pos.home.modal.render](/docs/api/pos-ui-extensions/targets/smart-grid/pos-home-modal-render) - [pos.product-details.action.menu-item.render](/docs/api/pos-ui-extensions/targets/product-details/pos-product-details-action-menu-item-render) - [pos.product-details.action.render](/docs/api/pos-ui-extensions/targets/product-details/pos-product-details-action-render) - [pos.customer-details.action.menu-item.render](/docs/api/pos-ui-extensions/targets/customer-details/pos-customer-details-action-menu-item-render) - [pos.customer-details.action.render](/docs/api/pos-ui-extensions/targets/customer-details/pos-customer-details-action-render) - [pos.customer-details.block.render](/docs/api/pos-ui-extensions/targets/customer-details/pos-customer-details-block-render) - [pos.order-details.action.menu-item.render](/docs/api/pos-ui-extensions/targets/order-details/pos-order-details-action-menu-item-render) - [pos.order-details.action.render](/docs/api/pos-ui-extensions/targets/order-details/pos-order-details-action-render) - [pos.order-details.block.render](/docs/api/pos-ui-extensions/targets/order-details/pos-order-details-block-render) - [pos.draft-order-details.action.menu-item.render](/docs/api/pos-ui-extensions/targets/draft-order-details/pos-draft-order-details-action-menu-item-render) - [pos.draft-order-details.action.render](/docs/api/pos-ui-extensions/targets/draft-order-details/pos-draft-order-details-action-render) - [pos.draft-order-details.action.render](/docs/api/pos-ui-extensions/targets/draft-order-details/pos-draft-order-details-block-render)
import React from 'react';
import {
reactExtension,
useApi,
Tile,
useCartSubscription
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const cart = useCartSubscription();
return (
<Tile
title='My App'
subtitle={`${cart.lineItems.length} line items in cart`}
enabled
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Cart, Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: `${api.cart.subscribable.initial.lineItems.length} line items in cart`,
enabled: true,
});
api.cart.subscribable.subscribe((newCart: Cart) => {
tile.updateProps({
subtitle: `${newCart.lineItems.length > 0} line items in cart`,
});
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile,
useCartSubscription
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const cart = useCartSubscription();
return (
<Tile
title='My App'
subtitle={`${cart.lineItems.length} line items in cart`}
enabled
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Cart, Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: `${api.cart.subscribable.initial.lineItems.length} line items in cart`,
enabled: true,
});
api.cart.subscribable.subscribe((newCart: Cart) => {
tile.updateProps({
subtitle: `${newCart.lineItems.length > 0} line items in cart`,
});
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.applyCartDiscount('Percentage', 'Summer discount', '10')}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.applyCartDiscount('Percentage', 'Summer discount', '10');
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.applyCartDiscount('Percentage', 'Summer discount', '10')}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.applyCartDiscount('Percentage', 'Summer discount', '10');
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.addCartCodeDiscount('SUMMER_2024')}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.addCartCodeDiscount('SUMMER_2024');
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.addCartCodeDiscount('SUMMER_2024')}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.addCartCodeDiscount('SUMMER_2024');
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.removeAllDiscounts(true)}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.removeAllDiscounts(true);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.removeAllDiscounts(true)}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.removeAllDiscounts(true);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.setLineItemDiscount('aa-1234567', 'Percentage', 'Summer discount', '10')}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.setLineItemDiscount(
'aa-1234567',
'Percentage',
'Summer discount',
'10',
);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.setLineItemDiscount('aa-1234567', 'Percentage', 'Summer discount', '10')}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.setLineItemDiscount(
'aa-1234567',
'Percentage',
'Summer discount',
'10',
);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.bulkSetLineItemDiscounts([
{
lineItemUuid: 'aa-1234567',
lineItemDiscount: {
title: 'Summer 2024',
amount: '10',
type: 'Percentage',
},
},
{
lineItemUuid: 'bb-1234567',
lineItemDiscount: {
title: 'Shorts sale',
amount: '15',
type: 'FixedAmount',
},
},
])}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.bulkSetLineItemDiscounts([
{
lineItemUuid: 'aa-1234567',
lineItemDiscount: {
title: 'Summer 2024',
amount: '10',
type: 'Percentage',
},
},
{
lineItemUuid: 'bb-1234567',
lineItemDiscount: {
title: 'Shorts sale',
amount: '15',
type: 'FixedAmount',
},
},
]);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.bulkSetLineItemDiscounts([
{
lineItemUuid: 'aa-1234567',
lineItemDiscount: {
title: 'Summer 2024',
amount: '10',
type: 'Percentage',
},
},
{
lineItemUuid: 'bb-1234567',
lineItemDiscount: {
title: 'Shorts sale',
amount: '15',
type: 'FixedAmount',
},
},
])}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.bulkSetLineItemDiscounts([
{
lineItemUuid: 'aa-1234567',
lineItemDiscount: {
title: 'Summer 2024',
amount: '10',
type: 'Percentage',
},
},
{
lineItemUuid: 'bb-1234567',
lineItemDiscount: {
title: 'Shorts sale',
amount: '15',
type: 'FixedAmount',
},
},
]);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.removeLineItemDiscount('aa-1234567')}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.removeLineItemDiscount('aa-1234567');
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.removeLineItemDiscount('aa-1234567')}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.removeLineItemDiscount('aa-1234567');
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.clearCart()}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.clearCart();
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.clearCart()}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.clearCart();
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.setCustomer({
id: 1,
})}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.setCustomer({
id: 1,
});
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.setCustomer({
id: 1,
})}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.setCustomer({
id: 1,
});
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.removeCustomer()}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.removeCustomer();
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.removeCustomer()}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.removeCustomer();
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.addCustomSale({
title: 'New product',
quantity: 1,
price: '10.00',
taxable: true,
})}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.addCustomSale({
title: 'New product',
quantity: 1,
price: '10.00',
taxable: true,
});
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.addCustomSale({
title: 'New product',
quantity: 1,
price: '10.00',
taxable: true,
})}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.addCustomSale({
title: 'New product',
quantity: 1,
price: '10.00',
taxable: true,
});
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.addLineItem(12345678, 1)}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.addLineItem(12345678, 1);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.addLineItem(12345678, 1)}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.addLineItem(12345678, 1);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.removeLineItem('aa-1234567')}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.removeLineItem('aa-1234567');
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.removeLineItem('aa-1234567')}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.removeLineItem('aa-1234567');
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.addCartProperties({Engraving: 'John Doe'})}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart action',
enabled: true,
onPress: () => {
api.cart.addCartProperties({Engraving: 'John Doe'});
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.addCartProperties({Engraving: 'John Doe'})}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart action',
enabled: true,
onPress: () => {
api.cart.addCartProperties({Engraving: 'John Doe'});
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.removeCartProperties(['Engraving'])}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.removeCartProperties(['Engraving']);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.removeCartProperties(['Engraving'])}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.removeCartProperties(['Engraving']);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.addLineItemProperties('aa-1234567', {Engraving: 'John Doe'})}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.addLineItemProperties('aa-1234567', {Engraving: 'John Doe'});
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.addLineItemProperties('aa-1234567', {Engraving: 'John Doe'})}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.addLineItemProperties('aa-1234567', {Engraving: 'John Doe'});
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.bulkAddLineItemProperties([
{lineItemUuid: 'aa-1234567', properties: {Engraving: 'John Doe'}},
{lineItemUuid: 'bb-001234567', properties: {Engraving: 'Jane Doe'}}
])}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.bulkAddLineItemProperties([
{lineItemUuid: 'aa-1234567', properties: {Engraving: 'John Doe'}},
{lineItemUuid: 'bb-001234567', properties: {Engraving: 'Jane Doe'}},
]);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.bulkAddLineItemProperties([
{lineItemUuid: 'aa-1234567', properties: {Engraving: 'John Doe'}},
{lineItemUuid: 'bb-001234567', properties: {Engraving: 'Jane Doe'}}
])}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.bulkAddLineItemProperties([
{lineItemUuid: 'aa-1234567', properties: {Engraving: 'John Doe'}},
{lineItemUuid: 'bb-001234567', properties: {Engraving: 'Jane Doe'}},
]);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.removeLineItemProperties('aa-1234567', ['Engraving'])}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.removeLineItemProperties('aa-1234567', ['Engraving']);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.removeLineItemProperties('aa-1234567', ['Engraving'])}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.removeLineItemProperties('aa-1234567', ['Engraving']);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.setAttributedStaff(123456)}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.setAttributedStaff(123456);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.setAttributedStaff(123456)}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.setAttributedStaff(123456);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.setAttributedStaffToLineItem(123456, 'aa-1234567')}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.setAttributedStaffToLineItem(123456, 'aa-1234567');
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.setAttributedStaffToLineItem(123456, 'aa-1234567')}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.setAttributedStaffToLineItem(123456, 'aa-1234567');
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.addAddress({
address1: '123456 Main Street',
city: 'Ottawa',
province: 'Ontario',
firstName: 'John',
lastName: 'Doe',
country: 'Canada'
})}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.addAddress({
address1: '123456 Main Street',
city: 'Ottawa',
province: 'Ontario',
firstName: 'John',
lastName: 'Doe',
country: 'Canada',
});
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.addAddress({
address1: '123456 Main Street',
city: 'Ottawa',
province: 'Ontario',
firstName: 'John',
lastName: 'Doe',
country: 'Canada'
})}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.addAddress({
address1: '123456 Main Street',
city: 'Ottawa',
province: 'Ontario',
firstName: 'John',
lastName: 'Doe',
country: 'Canada',
});
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.deleteAddress(123456)}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.deleteAddress(123456);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.deleteAddress(123456)}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.deleteAddress(123456);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.updateDefaultAddress(123456)}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.updateDefaultAddress(123456);
},
});
root.append(tile);
});
import React from 'react';
import {
reactExtension,
useApi,
Tile
} from '@shopify/ui-extensions-react/point-of-sale';
const SmartGridTile = () => {
const api = useApi<'pos.home.tile.render'>();
return (
<Tile
title='My App'
subtitle='Call cart function'
enabled
onPress={() => api.cart.updateDefaultAddress(123456)}
/>
);
};
export default reactExtension(
'pos.home.tile.render',
() => <SmartGridTile />
);
import {Tile, extension} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.home.tile.render', (root, api) => {
const tile = root.createComponent(Tile, {
title: 'My App',
subtitle: 'Call cart function',
enabled: true,
onPress: () => {
api.cart.updateDefaultAddress(123456);
},
});
root.append(tile);
});