Square CLI for AI Agents

CLIs are eating MCPs. The industry is converging on the very same idea. MCPs for all their merit can be token hungry, slow, and unreliable for complex tool chaining. However, coding agents have become incredibly good at working with CLIs, and in fact they are far more comfortable working with CLI tools than MCP. With Composio's Universal CLI, your coding agents can talk to over 1000+ SaaS applications. With Square, agents can create and send an invoice to a customer, list all recent payments from last week, update item prices in your product catalog, and more — all without worrying about authentication. This guide walks you through Composio Universal CLI and explains how you can connect it with coding agents like Claude Code, Codex, OpenCode, etc, for end-to-end Square automation.

Square logoSquare
Oauth2

Square is a platform for payment processing, POS, invoicing, and e-commerce. It empowers businesses to accept payments, manage sales, and streamline operations from one place.

96 Tools

Introduction

CLIs are eating MCPs. The industry is converging on the very same idea. MCPs for all their merit can be token hungry, slow, and unreliable for complex tool chaining. However, coding agents have become incredibly good at working with CLIs, and in fact they are far more comfortable working with CLI tools than MCP.

With Composio's Universal CLI, your coding agents can talk to over 1000+ SaaS applications. With Square, agents can create and send an invoice to a customer, list all recent payments from last week, update item prices in your product catalog, and more — all without worrying about authentication.

This guide walks you through Composio Universal CLI and explains how you can connect it with coding agents like Claude Code, Codex, OpenCode, etc, for end-to-end Square automation.

Also integrate Square with

What is Universal CLI and why use it?

The idea behind building the universal CLI is to give agents a single command interface to interact with all your external applications. Here's what you'll get with it:

  • Agent-friendly: Coding agents like Claude Code, Codex, and OpenCode can use CLI tools natively — no MCP setup required.
  • Authentication handled: Connect once via OAuth or API Key, and all CLI commands work with your credentials automatically.
  • Tool discovery: Search, inspect, and execute 20,000+ tools across 1000+ apps from one interface.
  • Trigger support: Use triggers to listen for events across your apps, powered by real-time webhooks or polling under the hood.
  • Type generation: Generate typed schemas for autocomplete and type safety in your projects.

Prerequisites

Install the Composio CLI, authenticate, and initialize your project:

bash
# Install the Composio CLI
curl -fsSL https://composio.dev/install | bash

# Authenticate with Composio
composio login

During login you'll be redirected to sign in page, finish the complete flow and you're all set.

Composio CLI authentication flow

Connecting Square to Coding Agents via Universal CLI

Once it is installed, it's essentially done. Claude Code, Codex, OpenCode, OpenClaw, or any other agent will be able to access the CLI. A few steps to give agents access to your apps.

  1. Launch your Coding Agent — Claude Code, Codex, OpenCode, anything you prefer.
  2. Prompt it to "Authenticate with Square"
  3. Complete the authentication and authorization flow and your Square integration is all set.
  4. Start asking anything you want.

Universal CLI Commands for Square

You can also manually execute CLI commands to interact with your Square.

Connect your Square account

Link your Square account and verify the connection:

bash
# Connect your Square account (opens OAuth flow)
composio connected-accounts link square

# Verify the connection
composio connected-accounts list --toolkits square

Discover Square tools

Search and inspect available Square tools:

bash
# List all available Square tools
composio tools list --toolkit square

# Search for Square tools by action
composio tools search "square"

# Inspect a tool's input schema
composio tools info SQUARE_TOOL_NAME

Common Square Actions

Accept DisputeAccept a dispute and acknowledge liability, returning funds to the cardholder

bash
composio tools execute SQUARE_ACCEPT_DISPUTE

Add Group to CustomerTool to add a customer to a customer group

bash
composio tools execute SQUARE_ADD_GROUP_TO_CUSTOMER

Calculate OrderTool to preview order pricing without creating an order

bash
composio tools execute SQUARE_CALCULATE_ORDER

Cancel InvoiceCancels a Square invoice, preventing further payments from being collected

bash
composio tools execute SQUARE_CANCEL_INVOICE

Generate Type Definitions

Generate typed schemas for Square tools to get autocomplete and type safety in your project:

bash
# Auto-detect language
composio generate --toolkits square

# TypeScript
composio ts generate --toolkits square

# Python
composio py generate --toolkits square

Tips & Tricks

  • Always inspect a tool's input schema before executing: composio tools info <TOOL_NAME>
  • Pipe output with jq for better readability: composio tools execute TOOL_NAME -d '{}' | jq
  • Set COMPOSIO_API_KEY as an environment variable for CI/CD pipelines
  • Use composio dev logs tools to inspect execution logs and debug issues

