Everything an AI agent can do with the Square API.

A reference guide for building AI agents: every method, how to authenticate, and the permissions each one needs.

Endpoints35
API version2026-05-20
Last updated23 June 2026
Orientation

How the Square API works.

The Square API is how an app or AI agent works with a Square seller account: taking a payment, refunding a charge, creating an order, updating a customer, or changing the catalog and stock. Access is granted through an OAuth access token carrying named permissions, each split into a read and a write form, so a call reaches only the areas the seller approved. Square versions its API by date, and a state change emits an event Square can deliver to a subscribed webhook URL.

35Endpoints
7Capability groups
16Read
19Write
12Permissions
Authentication
Square authenticates with an OAuth 2.0 access token sent as a Bearer token. An integration acting on other sellers' accounts uses the authorization-code flow, where a seller approves the specific permissions the app requests, and the returned token is tied to that seller. For a developer's own account, a personal access token from the Developer Dashboard works without the OAuth flow. Each token carries a fixed set of permissions.
Permissions
Access is governed by named OAuth permissions, requested when the seller authorizes the app, each split into a read and a write form. Examples are PAYMENTS_READ and PAYMENTS_WRITE for payments and refunds, ORDERS_READ and ORDERS_WRITE for orders, CUSTOMERS_READ and CUSTOMERS_WRITE for customers, ITEMS_READ and ITEMS_WRITE for the catalog, INVENTORY_READ and INVENTORY_WRITE for stock, and INVOICES_READ and INVOICES_WRITE for invoices. A call without the permission it needs returns a 403 with INSUFFICIENT_SCOPES.
Versioning
The REST API is versioned by date through the Square-Version header, in a YYYY-MM-DD scheme, with 2026-05-20 the newest version. An application is pinned to a default version that every call uses, and a request can override it per call with the header. A webhook payload reflects the API version set on the subscription.
Data model
Square is resource-oriented JSON over HTTPS, with all paths under the version-2 prefix at https://connect.squareup.com/v2. A payment is a Payment, refunded through the Refunds API; commerce combines Orders, Customers, the Catalog, Inventory, and Invoices. List and search endpoints page with a cursor, search reads use POST to carry a query body, and a state change emits an event Square can deliver by webhook.
Connect & authenticate

Connection & authentication methods.

How an app or AI agent connects to Square determines what it can reach. There is a route for making calls, a route for receiving events, and a hosted server that exposes Square tools to agents, and each is governed by the token behind it and the permissions that token carries.

Ways to connect

REST API

The REST API answers at https://connect.squareup.com/v2 in production and https://connect.squareupsandbox.com/v2 in sandbox. A call authenticates with an OAuth access token as a Bearer token, sends and returns JSON, and a Square-Version header on each request selects the dated API version.

Best forConnecting an app or AI agent to Square.
Governed byThe access token and the permissions it carries.
Docs ↗

Webhooks

Square POSTs event notifications to an HTTPS URL subscribed to the chosen event types, like payment.created or order.updated. The receiver verifies the x-square-hmacsha256-signature header, an HMAC-SHA256 of the notification URL and the raw body computed with the subscription's signature key, to confirm the request came from Square.

Best forReceiving Square events at an app or AI agent.
Governed byThe signature key on the webhook subscription.
Docs ↗

MCP server (Model Context Protocol)

Square's hosted Model Context Protocol server at https://mcp.squareup.com/sse exposes the Square API platform to AI agents, covering payments, orders, customers, items, and more. The remote server uses OAuth login for granular permissions, and a local server authenticates with an access token. It is in Beta, and its source is at github.com/square/square-mcp-server.

Best forConnecting an AI agent to Square through MCP.
Governed byThe OAuth grant or the access token and the permissions it carries.
Docs ↗
Authentication

OAuth 2.0

Square uses the OAuth 2.0 authorization-code flow. A seller is sent to the authorization page with the set of permissions the app needs, and the returned code is exchanged for an access token tied to that seller and those permissions. This is the route for an integration acting on accounts it does not own.

TokenOAuth access token (Bearer)
Best forActing on behalf of sellers who authorize the app
Docs ↗

Personal access token

Each Square application provides a personal access token in the Developer Dashboard that calls the API for the developer's own account, with all of the application's permissions. It suits internal tools and testing, not access to other sellers' accounts.

TokenBearer access token
Best forCalling the API for the developer's own account
Docs ↗
Endpoint reference

Every Square API method.

Filter by method, access, or permission, or search any path. Select a row for version detail, rate limits, the related webhook event, and the source.

MethodEndpointWhat it doesAccessPermissionVersion

