The Draft Order API provides an extension with data about the current draft order. #### Supporting targets - [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)
The unique identifier of the customer associated with the draft order
The unique identifier for the draft order
The name of the draft order
The Draft Order API provides an extension with data about the current draft order. #### Supporting targets - [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 {
Text,
Screen,
ScrollView,
Navigator,
reactExtension,
useApi,
} from '@shopify/ui-extensions-react/point-of-sale';
const Modal = () => {
const api = useApi<'pos.draft-order-details.action.render'>();
return (
<Navigator>
<Screen name="DraftOrderDetailsAction" title="Draft Order Details Action">
<ScrollView>
<Text>{`Order ID: ${api.draftOrder.id}`}</Text>
</ScrollView>
</Screen>
</Navigator>
);
};
export default reactExtension('pos.draft-order-details.action.render', () => (
<Modal />
));
import {
Navigator,
Screen,
ScrollView,
Text,
extension,
} from '@shopify/ui-extensions/point-of-sale';
export default extension(
'pos.draft-order-details.action.render',
(root, api) => {
const navigator = root.createComponent(Navigator);
const screen = root.createComponent(Screen, {
name: 'DraftOrderDetailsAction',
title: 'Draft Order Details Action',
});
const scrollView = root.createComponent(ScrollView);
const text = root.createComponent(Text);
text.append(`ID for current draft order screen: ${api.draftOrder.id}`);
scrollView.append(text);
screen.append(scrollView);
navigator.append(screen);
root.append(navigator);
},
);
import React from 'react';
import {
Text,
Screen,
ScrollView,
Navigator,
reactExtension,
useApi,
} from '@shopify/ui-extensions-react/point-of-sale';
const Modal = () => {
const api = useApi<'pos.draft-order-details.action.render'>();
return (
<Navigator>
<Screen name="DraftOrderDetailsAction" title="Draft Order Details Action">
<ScrollView>
<Text>{`Order ID: ${api.draftOrder.id}`}</Text>
</ScrollView>
</Screen>
</Navigator>
);
};
export default reactExtension('pos.draft-order-details.action.render', () => (
<Modal />
));
import {
Navigator,
Screen,
ScrollView,
Text,
extension,
} from '@shopify/ui-extensions/point-of-sale';
export default extension(
'pos.draft-order-details.action.render',
(root, api) => {
const navigator = root.createComponent(Navigator);
const screen = root.createComponent(Screen, {
name: 'DraftOrderDetailsAction',
title: 'Draft Order Details Action',
});
const scrollView = root.createComponent(ScrollView);
const text = root.createComponent(Text);
text.append(`ID for current draft order screen: ${api.draftOrder.id}`);
scrollView.append(text);
screen.append(scrollView);
navigator.append(screen);
root.append(navigator);
},
);