Next Steps

  • Try asking your coding agent to perform various Square operations
  • Explore cross-app workflows by connecting more toolkits
  • Set up triggers for real-time automation
  • Use composio generate for typed schemas in your projects
TOOLS

Supported Tools

Every Square action and event your agent gets out of the box.

Accept Dispute

Accept a dispute and acknowledge liability, returning funds to the cardholder.

Add Group to Customer

Tool to add a customer to a customer group.

Calculate Order

Tool to preview order pricing without creating an order.

Cancel Invoice

Cancels a Square invoice, preventing further payments from being collected.

Cancel Payment

Cancels (voids) a payment that is in APPROVED status.

Create Bulk Customers

Tool to create multiple customer profiles in a single request.

Create Card

Tool to create a card on file.

Create Customer

Tool to create a new customer profile in Square.

Create Customer Custom Attribute Definition

Tool to create a customer-related custom attribute definition.

Create Customer Group

Tool to create a new customer group for a business.

Create Dispute Evidence File

Tool to upload a file as dispute evidence.

Create Dispute Evidence Text

Upload text evidence for a dispute challenge.

Create Invoice Attachment

Upload and attach a file to a Square invoice.

Create Location

Tool to create a new business location in a Square account.

Create Location Custom Attribute Definition

Tool to create a location-related custom attribute definition.

Delete Customer

Tool to delete a Square customer profile.

Delete Customer Custom Attribute

Tool to delete a custom attribute from a customer profile.

Delete Customer Custom Attribute Definition

Tool to delete a customer-related custom attribute definition.

Delete Customer Group

Tool to delete a customer group by its ID.

Bulk Delete Customers

Tool to bulk delete customer profiles from Square.

Delete Dispute Evidence

Removes a specific piece of evidence from a dispute.

Delete Invoice

Tool to delete a Square invoice (only DRAFT invoices can be deleted).

Delete Invoice Attachment

Tool to delete an attachment from a Square invoice.

Delete Location Custom Attribute

Tool to delete a custom attribute from a location.

Delete Location Custom Attribute Definition

Tool to delete a location-related custom attribute definition.

Delete Locations Custom Attributes (Batch)

Tool to delete custom attributes from multiple locations in a single batch request.

Delete Merchant Custom Attribute

Tool to delete a custom attribute from a merchant profile.

Delete Merchant Custom Attribute Definition

Tool to delete a merchant-related custom attribute definition.

Delete Merchants Custom Attributes (Batch)

Tool to delete custom attributes from multiple merchants in a single batch request.

Delete Webhook Subscription

Permanently deletes a webhook subscription by its ID.

Get Business Booking Profile

Tool to retrieve the business booking profile for a Square merchant via GraphQL.

Get Current Merchant

Tool to retrieve merchant information associated with the access token using Square's GraphQL API.

Get Customer Custom Attribute

Retrieves a custom attribute from a customer profile in Square.

Get Customer Custom Attribute Definition

Tool to retrieve a customer-related custom attribute definition from Square.

Get Customers via GraphQL

Tool to retrieve customer profiles from Square Customer Directory using GraphQL API.

Get Dispute Evidence

Retrieves detailed information about a specific piece of evidence that was uploaded for a dispute.

Get Invoice

Retrieves detailed information about a specific Square invoice by its ID.

Get Merchant

Tool to retrieve detailed information about a specific Square merchant by ID.

Get Online Checkout Location Settings

Tool to retrieve location-level settings for Square online checkout.

List Channels

Tool to list requested channels from Square.

List Customer Custom Attribute Definitions

Tool to list customer-related custom attribute definitions from Square.

List Customer Custom Attribute Definitions (GraphQL)

Tool to retrieve customer custom attribute definitions via Square's GraphQL API.

List Customer Custom Attributes

Tool to list custom attributes for a customer profile.

List Customer Groups

Tool to retrieve the list of customer groups of a business.

List Customers

Tool to retrieve customer profiles associated with a Square account.

List Customer Segments

Tool to retrieve the list of customer segments of a business.

List Dispute Evidence

Tool to list evidence items associated with a given dispute.

List Invoices

Tool to list invoices for a Square location.

List Location Custom Attribute Definitions

Tool to list location-related custom attribute definitions from Square.

List Locations

Tool to retrieve all business locations from a Square account.

List Locations Custom Attributes

Tool to list custom attributes for a specific location in Square.

List Merchant Custom Attribute Definitions

Tool to list merchant-related custom attribute definitions from Square.

List Merchants

