OrderAPI
API
The API for interacting with the order confirmation, available on the Thank You page.
Anchor to orderconfirmationapiOrderConfirmationApi
The API object provided to purchase.thank-you
extension targets.
Anchor to orderConfirmation
orderConfirmation
StatefulRemoteSubscribable<>
required
Order information that's available post-checkout.
Was this section helpful?
Order confirmation
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;
}