Skip to Content

Square

The Square enables tools and to call Square APIs  on behalf of a using OAuth 2.0 authentication.

Want to quickly get started with Square in your or AI app? The pre-built Arcade Square MCP Server is what you want!

What’s documented here

This page describes how to use and configure Square auth with Arcade.

This is used by:

Configuring Square auth

When using your own app credentials, make sure you configure your to use a custom user verifier. Without this, your end-users will not be able to use your app or in production.

In a production environment, you will most likely want to use your own Square app credentials. This way, your will see your application’s name requesting permission.

Before showing how to configure your Square app credentials, let’s go through the steps to create a Square app.

Create a Square app

To integrate with Square’s API, you’ll need to create an application in the Square Developer Dashboard:

Access the Square Developer Dashboard

Navigate to the Square Developer Portal  and sign in with your Square or create a new one.

Create a new application

  1. Once logged in, go to the Developer Dashboard 
  2. Click on “Create App” or ”+” button
  3. Fill in the required details:
    • App Name: Choose a descriptive name for your application
    • Description: Provide a brief description of your app’s purpose

Configure OAuth settings

  1. After creating your app, navigate to the OAuth tab
  2. Set the Redirect URL to the redirect URL generated by Arcade (see configuration section below)
  3. Configure the required Permissions (scopes) for your application:
    • MERCHANT_PROFILE_READ - Read merchant profile information
    • PAYMENTS_READ - Read payment information
    • PAYMENTS_WRITE - Process payments
    • Add other scopes as needed for your use case

Obtain your credentials

  1. In your app’s dashboard, go to the Credentials tab
  2. You’ll find your Application ID (Client ID) and Application Secret (Client Secret)
  3. Copy both values for use in Arcade configuration

For detailed instructions, refer to Square’s OAuth documentation .

Next, add the Square app to Arcade.

Configuring your own Square Auth Provider in Arcade

Configure Square Auth Using the Arcade Dashboard GUI

Access the Arcade Dashboard

To access the Arcade Cloud dashboard, go to api.arcade.dev/dashboard . If you are self-hosting, by default the dashboard will be available at http://localhost:9099/dashboard . Adjust the host and port number to match your environment.

  • Under the OAuth section of the Arcade Dashboard left-side menu, click Providers.
  • Click Add OAuth Provider in the top right corner.
  • Select the OAuth 2.0 tab at the top.

Enter the provider details

  • Choose a unique ID for your provider (e.g. “arcade-square”).
  • Optionally enter a Description.
  • Enter the Client ID (Application ID) and Client Secret (Application Secret) from your Square app.
  • Configure the OAuth 2.0 endpoints:
    • Authorization URL: https://connect.squareup.com/oauth2/authorize
    • Token URL: https://connect.squareup.com/oauth2/token
  • Note the Redirect URL generated by Arcade. This must be set as your Square app’s Redirect URL.

Create the provider

Hit the Create button and the provider will be ready to be used.

When you use tools that require Square auth using your Arcade credentials, Arcade will automatically use this Square OAuth provider. If you have multiple Square providers, see using multiple auth providers of the same type for more information.

Using Square auth in app code

Use the Square in your own and AI apps to get a token for the Square API. See authorizing agents with Arcade to understand how this works.

Use client.auth.start() to get a token for the Square API:

Python
from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable user_id = "{arcade_user_id}" # Start the authorization process auth_response = client.auth.start( user_id=user_id, provider="arcade-square", scopes=["MERCHANT_PROFILE_READ", "PAYMENTS_READ"] ) if auth_response.status != "completed": print("Please complete the authorization challenge in your browser:") print(auth_response.url) # Wait for the authorization to complete auth_response = client.auth.wait_for_completion(auth_response) token = auth_response.context.token # Do something interesting with the token...

Using Square auth in custom tools

You can use the pre-built Arcade Square MCP Server to quickly build and AI apps that interact with Square.

If the pre-built tools in the Square Server don’t meet your needs, you can author your own custom tools that interact with the Square API.

Use the OAuth2() auth class to specify that a requires authorization with Square. The context.authorization.token field will be automatically populated with the ’s Square token:

Python
from typing import Annotated import httpx from arcade_tdk import ToolContext, tool from arcade_tdk.auth import OAuth2 @tool( requires_auth=OAuth2( provider_id="arcade-square", scopes=["MERCHANT_PROFILE_READ"] ) ) async def get_merchant_info( context: ToolContext, ) -> Annotated[dict, "The merchant information."]: """ Retrieve merchant profile information from Square. """ url = "https://connect.squareup.com/v2/merchants/me" headers = { "Authorization": context.authorization.token, "Content-Type": "application/json", } async with httpx.AsyncClient() as client: response = await client.get(url, headers=headers) response.raise_for_status() return dict(response.json())

Available Scopes

Square supports various OAuth scopes that determine the level of access your application has:

  • MERCHANT_PROFILE_READ - Read merchant profile information
  • PAYMENTS_READ - Read payment information
  • PAYMENTS_WRITE - Process payments
  • CUSTOMERS_READ - Read customer information
  • CUSTOMERS_WRITE - Create and update customers
  • ORDERS_READ - Read order information
  • ORDERS_WRITE - Create and update orders
  • INVENTORY_READ - Read inventory information
  • INVENTORY_WRITE - Update inventory

For a complete list of available scopes, refer to the Square OAuth Permissions documentation .

Last updated on