Square · Schema
ObtainTokenRequest
BookingLocationSquareRestaurantCatalogCheckoutCustomersDisputesE-CommerceFinancial TechnologyGift CardsInventoryInvoicingLaborLoyaltyMerchantsOrderPaymentsPoint-of-SaleRefundsRetailSubscriptionTeamWebhookPayment ProcessingPayment Terminals
Properties
| Name | Type | Description |
|---|---|---|
| client_id | string | The Square-issued ID of your application, which is available on the **OAuth** page in the [Developer Dashboard](https://developer.squareup.com/apps). |
| client_secret | stringnull | The Square-issued application secret for your application, which is available on the **OAuth** page in the [Developer Dashboard](https://developer.squareup.com/apps). This parameter is only required w |
| code | stringnull | The authorization code to exchange. This code is required if `grant_type` is set to `authorization_code` to indicate that the application wants to exchange an authorization code for an OAuth access to |
| redirect_uri | stringnull | The redirect URL assigned on the **OAuth** page for your application in the [Developer Dashboard](https://developer.squareup.com/apps). |
| grant_type | string | Specifies the method to request an OAuth access token. Valid values are `authorization_code`, `refresh_token`, and `migration_token`. |
| refresh_token | stringnull | A valid refresh token for generating a new OAuth access token. A valid refresh token is required if `grant_type` is set to `refresh_token` to indicate that the application wants a replacement for an e |
| migration_token | stringnull | A legacy OAuth access token obtained using a Connect API version prior to 2019-03-13. This parameter is required if `grant_type` is set to `migration_token` to indicate that the application wants to g |
| scopes | arraynull | A JSON list of strings representing the permissions that the application is requesting. For example, "`["MERCHANT_PROFILE_READ","PAYMENTS_READ","BANK_ACCOUNTS_READ"]`". The access token returned in th |
| short_lived | booleannull | A Boolean indicating a request for a short-lived access token. The short-lived access token returned in the response expires in 24 hours. |
| code_verifier | stringnull | Must be provided when using the PKCE OAuth flow if `grant_type` is set to `authorization_code`. The `code_verifier` is used to verify against the `code_challenge` associated with the `authorization_co |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/api-evangelist/square/main/json-schema/square-obtain-token-request-schema.json",
"title": "ObtainTokenRequest",
"x-generated": "2026-10-12",
"x-method": "derived",
"x-generator": "derive-json-schema.py",
"x-source": "openapi/square-oauth-api-openapi.yml#/components/schemas/ObtainTokenRequest",
"type": "object",
"x-release-status": "PUBLIC",
"required": [
"client_id",
"grant_type"
],
"properties": {
"client_id": {
"type": "string",
"description": "The Square-issued ID of your application, which is available on the **OAuth** page in the\n[Developer Dashboard](https://developer.squareup.com/apps).",
"maxLength": 191
},
"client_secret": {
"type": [
"string",
"null"
],
"description": "The Square-issued application secret for your application, which is available on the **OAuth** page\nin the [Developer Dashboard](https://developer.squareup.com/apps). This parameter is only required when \nyou're not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer.squareup.com/docs/oauth-api/overview#pkce-flow).\nThe PKCE flow requires a `code_verifier` instead of a `client_secret` when `grant_type` is set to `authorization_code`. \nIf `grant_type` is set to `refresh_token` and the `refresh_token` is obtained uaing PKCE, the PKCE flow only requires `client_id`, \n`grant_type`, and `refresh_token`.",
"minLength": 2,
"maxLength": 1024
},
"code": {
"type": [
"string",
"null"
],
"description": "The authorization code to exchange.\nThis code is required if `grant_type` is set to `authorization_code` to indicate that\nthe application wants to exchange an authorization code for an OAuth access token.",
"maxLength": 191
},
"redirect_uri": {
"type": [
"string",
"null"
],
"description": "The redirect URL assigned on the **OAuth** page for your application in the [Developer Dashboard](https://developer.squareup.com/apps).",
"maxLength": 2048
},
"grant_type": {
"type": "string",
"description": "Specifies the method to request an OAuth access token.\nValid values are `authorization_code`, `refresh_token`, and `migration_token`.",
"minLength": 10,
"maxLength": 20
},
"refresh_token": {
"type": [
"string",
"null"
],
"description": "A valid refresh token for generating a new OAuth access token.\n\nA valid refresh token is required if `grant_type` is set to `refresh_token`\nto indicate that the application wants a replacement for an expired OAuth access token.",
"minLength": 2,
"maxLength": 1024
},
"migration_token": {
"type": [
"string",
"null"
],
"description": "A legacy OAuth access token obtained using a Connect API version prior\nto 2019-03-13. This parameter is required if `grant_type` is set to\n`migration_token` to indicate that the application wants to get a replacement\nOAuth access token. The response also returns a refresh token.\nFor more information, see [Migrate to Using Refresh Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-tokens).",
"minLength": 2,
"maxLength": 1024
},
"scopes": {
"type": [
"array",
"null"
],
"items": {
"type": "string"
},
"description": "A JSON list of strings representing the permissions that the application is requesting.\nFor example, \"`[\"MERCHANT_PROFILE_READ\",\"PAYMENTS_READ\",\"BANK_ACCOUNTS_READ\"]`\".\n\nThe access token returned in the response is granted the permissions\nthat comprise the intersection between the requested list of permissions and those\nthat belong to the provided refresh token."
},
"short_lived": {
"type": [
"boolean",
"null"
],
"description": "A Boolean indicating a request for a short-lived access token.\n\nThe short-lived access token returned in the response expires in 24 hours."
},
"code_verifier": {
"type": [
"string",
"null"
],
"description": "Must be provided when using the PKCE OAuth flow if `grant_type` is set to `authorization_code`. The `code_verifier` is used to verify against the\n`code_challenge` associated with the `authorization_code`."
}
},
"x-sq-sdk-sample-code": {
"csharp": "/sdk_samples/ObtainToken/ObtainTokenRequest.csharp",
"java": "/sdk_samples/ObtainToken/ObtainTokenRequest.java",
"javascript": "/sdk_samples/ObtainToken/ObtainTokenRequest.javascript",
"php": "/sdk_samples/ObtainToken/ObtainTokenRequest.php",
"python": "/sdk_samples/ObtainToken/ObtainTokenRequest.python",
"ruby": "/sdk_samples/ObtainToken/ObtainTokenRequest.ruby"
}
}
Work with this as data
Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for schemas
4 MCP tools reach this
find_json_schemasBrowse and filter every JSON Schema in the catalog.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.
Call it yourself
curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/square-obtain-token-request"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.