This quickstart sample creates a Square client instance with your Square access token and then lists the locations in your account. The sample is based on the Python SDK Quickstart guide.
Install Python - If you don't have dotnet already installed on your machine.
Change into the
quickstartdirectorycopy
.env.exampleto.envand replace with your access tokenSQUARE_ACCESS_TOKEN=yourSandboxAccessTokenCreate a virtual environment
$ python3 -m venv envActivate the environment
$ source env/bin/activateInstall dependencies
$ pip3 install -r requirements.txtInstall the latest Square SDK
$ pip3 install squareupRun the code
$ python3 ./quickstart.pyYou should see output similar to this in your console
LHJ1ZXP3YSV8X: Default Test Account, 1600 Pennsylvania Ave NW, Washington
Square Python SDK Guide - details on how to use / configure the Square client.
Pip repository for Square - Where the package files are hosted
Python SDK Source Code - Github repo with sdk source code