How to get Order id key on graphql admin api

I’m listening to the creation of an order using the webhook, but when creating it, I only get the usual order id instead of the one that can be obtained when using the storefront api. How do I get the key with access to the admin. gid://shopify/id?key=thisWhatIWant

There is also a question if I use the admin api to provide services to users, will I be able to bypass the admin rate limit? for example using the Shopify-Storefront-Buyer-IP header?

3 Likes

1 year ago and nobody of Shopify care this one???

Hey @shopyfylord ,

Thanks for the call out. For context, the key parameter referenced here is specific to the storefront API and is used to add buyer information to the checkout. When a buyer navigates to checkout, the key is validated and then removed so that is why it’s not returned in the webhook.

There’s more context on this in a recent changelog post: https://shopify.dev/changelog/storefront-api-cart-checkouturl-now-contains-key-param

If you want to access the order through the storefront API after it’s been placed, that can be done through the customer object: https://shopify.dev/docs/api/storefront/2024-04/objects/Customer#connection-orders

Hope that helps,

  • Kyle G.