---
title: "Square"
description: "Connect your Square account to Two Minute Billing: find your access token, application ID and location ID, connect them, and let Two Minute Billing register the webhook. Cards on file, one currency for each location."
canonical_url: "https://twominutebilling.com/help/guides/connect-a-payment-gateway/square"
---
# Square

> Connect your Square account to Two Minute Billing: find your access token, application ID and location ID, connect them, and let Two Minute Billing register the webhook. Cards on file, one currency for each location.

Two Minute Billing charges cards on file through **your** Square account. You keep your Square
rates, and Square pays out to your bank as usual. When a customer pays an invoice once with **Pay
now**, Square also offers Google Pay, Cash App Pay, Afterpay and ACH. Apple Pay is coming soon.
These are not saved for renewals:
renewals charge the card on file.

## Before you start

- A Square account and an application in the Square Developer Console. The Sandbox works at once
and comes with a test location.
- Square gives each application two sets of credentials: **Sandbox** and **Production**. Connect
the Sandbox credentials to a test business and the Production credentials to a live business.
Two Minute Billing refuses a mix.
- Each Square location charges in one currency: the currency of its country. Connect one gateway
account for each location, and select that currency on it.
- You need permission to manage payment gateways in Two Minute Billing. The owner and admin
roles have it.

## Find your API keys

In the Square Developer Console, open your application and select **Credentials** in the left
pane. At the top of the page, select **Sandbox** or **Production** to match the business you are
connecting.

<screenshot :height="520" :single="true" :width="1460" alt="The Square Developer Console's Credentials page in sandbox, showing the application ID and the access token" caption="Square Developer Console → your application → Credentials. Copy the application ID and the access token." src="gateways/square-api-keys">



</screenshot>

Then select **Locations** in the left pane and copy the ID of the location that takes the
payments.

You need three values:

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Where to find it
    </th>
    
    <th>
      Looks like
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Access token
      </strong>
    </td>
    
    <td>
      Square Developer Console → your application → Credentials. Use the Sandbox access token for a test business and the Production access token for a live business.
    </td>
    
    <td>
      —
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Application ID
      </strong>
    </td>
    
    <td>
      On the same page. A sandbox Application ID starts with sandbox-sq0idb-.
    </td>
    
    <td>
      <code>
        sq0idp-…
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Location ID
      </strong>
    </td>
    
    <td>
      Square Developer Console → your application → Locations. Each location charges in one currency: the currency of its country.
    </td>
    
    <td>
      —
    </td>
  </tr>
</tbody>
</table>

<warning>

**Keep the access token secret.** Anyone with the access token can charge and refund in your Square account. Paste it only into
Two Minute Billing, which stores it encrypted, and never into an email or a chat.

</warning>

## Permissions

<warning>

**Use the personal access token, not an OAuth token.** Copy the **access token** from your application's **Credentials** page. It has every permission
Two Minute Billing needs. An OAuth access token does not work: Square does not let an OAuth token
make webhook subscriptions, so the webhook cannot be registered.

</warning>

With that token, Two Minute Billing uses these Square permissions:

<table>
<thead>
  <tr>
    <th>
      Square permission
    </th>
    
    <th>
      Two Minute Billing uses it to
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        PAYMENTS_WRITE
      </code>
      
      , <code>
        PAYMENTS_READ
      </code>
    </td>
    
    <td>
      Charge, complete, cancel and refund payments, and save and disable cards
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        CUSTOMERS_WRITE
      </code>
      
      , <code>
        CUSTOMERS_READ
      </code>
    </td>
    
    <td>
      Make and find the customer in Square
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        MERCHANT_PROFILE_READ
      </code>
    </td>
    
    <td>
      Read the location and its currency
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        ORDERS_WRITE
      </code>
      
      , <code>
        ORDERS_READ
      </code>
    </td>
    
    <td>
      Make the Square checkout page for Apple Pay, and read its order when Square reports the payment
    </td>
  </tr>
</tbody>
</table>

**Webhook:** Two Minute Billing makes the webhook subscription with the same token and selects
the payment, refund, dispute and card events. The notification URL must use HTTPS.

## Connect it in Two Minute Billing

