Android 方形寄存器 API: ILLEGAL_LOCATION_ID
Android Square Register API: ILLEGAL_LOCATION_ID
我正在将 Square 集成到我的 Android 应用程序中。
我正在努力寻找要传递给 enforceBusinessLocation()
方法的 locationId
的位置。我已经在我的 Square dashboard 中设置了一个位置,但不清楚从哪里获取 locationId
。
我试过使用位置 昵称(我尝试了混合大小写和大写 - 所以,在我的例子中,"mwe" 和 "MWE") ,但这没有用。结果是:
ILLEGAL_LOCATION_ID: The LOCATION_ID parameter does not match the ID
of the business location currently logged in to Square Register.
我在设备上登录 Square Register 应用程序时选择了相同的位置。
我知道 locationId
是可选的,但我想包括它。
那么在哪里可以找到 enforceBusinessLocation()
所需的 locationId
?
您可以使用 /v1/me/locations
或 /v2/locations
端点获取您的位置。
https://docs.connect.squareup.com/api/connect/v2/#endpoint-listlocations
https://docs.connect.squareup.com/api/connect/v1/#get-locations
有一种更简单的方法可以获取它。只需log in and click on Accounts & Settings, click on Locations (here's a shortcut),点击位置即可看到URL的页面变化。位置 ID 是 URL.
的最后一部分
我正在将 Square 集成到我的 Android 应用程序中。
我正在努力寻找要传递给 enforceBusinessLocation()
方法的 locationId
的位置。我已经在我的 Square dashboard 中设置了一个位置,但不清楚从哪里获取 locationId
。
我试过使用位置 昵称(我尝试了混合大小写和大写 - 所以,在我的例子中,"mwe" 和 "MWE") ,但这没有用。结果是:
ILLEGAL_LOCATION_ID: The LOCATION_ID parameter does not match the ID of the business location currently logged in to Square Register.
我在设备上登录 Square Register 应用程序时选择了相同的位置。
我知道 locationId
是可选的,但我想包括它。
那么在哪里可以找到 enforceBusinessLocation()
所需的 locationId
?
您可以使用 /v1/me/locations
或 /v2/locations
端点获取您的位置。
https://docs.connect.squareup.com/api/connect/v2/#endpoint-listlocations https://docs.connect.squareup.com/api/connect/v1/#get-locations
有一种更简单的方法可以获取它。只需log in and click on Accounts & Settings, click on Locations (here's a shortcut),点击位置即可看到URL的页面变化。位置 ID 是 URL.
的最后一部分