Listing your locations with Python
Getting your location details should be the easiest part of your integration.
Heads up, we’ve moved! If you’d like to continue keeping up with the latest technical content from Square please visit us at our new home https://developer.squareup.com/blog
Listing your locations programmatically can be important for managing applications for large companies or even multiple companies. Here is how you can get a list of your locations using our Python SDK.
Prepare
The first thing you’ll need to do is make sure that you have python working and install Square’s Python SDK. You can find the installation instructions here: https://github.com/square/connect-python-sdk#installation--usage
The Code
You’ll have to replace the XXXXXXXXX
with your access token from your Square Developer Portal. but then you should be able to save the above code to a file ListLocations.py
and then run the file with:
python ListLocations.py
Then, your locations should print on on this screen:
Hope you find this post on listing locations useful! Remember that you can now also get your location ID’s from the Developer Portal.