Authorizing Square API in Astera
Last updated
Last updated
© Copyright 2023, Astera Software
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 REST API Browser.
After you have created the application in Square, go to Manage Properties.
Now go to OAuth properties in the 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.
Now create an integration project in Astera. Also, import the following swagger definition in the REST API Browser:
Base Url: https://raw.githubusercontent.com/square/connect-api-specification/master/api.json
Go to the Square’s shared action file’s (.sact) properties to authenticate it in Astera. Click here to learn more about how to work with APIs that require authentication.
You can authorize Square API by using Security Type OAuth 2 or Bearer Token. In this example, we will be authorizing using OAuth 2.
Set its Security Type as ‘OAuth 2’ and Grant Type as ‘Authentication Code’. Provide the application ID and secret that you had 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.
Once you get the access token, save the Shared Action file and you are ready to use Square API in Astera.
This concludes with authenticating the Square API in Astera.