Payments

List, create, retrieve, update, cancel, and complete payments.6

Read-only. Grants access to payment and refund data.

Acts onpayment
Permission (capability)PAYMENTS_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Takes a real payment. Adding additional recipients also needs PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS.

Acts onpayment
Permission (capability)PAYMENTS_WRITE
VersionAvailable since the API’s base version
Webhook eventpayment.created
Rate limitStandard limits apply

Read-only.

Acts onpayment
Permission (capability)PAYMENTS_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Only an approved, uncaptured payment can be updated.

Acts onpayment
Permission (capability)PAYMENTS_WRITE
VersionAvailable since the API’s base version
Webhook eventpayment.updated
Rate limitStandard limits apply

Releases the held authorization without capturing funds.

Acts onpayment
Permission (capability)PAYMENTS_WRITE
VersionAvailable since the API’s base version
Webhook eventpayment.updated
Rate limitStandard limits apply

Captures the held funds for an approved payment.

Acts onpayment
Permission (capability)PAYMENTS_WRITE
VersionAvailable since the API’s base version
Webhook eventpayment.updated
Rate limitStandard limits apply

Refunds

List refunds, refund a payment, and retrieve a single refund.3

Read-only. Refund data is covered by the payments permission.

Acts onrefund
Permission (capability)PAYMENTS_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Returns real money. Refunding is part of the payments write permission.

Acts onrefund
Permission (capability)PAYMENTS_WRITE
VersionAvailable since the API’s base version
Webhook eventrefund.created
Rate limitStandard limits apply

Read-only.

Acts onrefund
Permission (capability)PAYMENTS_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Orders

Create, retrieve, update, search, clone, and pay for orders.6

A core write.

Acts onorder
Permission (capability)ORDERS_WRITE
VersionAvailable since the API’s base version
Webhook eventorder.created
Rate limitStandard limits apply

Read-only.

Acts onorder
Permission (capability)ORDERS_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Only an open order can be updated, using a sparse update and a version for optimistic concurrency.

Acts onorder
Permission (capability)ORDERS_WRITE
VersionAvailable since the API’s base version
Webhook eventorder.updated
Rate limitStandard limits apply

Read-only. Search uses POST to carry a query body.

Acts onorder
Permission (capability)ORDERS_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Also needs PAYMENTS_WRITE, because it captures the linked payments.

Acts onorder
Permission (capability)ORDERS_WRITE
VersionAvailable since the API’s base version
Webhook eventorder.updated
Rate limitStandard limits apply

The clone starts as a draft and is not yet payable.

Acts onorder
Permission (capability)ORDERS_WRITE
VersionAvailable since the API’s base version
Webhook eventorder.created
Rate limitStandard limits apply

Customers

List, create, search, retrieve, update, and delete customer profiles.6

Read-only.

Acts oncustomer
Permission (capability)CUSTOMERS_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

A core write.

Acts oncustomer
Permission (capability)CUSTOMERS_WRITE
VersionAvailable since the API’s base version
Webhook eventcustomer.created
Rate limitStandard limits apply

Read-only. Search uses POST to carry a query body.

Acts oncustomer
Permission (capability)CUSTOMERS_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts oncustomer
Permission (capability)CUSTOMERS_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

A core write.

Acts oncustomer
Permission (capability)CUSTOMERS_WRITE
VersionAvailable since the API’s base version
Webhook eventcustomer.updated
Rate limitStandard limits apply

Permanently removes the profile.

Acts oncustomer
Permission (capability)CUSTOMERS_WRITE
VersionAvailable since the API’s base version
Webhook eventcustomer.deleted
Rate limitStandard limits apply

Catalog

List, upsert, retrieve, search, and delete catalog objects and items.5

Read-only.

Acts oncatalog object
Permission (capability)ITEMS_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

A core catalog write.

Acts oncatalog object
Permission (capability)ITEMS_WRITE
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts oncatalog object
Permission (capability)ITEMS_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only. Search uses POST to carry a query body.

Acts oncatalog object
Permission (capability)ITEMS_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Deletes the object and its children, like the variations under an item.

Acts oncatalog object
Permission (capability)ITEMS_WRITE
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Inventory

Retrieve stock counts, apply adjustments and counts, and read inventory history.3

Read-only.

Acts oninventory count
Permission (capability)INVENTORY_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Changes real stock counts.

Acts oninventory change
Permission (capability)INVENTORY_WRITE
VersionAvailable since the API’s base version
Webhook eventinventory.count.updated
Rate limitStandard limits apply

Read-only. Uses POST to carry the list of object IDs.