Tool to retrieve merchant account information associated with the access token.

List Merchants Custom Attributes

Tool to list custom attributes for a specific merchant in Square.

List Payments

Tool to list payments by location and time range to enable reconciliation and net sales reporting from Square POS.

List Webhook Event Types

Tool to list available webhook event types.

List Webhook Subscriptions

List all webhook subscriptions owned by your application.

Remove Group From Customer

Removes a customer from a customer group.

Retrieve Bulk Customers

Tool to retrieve multiple customer profiles in a single request.

Retrieve Channel

Retrieve a Square channel by its ID.

Bulk Retrieve Channels

Tool to bulk retrieve multiple Square channels by their IDs in a single request.

Retrieve Customer

Tool to retrieve detailed information about a specific Square customer by ID.

Retrieve Customer Group

Tool to retrieve a specific Square customer group by ID.

Retrieve Customer Segment

Tool to retrieve a specific customer segment by its ID.

Retrieve Dispute

Tool to retrieve a Square dispute by ID.

Retrieve Location

Tool to retrieve detailed information about a specific Square location by ID.

Retrieve Location Custom Attribute

Retrieves a custom attribute associated with a location in Square.

Retrieve Location Custom Attribute Definition

Tool to retrieve a location-related custom attribute definition.

Retrieve Merchant Custom Attribute

Retrieves a custom attribute associated with a merchant in Square.

Retrieve Merchant Custom Attribute Definition

Tool to retrieve a merchant-related custom attribute definition from Square.

Retrieve Merchants

Tool to retrieve merchant information including status, main location details, and capabilities using Square's GraphQL API.

Retrieve Order

Retrieves detailed information about a specific Square order by its ID.

Retrieve Payment Link

Retrieves a Square-hosted payment link by ID.

Retrieve Token Status

Tool to retrieve information about an OAuth access token or personal access token.

Retrieve Webhook Subscription

Retrieve a Square webhook subscription by its ID.

Search Customers

Tool to search customer profiles in Square Customer Directory.

Search Orders

Tool to search orders across one or more Square locations with filters.

Submit Dispute Evidence

Submits evidence for a dispute to the cardholder's bank.

Test Webhook Subscription

Tests a webhook subscription by sending a test event to the configured notification URL.

Update Customer

Tool to update an existing Square customer profile.

Update Customer Custom Attribute Definition

Tool to update a customer-related custom attribute definition in Square.

Update Customer Group

Tool to update a customer group's information by its ID.

Bulk Update Customers

Tool to update multiple customer profiles in a single batch operation.

Update Location

Tool to update an existing business location in a Square account.

Update Location Custom Attribute Definition

Tool to update a location-related custom attribute definition in Square.

Update Merchant Custom Attribute Definition

Tool to update a merchant-related custom attribute definition in Square.

Update Online Checkout Location Settings

Tool to update location-level settings for Square online checkout.

Update Order

Updates an existing Square order by adding, modifying, or removing fields.

Update Webhook Subscription

Tool to update a Square webhook subscription.

Update Webhook Subscription Signature Key

Tool to rotate the signature key for a webhook subscription.

Upsert Customer Custom Attribute

Tool to create or update a custom attribute for a customer profile.

Batch Upsert Customer Custom Attributes

Tool to create or update custom attributes for multiple customers in a single batch request.

Upsert Location Custom Attribute

Tool to create or update a custom attribute for a location.

Batch Upsert Locations Custom Attributes

Tool to create or update custom attributes for multiple locations in a single batch request.

Upsert Merchant Custom Attribute

Tool to create or update a custom attribute for a merchant profile.

Batch Upsert Merchants Custom Attributes

Tool to create or update custom attributes for multiple merchants in a single batch request.

FAQ

Frequently asked questions

The Composio Universal CLI is a single command-line interface that lets coding agents and developers interact with 1000+ SaaS applications. It handles authentication, tool discovery, action execution, and trigger setup — all from the terminal, without needing to configure MCP servers.

Any coding agent that can run shell commands works with the Composio CLI — including Claude Code, Codex, OpenCode, OpenClaw, and others. Once the CLI is installed, agents automatically discover and use the composio commands to interact with Square and other connected apps.

MCP servers require configuration and can be token-heavy for complex workflows. The CLI gives agents a direct, lightweight interface — no server setup needed. Agents simply call composio commands like any other shell tool. It's faster to set up, more reliable for multi-step tool chaining, and works natively with how coding agents already operate.

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Square data and credentials are handled as safely as possible. You can also bring your own OAuth credentials for full control.

Start with Square.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Square tool your agent needs.Free to start.

Start building