Generate URL to Order Page in Shopify Flow

Topic summary

Problem Identified:
When generating backend order page URLs in Shopify Flow using {{order.id}}, the output includes a GraphQL ID format (gid://shopify/Order/...) instead of the numerical order ID, breaking the admin URL structure.

Solution:
Use {{order.legacyResourceId}} instead of {{order.id}} to retrieve only the numerical ID.

Working URL format:

https://XXXX.myshopify.com/admin/orders/{{order.legacyResourceId}}

Additional Applications:

  • Customer links: {{customer.legacyResourceId}} resolves the same GID issue for customer admin pages
  • Product links: {{product.legacyResourceId}} works for product admin pages

Status: Resolved. The thread serves as a reference for others encountering similar GID formatting issues when building admin URLs in Shopify Flow.

Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

Hello, I am trying to use Shopify Flow to create a message which contains a link to the order page. The backend order page, not the customer-facing order page.

Here is what I am using that I thought should work:

https://XXXX.myshopify.com/admin/orders/{{order.id}}

But this is returning:

https://XXX.myshopify.com/admin/orders/gid://shopify/Order/4472173920411

Is there a way to get just the order id without the leading “gid://shopify/Order/”? Otherwise, is there a way to strip that section so it just returns the numerical order id?

Thanks!

1 Like

Figured it out. Posting for future reference. Use {{order.legacyResourceId}} if you want to avoid the extra GID text.

https://XXXX.myshopify.com/admin/orders/{{order.legacyResourceId}}

11 Likes

For future references, the same happen with customer.id in Shopify Flow Email.

{{customer.id}} -> gid://shopify/Customer/6877777....

Use instead:

{{customer.legacyResourceId}} -> 678.....

For better use:
[{{customer.legacyResourceId}}](https://STORENAME.myshopify.com/admin/customers/{{customer.legacyResourceId}})
2 Likes

Just posting this for anyone else thats out there, but i was getting the same issue when trying to link to a product from the flows.

It works using the same logic, but replacing order with product = {{product.legacyResourceId}}

1 Like