Getting started with Postman and Square’s APIs

Tristan Sokol
Mar 22, 2017 · Unlisted

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

Being able to try out an API as quickly as possible is important when learning about its features. One of the tools to help you get up and running quickly is Postman, which allows you to organize and run groups of REST API calls. We have added a new collection of our API requests to make using Postman even easier—great for both first-time developers and veteran Postman users.

Step 0: Install Postman

Before you can use Postman, you need to install it. Visit and download the preferred version for your system.

Step 1: Get the Postman collection

This step is easy. Just click on the big Run in Postman button on this page and you’ll be prompted to import the collection inside of Postman. You can also find this button in the Square API documentation and the Square API reference.

Step 2: Set up your environment

Our collection makes use of Postman’s environment variables to easily manage your API credentials. Clicking the Gear icon -> Manage Environments -> Add should open up a dialog to create a new environment. You can call the environment square or whatever your want. You will want to add a key of access_token with a value of your access token to handle the authentication for each endpoint. Whenever you see a variable in double brackets like {{location_id}} that indicates a variable that can be pulled from your environment.

Hopefully your environment looks something like this. ️

Step 3: Try out the APIs!

Now it’s time to try out some API calls in Postman!

Our collection has a few folders in it, each with different API calls to fulfil a different task, along with a V1 & V2 reference that contains all of the endpoints. Let’s look at the First Transaction folder. It has all of the calls for a standard e-commerce scenario of creating a customer, charging them, and viewing their resulting transaction. You should be able to run each request in order without any trouble. Relevant IDs in the responses will be automatically added to your environment for subsequent requests. You’ll need to use your API Sandbox credentials to use the testing card nonces.

  • List locations is the first step for almost any calls to the Connect APIs, since the location ID is in the URL for most requests. This one will add the first location that has credit card processing enabled to your environment under location_id.
  • Create a new customer. In order to connect a customer to the transaction, we need to make sure there is a customer. The ID of the created customer will be automatically added to your environment under customer_id.
  • Charge! For this request, we’ve added a fake card nonce, but in a real scenario you would generate the card nonce using the SqPaymentForm and do these transactions server-side.
  • List Transactions. You can now list all the transactions for your location and view the one you just processed!

You can always learn more about the Square APIs in the documentation.

Want more? Sign up for our monthly developer newsletter or join our Slack community!

Square Corner Blog

Buying and selling sound like simple things - and they should be. Somewhere along the way, they got complicated. At Square, we're working hard to make commerce easy for everyone.

Thanks to Alex Rafter and Square Engineering


Tristan Sokol

Written by

Software Lead at NorthPoint Development. When I’m not helping automate a real estate company, I’m growing succulents in my back yard.

Square Corner Blog

Buying and selling sound like simple things - and they should be. Somewhere along the way, they got complicated. At Square, we're working hard to make commerce easy for everyone.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade