# Square

> This page is about FlutterFlow (the app builder you use by describing your app), not FlutterFlow Studio.

URL: https://docs.flutterflow.io/ffx/square

Connect Square with a Sandbox token or by signing in, then ask the agent to sell your catalog with Square's checkout, read orders and payments, and work with customers and bookings.

Use Square to sell from your Square catalog and take payments on Square's own checkout page. Start with a Square Sandbox access token, which takes test payments, and sign in with Square when you're ready for real payments.

## Connect Square {#connect-square}

To get a Sandbox access token, open your application in the Square Developer Console, go to **Credentials › Sandbox**, and click **Show**. The token starts with `EAAA`.

Only a project owner can connect Square.

To connect Square to your app:

1. Open **Project Settings › Connections**, and then turn on the **Square** switch.
2. In the **Connect Square** dialog, choose how to connect:
   - **Paste a Sandbox access token**: paste the token into **Access token**, and then click **Connect**.
   - **Sign in with Square**: sign in to your Square seller account in the new tab that opens.

Signing in with Square connects your real seller account, so the Square card in **Project Settings › Connections** shows **Live account**. Your preview and the agent take real payments with it. Use a Sandbox token while you build.

See [Connect a service](https://docs.flutterflow.io/ffx/connect-a-service).

## What to ask

With Square connected, your app can read your locations and catalog, make a checkout link for catalog items or a custom amount, read orders and payments, find and add customers, and list Square Appointments bookings. Add the items that you sell in your Square Dashboard first.

> Example request: "Add a Shop screen that lists my Square catalog items with their prices. When someone checks out, open Square's checkout page for their items, and after they come back, read the order back and mark it paid only when nothing is left to pay."

> Example request: "Add a Pay deposit button that charges a 20 dollar deposit through a Square checkout link at my main location."

> Example request: "Add a My appointments screen that finds the signed-in person in my Square customers by email and lists their upcoming Square bookings."

A checkout link opens Square's payment page, where the customer pays. Your app never handles a card. Coming back to your app doesn't mean the customer paid: your app confirms the payment by reading the order back from Square.

To list bookings, set up Square Appointments for your business first.

## Agent questions {#agent-questions}

If Square isn't connected, the agent asks you to connect it in a card above the message box. See [Connect when the agent asks](https://docs.flutterflow.io/ffx/connect-a-service#connect-when-the-agent-asks).

When your app's Square connection is a live account, the agent can use Square only in a thread that an owner of the app started. In that thread, every call that the agent makes to Square, reads included, shows an **Approval** card first, and only that owner can approve it. Each approval covers one call. Your app's own calls to Square don't wait for approval. See [Agent permissions](https://docs.flutterflow.io/ffx/agent-permissions#live-money-accounts).

## Review {#review}

After the agent finishes, read the turn's [**Summary**](https://docs.flutterflow.io/ffx/what-changed#summary) and review its [**Changes**](https://docs.flutterflow.io/ffx/what-changed#changes-tab). Check the affected screens in **Screens**, and try the change in **Preview**. If the change uses records or sign-in, test it with [the thread's own data in **Data**](https://docs.flutterflow.io/ffx/thread-data).

After you push a backend change, check the result in **Backend**.

In the preview, Square's payment page opens, but the customer comes back to your app's return page, not to the preview. Try the whole payment on a phone build.

## Call limit {#call-limit}

Your app and the agent share a limit of 120 calls a minute to Square through your app's connection. See [Limits](https://docs.flutterflow.io/ffx/limits#connections).

## Push

When the result is ready, [push the changes to your app](https://docs.flutterflow.io/ffx/push).

## Next steps

- To replace the token or disconnect Square, see [Manage connections](https://docs.flutterflow.io/ffx/manage-connections).
- [Agent permissions](https://docs.flutterflow.io/ffx/agent-permissions)

## Troubleshooting

For a token that's refused or a connection that needs attention, see [Troubleshoot connections](https://docs.flutterflow.io/ffx/troubleshoot-connections).

If Square refuses a pasted token because it's a Production token, paste a Sandbox token for test payments, or use **Sign in with Square** for real payments.

If your app can't read an order or a payment back, check that it was made with the same connection: a Sandbox connection can't read a Production order.
