Checkout TokenAPI
The API for interacting with the token of a checkout.
Anchor to standardapiStandardApi
The base API object provided to purchase
, and customer-account.order-status
extension targets.
- Anchor to checkoutTokencheckoutTokenStatefulRemoteSubscribable< | undefined>required
A stable id that represents the current checkout.
Matches the
token
field in the WebPixel checkout payload and thefield in the Admin REST API Order resource.
Docs_Standard_CheckoutTokenApi
- checkoutToken
A stable id that represents the current checkout. Matches the `token` field in the [WebPixel checkout payload](/docs/api/pixels/customer-events#checkout) and the `checkout_token` field in the [Admin REST API Order resource](/docs/api/admin-rest/unstable/resources/order#resource-object).
StatefulRemoteSubscribable<CheckoutToken | undefined>
export interface Docs_Standard_CheckoutTokenApi
extends Pick<StandardApi, 'checkoutToken'> {}
CheckoutToken
string
Anchor to useCheckoutTokenuse Checkout Token()
Returns a stable id that represents the current checkout.
UseCheckoutTokenGeneratedType
A stable id that represents the current checkout. Matches the `token` field in the [WebPixel checkout payload](/docs/api/pixels/customer-events#checkout) and the `checkout_token` field in the [Admin REST API Order resource](/docs/api/admin-rest/unstable/resources/order#resource-object).
CheckoutToken | undefined
export function useCheckoutToken<
Target extends RenderExtensionTarget = RenderExtensionTarget,
>(): CheckoutToken | undefined {
return useSubscription(useApi<Target>().checkoutToken);
}
CheckoutToken
string