Skip to main content

Checkout Token API

The Checkout Token API provides access to the unique token that identifies the current checkout session. Use this API to link extension activity with server-side checkout records, or display a support reference for the buyer.

The checkout token can be undefined. Always handle this state before using the value.

  • Link extension data to orders: Send the checkout token to your backend so you can join it with the REST Admin API Order checkout_token field and WebPixel data.checkout.token for cross-system debugging.
  • Display a support reference: Show the buyer a reference ID they can share with customer support to speed up issue resolution.
Support
Targets (33)

The shopify global object provides token data for the current checkout. Access the following property on shopify to retrieve the checkout session identifier. Available to purchase extension targets.

Anchor to checkoutToken
checkoutToken
< | undefined>
required

A stable ID that represents the current checkout.

The value is undefined when the checkout hasn't been created on the server yet.

Use this to correlate checkout sessions across your extension, web pixels, and backend systems.

This matches the data.checkout.token field in a checkout-related WebPixel event and the checkout_token field in the REST Admin API Order resource.

Can be undefined. Handle the undefined state before using the value.


  • Use the token as a correlation key: Store the checkout token alongside your backend events so you can join extension activity with WebPixel events (data.checkout.token) and the REST Admin API Order (checkout_token) for cross-system debugging and analytics.

Was this page helpful?