What template variables work on Shopify checkout success page?

I’m working on a custom order tracking system for my Shopify store and I need some help with template variables on the checkout success page.

I have this simple code that grabs order details:

<div>
    Order number: {{order_id}} - This is just example code
    to show what I'm trying to do
</div>

The problem is that recently the {{order_id}} variable started returning what looks like a checkout session ID instead of the actual order ID that I need. I use this order ID to pull data from Shopify’s REST API for my fulfillment process.

Has anyone else noticed this change? Is there a different variable I should be using to get the real order ID? This setup has been working fine for years so I’m not sure what changed. Any suggestions would be really helpful!

yeah, I had that issue too a while back. you might wanna use {{order.id}} or {{checkout.order_id}} instead. one of those should get the real order ID, not the session ID. so frustrating how Shopify keeps tweaking stuff without heads up.

Had the same issue about six months back when Shopify updated their checkout. Use {{order.order_number}} - that’ll give you the actual order number from the admin panel, not the internal ID. Need the numerical ID for API calls? Try {{order.id}} but test it well since some stores had inconsistencies during the transition. That checkout session ID problem happened because Shopify changed their success page routing. I had to update several custom scripts and found that using order object properties instead of direct variables fixed most compatibility issues.

This broke after Shopify rolled out checkout extensibility last year. They restructured the template variables, so now {{order_id}} pulls from session context instead of the actual order record. I’ve fixed this on multiple stores - use {{order.id}} for API calls since it gives you the proper numeric ID for REST endpoints. Just make sure your success page template can access the order object. Some themes still use the old checkout structure. If {{order.id}} doesn’t work, you’ll need to update your theme’s checkout templates so the order data gets passed through properly. This timing matches when they pushed the new checkout experience to more stores, which is why it worked fine for years then suddenly died.

Ugh, just dealt with this! Use {{order.name}} for the display number or {{order.id}} for API calls. Shopify’s checkout updates broke tons of custom integrations and they didn’t even update the docs properly.