Android Square Register API: ILLEGAL_LOCATION_ID

瘦欲@ 提交于 2019-12-11 05:28:17

问题


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()?


回答1:


You can get your locations with the /v1/me/locations or /v2/locations endpoints.

https://docs.connect.squareup.com/api/connect/v2/#endpoint-listlocations https://docs.connect.squareup.com/api/connect/v1/#get-locations




回答2:


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



来源:https://stackoverflow.com/questions/39650376/android-square-register-api-illegal-location-id

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!