1
votes

I am integrating Square into my Android app.

I am struggling with where to find the locationId to pass to the enforceBusinessLocation() method. I've set up a location in my Square dashboard but it isn't obvious where to get the locationId from.

I've tried using the location nickname (I tried both mixed case and uppercase - so, in my case, "mwe" and "MWE"), but that didn't work. It results in:

ILLEGAL_LOCATION_ID: The LOCATION_ID parameter does not match the ID of the business location currently logged in to Square Register.

I have selected that same location when logging into the Square Register app on the device.

I understand the locationId is optional, but I would like to include it.

So where to find the locationId as required for enforceBusinessLocation()?

2
I actually found the IDs when clicking a link on the contact form ( squareup.com/help/gb/en/contact?prefill=developer_api ) to report this issue. By inspecting the location fields with Firebug, I was able to find the 13-character locationIds. But what is the normal way of doing it? - ban-geoengineering

2 Answers

2
votes

There is a much easier way to get it. Just log in and click on Accounts & Settings, click on Locations (here's a shortcut), click the location and then you can see URL of the page change. The location ID is the last part of the URL.