Authorizing the Square API

Square API is an HTTP-based API that follows REST standards. It allows you to manage the resources of your Square account by making requests to URLs representing those resources. You can configure Square API for use in Astera by providing its swagger definition using the Import API option in the API Browser.

  1. After you have created the application in Square, go to Manage Properties.

  1. Now go to OAuth properties in Production tab. Here, you have to provide the Redirect URL for the authorization callback.

Note: Save Applicant ID and secret to use it later for Astera authentication.

Reference Link: https://developer.squareup.com/docs/oauth-api/overview

  1. Now create an integration project in Astera. Also, import the following swagger definition in the API Browser:

Base Url: https://raw.githubusercontent.com/square/connect-api-specification/master/api.json

  1. Go to the Square’s shared action file’s (.sact) properties to authenticate it in Astera.

You can authorize Square API by using Security Type OAuth 2 or Bearer Token. In this example, we will be authorizing using OAuth 2.

  1. Set its Security Type as ‘OAuth 2’ and Grant Type as ‘Authentication Code’. Provide the application ID and secret that you saved in step 2.

Click on Request Token to get the access token to Square API.

Auth Url: https://connect//squareup.com/oauth2/authorize

Access Token Url: https://connect.squareup.com/oauth2/token

Additional Info: You can modify your authorization by mentioning the names of only those permissions that you want to access from your Square account in Astera. In case you want to access all of them, leave the settings at default.

  1. Once you get the access token, save the Shared Action file and you are ready to use Square API in Astera.

This concludes authenticating the Square API in Astera.

Last updated

© Copyright 2023, Astera Software