How does Zendesk capture the location of the customer? Can I get the customer location through the API?
The user's location is based on the IP address of the user, captured at the moment of the ticket creation. In some cases, when the end user uses a firewall or a proxy, the information can be displayed as null, with an empty value, or inaccurate.
It is not possible to capture the end-user's location or set up the location manually in tickets created through the API. The location displayed in these tickets is the location of the server of the script making a call to the API.
For Zendesk Chat, the user's location is also retrieved based on the IP address of the visitor. However, the location sometimes may not provide a specific city or even state as these are the only data available for that specific IP address.
For related information, see this section: Users, groups, and organizations.