Cart_token is null when order placed using web

Topic summary

A Shopify webhook for order capture is returning a null cart_token even when orders have source_name “web.” Documentation indicates cart_token should be null only for POS or Control Panel (Admin) orders, and non-null for orders placed directly on the online store.

Context: A custom widget lets customers select a project during checkout, and the developer expects to receive a cart_token upon order completion to link the order to the originating cart.

Observation: Orders tagged with source_name “web” still arrive with cart_token unset via the webhook/API.

Expectation vs. reality: Expected non-null cart_token for online store orders; actual behavior shows cart_token is null.

Status: No resolution or explanation provided yet; seeking clarification on why cart_token is not populated for web-sourced orders. No code or attachments are central to understanding.

Summarized with AI on January 14. AI used: gpt-5.

I’ve configured a webhook in my Shopify store to capture order details via my API. According to the documentation, if an order is made using POS or the Control Panel, the cart_token value will be null. Conversely, if a customer directly orders from my store, the cart_token value is expected to have a non-null value. In my widget, customers select a project during the ordering process, and upon order completion, I anticipate receiving a cart_token. The challenge arises because Shopify isn’t populating the cart_token, even when the “source_name” is tagged as “web.” I presume that when the source_name is “web,” the cart_token should not be null, as this order is directly placed through the website, not via POS or the control panel.

3 Likes