POST /oauth2/token
Returns an OAuth access token.
The endpoint supports distinct methods of obtaining OAuth access tokens.
Applications specify a method by adding the grant_type
parameter
in the request and also provide relevant information.
Note: Regardless of the method application specified, the endpoint always returns two items; an OAuth access token and a refresh token in the response.
OAuth tokens should only live on secure servers. Application clients should never interact directly with OAuth tokens.
Servers
- https://connect.squareup.com
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
scopes[] |
Array | No |
A JSON list of strings representing the permissions the application is requesting.
For example: " |
client_id |
String | Yes |
The Square-issued ID of your application, available from the developer dashboard. |
client_secret |
String | Yes |
The Square-issued application secret for your application, available from the developer dashboard. |
migration_token |
String | No |
Legacy OAuth access token obtained using a Connect API version prior
to 2019-03-13. This parameter is required if |
grant_type |
String | Yes |
Specifies the method to request an OAuth access token.
Valid values are: |
code |
String | No |
The authorization code to exchange.
This is required if |
redirect_uri |
String | No |
The redirect URL assigned in the developer dashboard. |
short_lived |
Boolean | No |
A boolean indicating a request for a short-lived access token. The short-lived access token returned in the response will expire in 24 hours. |
refresh_token |
String | No |
A valid refresh token for generating a new OAuth access token.
A valid refresh token is required if |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.