Acts oninventory count
Permission (capability)INVENTORY_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Invoices

List, create, search, retrieve, update, delete, publish, and cancel invoices.6

Read-only. A location_id query parameter is required.

Acts oninvoice
Permission (capability)INVOICES_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Starts as a draft until it is published.

Acts oninvoice
Permission (capability)INVOICES_WRITE
VersionAvailable since the API’s base version
Webhook eventinvoice.created
Rate limitStandard limits apply

Read-only.

Acts oninvoice
Permission (capability)INVOICES_READ
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

A version is required for optimistic concurrency.

Acts oninvoice
Permission (capability)INVOICES_WRITE
VersionAvailable since the API’s base version
Webhook eventinvoice.updated
Rate limitStandard limits apply

Publishing can email or charge the customer, depending on the delivery method.

Acts oninvoice
Permission (capability)INVOICES_WRITE
VersionAvailable since the API’s base version
Webhook eventinvoice.published
Rate limitStandard limits apply

Stops any further payment on the invoice.

Acts oninvoice
Permission (capability)INVOICES_WRITE
VersionAvailable since the API’s base version
Webhook eventinvoice.updated
Rate limitStandard limits apply
No endpoints match those filters.
Webhooks

Webhook events.

Square can notify an app or AI agent when something happens in an account, like a payment being created or an order being updated, instead of the app repeatedly asking. Square posts the event to a notification URL that has been subscribed to the chosen event types.

EventWhat it signalsTriggered by
payment.createdA payment was created./v2/payments
payment.updatedA field on a payment was updated, including when it is canceled or completed./v2/payments/{payment_id}
/v2/payments/{payment_id}/cancel
/v2/payments/{payment_id}/complete
refund.createdA refund was created./v2/refunds
order.createdAn order was created./v2/orders
/v2/orders/clone
order.updatedAn order was updated, including when it is paid./v2/orders/{order_id}
/v2/orders/{order_id}/pay
/v2/invoices/{invoice_id}/cancel
customer.createdA customer profile was created./v2/customers
customer.updatedAn attribute on a customer profile was changed./v2/customers/{customer_id}
customer.deletedA customer profile was deleted./v2/customers/{customer_id}
inventory.count.updatedThe stock quantity was updated for a catalog item variation./v2/inventory/changes/batch-create
invoice.createdA draft invoice was created./v2/invoices
invoice.publishedAn invoice was published./v2/invoices/{invoice_id}/publish
invoice.updatedAn invoice was changed./v2/invoices/{invoice_id}
No events match that search.
Rate limits & pagination

Rate limits, pagination & request size.

Square limits how fast an app or AI agent can call. It does not publish a fixed per-second number, and an app over the limit gets a RATE_LIMITED error to back off and retry.

Request rate

Square limits how fast an application can call, but does not publish a fixed per-second number, and notes that different endpoints can enforce different limits. An application that sends too many requests in a short period gets a RATE_LIMITED error in the RATE_LIMIT_ERROR category, returned with HTTP 429. The documented handling is to watch for 429 responses and retry with an exponential backoff schedule plus a randomized delay, so a burst does not repeatedly hit the limit.

Pagination

List and search endpoints are cursor-based. A response includes a cursor when more results remain, and that cursor is passed on the next request to fetch the following page; an absent cursor means the last page has been reached. Some endpoints take a limit parameter to set the page size.

Request size

Bodies are JSON. Batch endpoints set their own caps, such as BatchUpsertCatalogObjects creating or updating up to 10,000 objects in a single call. An idempotency key on a write makes it safe to repeat.

Errors

Status codes & error handling.

The status codes an agent should handle, and what to do about each.

StatusCodeMeaningWhat to do
400INVALID_REQUEST_ERRORThe request was malformed: a field is missing, invalid, or in the wrong format, like VALUE_TOO_LONG or EXPECTED_INTEGER. An idempotency key reused with different data also returns this category, as IDEMPOTENCY_KEY_REUSED.Read the category, code, detail, and field on each Error object, correct the named field, and resend.
401AUTHENTICATION_ERRORThe access token is missing, invalid, expired, or revoked, shown by codes like UNAUTHORIZED, ACCESS_TOKEN_EXPIRED, or ACCESS_TOKEN_REVOKED.Send a valid Bearer access token, and refresh or re-authorize through OAuth when it has expired or been revoked.
403INSUFFICIENT_SCOPESThe token is valid but lacks a permission the request needs, or the action is forbidden. The error sits in the AUTHENTICATION_ERROR category.Re-authorize with the required permission, like PAYMENTS_WRITE or ITEMS_WRITE, then retry.
404NOT_FOUNDThe requested object does not exist, or is not visible to this token, account, or environment.Verify the object ID, and confirm it lives in the same account and environment, production or sandbox.
409VERSION_MISMATCHAn optimistic-concurrency conflict: the version sent does not match the current version of an order, invoice, or other versioned object, because it changed in the meantime.Refetch the object to read its current version, reapply the change, and resend.
429RATE_LIMITEDToo many requests arrived in a short period, so Square temporarily stopped processing them. The error sits in the RATE_LIMIT_ERROR category.Retry with exponential backoff and jitter, and smooth the request rate.
500INTERNAL_SERVER_ERRORAn error on Square's side, in the API_ERROR category. It is rare.Retry idempotently with backoff, and contact Square support if it persists.
Versioning & freshness

