I’m migrating from Order REST API to GraphQL. Specifically GET requests for a specific order and list of orders.
As part of our use case, we require the browser_ip
and user_agent
field in client_details
to be migrated. The docs suggest customerJourneySummary
to be the equivalent but I can’t find anything in that attribute that maps to those fields.
Shopify Assistant is suggesting using clientIp
and that user agent is not provided unless we implement it as custom logic. Could I get confirmation if that’s the case?
1 Like
Hey @Chen_Shanhan
- the Shopify Dev Doc Assistant is correct on this one for its suggestion to use orders.clientIp
and that the user agent isn’t provided on the order object in the GraphQL Admin API. In terms of custom logic, I’m not sure what the dev assistance may have suggested, but the most reliable way to implement this would likely be through Hydrogen if you wanted to look at that as an option:
That said, if you’d like to share your use case for needing user_agent exposed through the API, just let me know here and I can do a bit more digging to see if we have any other workarounds. Hope this helps!
Hey @Alan_G, thanks for confirming that we can indeed use orders.clientIp
. The dev assistant didn’t elaborate on the custom logic portion.
For more context, I’m developing this for an app where we use the IP address and user agent to identify customers, something similar to browser fingerprinting.
As this affects multiple different stores, Hydrogen doesn’t look applicable in that case.
Would be happy to hear if you have other workarounds for obtaining the user agent.