1. Open **Settings → Payment gateways** and click **Add gateway**.
2. Select **Square** and paste the **Access token**, the **Application ID** and the
**Location ID**.
3. Select the **currencies** and the **payment methods** this account handles.
4. Click **Create gateway account**.

Then open the account and click **Check credentials**. **Healthy** means Square accepted the
token, and the location is active and can take cards.

The payment methods you can turn on for Square:

- **Cards** — Apple Pay is coming soon.

### Apple Pay

**Coming soon.** Apple Pay on Square is not available yet. We did not complete its tests.

Apple Pay shows only when a customer pays an invoice now, in a browser that can pay with Apple
Pay (Safari with a card in Apple Wallet). The customer selects **Apple Pay** and pays on a Square
checkout page (a payment link), then comes back to the portal. Your domain does not need Apple
Pay verification: the page is on Square's domain. You do not change anything in Square or in Two
Minute Billing.

<note>

**The Square checkout page also takes cards.** Square does not let a checkout page show Apple Pay
alone, and it does not tell Two Minute Billing whether a card or Apple Pay paid. So these
payments show as **Card** under **Paid with**. Square offers Apple Pay there only in the
countries where it supports Apple Pay. Apple Pay is not saved for renewals.

</note>

## Currencies

Two Minute Billing offers these 6 currencies on Square:

AUD, CAD, EUR, GBP, JPY, USD

Each Square location takes one currency: the currency of its country.

If you leave **Currencies** empty on the gateway account, the account takes each currency of your business that is on this list.

## Webhooks

Square tells Two Minute Billing about things that happen after a charge: a payment or a refund
that changes later, a refund made in Square, a dispute, a saved card that Square updates or
disables.

Two Minute Billing registers the webhook with Square for you when you save the account. Nothing to copy.

If the gateway account page shows the webhook as not configured:

1. Click “Register with Square” on the gateway account page. We make the webhook subscription and keep its signature key.
2. Square accepts only HTTPS notification URLs.

## Test it

In your test business, create a customer and save the test card `4111 1111 1111 1111` with any
future expiry date and the CVV `111`. For USD, CAD and GBP, Square also needs a valid postal
code; do not use `99999`, which simulates an incorrect one. Collect an invoice: it is marked
paid, and **Logs** shows the call to Square and Square's answer.

The Square Sandbox does not show Apple Pay on checkout pages: it takes only test cards there. To
check the Apple Pay flow in a test business, use Safari, click **Pay now**, select **Apple Pay**
and pay on the Square page with the test card. The invoice is marked paid when Square's webhook
arrives.

## Go live

1. In the Square Developer Console, select **Production** on your application's
**Credentials** page. Click **Show** and copy the **Production access token** and the
**Application ID** (`sq0idp-…`).
2. Copy the ID of your production location under **Locations**.
3. In your **live** business, add Square with those values.
4. Two Minute Billing makes a separate webhook subscription for production. Check it under
your application's **Webhooks → Subscriptions**.

## Troubleshoot

- **Check credentials says "square: a test business needs the Sandbox Application ID and access
token".** The values come from Production. Copy the Sandbox ones, or connect them to a live
business. A live business shows the opposite message.
- **Check credentials shows an error that starts with "Square get_location".** The access token
or the location ID is wrong, or the location belongs to another application or environment.
Copy both again from the same page and mode.
- **Check credentials says "We could not check the credentials." with the location status, for example "INACTIVE USD".** The
location is not active or cannot take cards. Select an active location in Square.
- **Pay now shows no Apple Pay.** The customer's browser cannot pay with Apple Pay (it is not
Safari, or Apple Wallet has no card). Apple Pay never shows when a customer saves a card.
- **The Square checkout page shows no Apple Pay button.** Square does not support Apple Pay in
the location's country, or the page is in the Sandbox. The customer can pay with a card on the
same page.
- **The account page shows the webhook as not configured.** Follow the steps under
[Webhooks](#webhooks).

## Related

- [Payment gateways overview](https://twominutebilling.com/help/guides/connect-a-payment-gateway)
- [Recover failed payments](https://twominutebilling.com/help/guides/recover-failed-payments)
- [Handle disputes](https://twominutebilling.com/help/guides/handle-disputes)


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
