The API for interacting with the order confirmation, available on the **Thank You** page.
import {
reactExtension,
Banner,
useApi,
useSubscription,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.thank-you.block.render',
() => <Extension />,
);
function Extension() {
const {orderConfirmation} = useApi();
const {id} = useSubscription(orderConfirmation);
if (id) {
return (
<Banner>
Please include your order confirmation ID
({id}) in support requests
</Banner>
);
}
return null;
}
import {
Banner,
extension,
} from '@shopify/ui-extensions/checkout';
export default extension(
'purchase.thank-you.block.render',
(root, {orderConfirmation}) => {
let bannerShown = false;
orderConfirmation.subscribe(
(orderConfirmation) => {
if (orderConfirmation && !bannerShown) {
root.appendChild(
root.createComponent(
Banner,
undefined,
`Please include your order confirmation ID (${orderConfirmation.id}) in support requests`,
),
);
bannerShown = true;
}
},
);
},
);
The API object provided to `purchase.thank-you` extension targets.
Order information that's available post-checkout.
A randomly generated alpha-numeric identifier for the order. For orders created in 2024 and onwards, the number will always be present. For orders created before that date, the number might not be present.
> Note: This documentation has moved to customer accounts. Refer to [Order API](/docs/api/customer-account-ui-extensions/apis/order)
interface OrderStatusApiEmpty {}