Skip to main content

Order
API

The API for interacting with the order, available on the Order status page.

Anchor to orderconfirmationapiOrderConfirmationApi

The API object provided to purchase.thank-you extension targets.

StatefulRemoteSubscribable<>
required

Order information that's available post-checkout.

Was this section helpful?

The API object provided to customer-account.order-status extension targets.

StatefulRemoteSubscribable< | undefined>
required

Order information that's available post-checkout.

Was this section helpful?

Returns the order information that's available on the Order status page.

| undefined
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;
}

Use the order API on the Order status page. This is applicable to the customer-account.orders-status extension targets only.

Was this section helpful?

Order status

import {
reactExtension,
Banner,
useOrder,
} from '@shopify/ui-extensions-react/customer-account';

export default reactExtension(
'customer-account.order-status.customer-information.render-after',
() => <Extension />,
);

function Extension() {
const order = useOrder();

if (order) {
return (
<Banner>
Please include your order ID ({order.id})
in support requests
</Banner>
);
}

return null;
}