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
quickstart
directory -
copy
.env.example
to.env
and replace with your access tokenSQUARE_ACCESS_TOKEN=yourSandboxAccessToken
-
Create a virtual environment
$ python3 -m venv env
-
Activate the environment
$ source env/bin/activate
-
Install dependencies
$ pip3 install -r requirements.txt
-
Install the latest Square SDK
$ pip3 install squareup
-
Run the code
$ python3 ./quickstart.py
-
You 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