use Orderhook
hook
Returns the order information that's available post-checkout.
Anchor to useOrderuse Order()
use Order()
Anchor to useOrder-returnsReturns
| undefined
UseOrderGeneratedType
Returns the order information that's available post-checkout.
Order | undefined
export function useOrder<
ID extends RenderExtensionPoint = RenderExtensionPoint,
>(): Order | undefined {
const api = useApi<ID>();
if ('order' in api) {
return useSubscription(api.order);
}
throw new ExtensionHasNoMethodError('order', api.extensionPoint);
}
Order
Information about an order that was placed.
- id
A globally-unique identifier.
string
- name
Unique identifier for the order that appears on the order.
string
- cancelledAt
If cancelled, the time at which the order was cancelled.
string
export interface Order {
/**
* A globally-unique identifier.
* @example 'gid://shopify/Order/1'
*/
id: string;
/**
* Unique identifier for the order that appears on the order.
* @example '#1000'
*/
name: string;
/**
* If cancelled, the time at which the order was cancelled.
*/
cancelledAt?: string;
}
Was this section helpful?