Version history.

Square versions its API by date through the Square-Version header. The newest version is 2026-05-20, and an application is pinned to a default version that every call uses unless a request overrides it.

Version history

What changed, and when

Latest version2026-05-20
2026-05-20Current version
Current version (May 2026 release)

Square versions its API by date through the Square-Version header. The 2026-05-20 version is the newest, and an application is pinned to a default version that all of its calls use unless a request overrides it with the header. Releases ship roughly monthly through the release notes.

What changed
  • Updates to the Payments API.
  • Updates to the Refunds API.
2026-04-21Feature update
April 2026 release

A dated monthly release ahead of 2026-05-20.

What changed
  • Updates to the Reporting API and associated documentation.

An integration can pin a version and move up on a schedule that suits it.

Square API release notes ↗
Questions

Square API, answered.

How does Square authenticate API calls?+
Every request carries an OAuth 2.0 access token as a Bearer token in the Authorization header. To act on a seller's account, an app sends the seller to Square's authorization page with the permissions it needs, and exchanges the returned code for an access token tied to that seller. For its own account, a developer can use a personal access token from the Developer Dashboard instead of running the OAuth flow.
What are Square's OAuth permissions, and what happens if one is missing?+
Square scopes access with named permissions, each in a read and a write form, such as PAYMENTS_WRITE, ORDERS_READ, CUSTOMERS_WRITE, ITEMS_WRITE, INVENTORY_WRITE, and INVOICES_WRITE. An app requests only the permissions it needs when the seller authorizes it. A call whose token lacks the required permission returns HTTP 403 with the code INSUFFICIENT_SCOPES, and the app then re-authorizes with the missing permission added.
How does Square version its API?+
Square versions by date through the Square-Version header, using a YYYY-MM-DD scheme where the date is the release date, and the newest version is 2026-05-20. Each application is pinned to a default version that all of its calls use, and a single request can target a different version by setting the header. New versions ship roughly monthly through the release notes.
How do I verify that a webhook really came from Square?+
Each notification carries an x-square-hmacsha256-signature header. The receiver computes an HMAC-SHA256 over the notification URL joined with the raw request body, using the signature key from the webhook subscription, and compares it to the header value with a constant-time check. A mismatch is rejected, which prevents a spoofed event from being trusted.
How does pagination work?+
List and search endpoints are cursor-based. When more results remain, the response includes a cursor, which is sent on the next request to fetch the following page. When the response has no cursor, the last page has been reached. Some endpoints also accept a limit parameter to set the page size.
What are the rate limits?+
Square does not publish a fixed per-second limit, and different endpoints can enforce different limits. An app that sends too many requests in a short period gets a RATE_LIMITED error with HTTP 429. The recommended handling is to watch for 429 responses and retry with exponential backoff plus a randomized delay, rather than assume a specific number.
Does Square have an MCP server for AI agents?+
Yes. Square publishes a hosted Model Context Protocol server at mcp.squareup.com that exposes the Square API platform to AI agents, covering payments, orders, customers, items, and more. The remote server uses OAuth login for granular permissions, while a local server authenticates with an access token. It is in Beta, and its source is on GitHub at square/square-mcp-server.
Related

More finance API guides for agents

What is Bollard AI?

Control what every AI agent can do in Square.

Bollard AI sits between a team's AI agents and Square. Grant each agent exactly the access it needs, read or write, resource by resource, and every call is checked and logged.

  • Set read, write, or full access per agent, never a shared Square key.
  • Denied by default, so an agent reaches only what has been explicitly allowed.
  • Every call recorded in plain English: who, what, where, and the decision.
Square
Storefront Agent
Read orders ResourceOffReadFull use
Refund payments ActionOffReadFull use
Catalog & inventory ResourceOffReadFull use
Per-agent access, set in Bollard AI, not in Square