Skip to main content
Square is a payments and point-of-sale provider for online and in-person sales. The Square connector lets your Lovable app take payments in your own Square account and send customers to a Square-hosted checkout page. Your app can also read the orders, payments, and customers in that account. It’s designed for apps whose owners already take payments with Square. Square is available as an app + chat connector: one shared connection that works in Chats, in the project chat while you build, and in your published apps. With Square, your app can:
  • Create payment links and send customers to Square’s hosted checkout page
  • Charge cards, and refund a payment in full or in part
  • List payments and orders, with their amount and status
  • Create and look up customers
  • Start a checkout on a Square Terminal, Square’s card reader for in-person payments
  • Receive Square notifications through a webhook, a public address in your app, and check that each one came from Square
  • Send payment requests that Square runs only once, so a retry never charges a customer twice
If you sell digital products or software and don’t have a Square account, built-in payments can set up Stripe or Paddle for you instead. Built-in payments require the Pro plan or higher. When you ask Lovable to add payments without naming a provider, it recommends built-in payments.

Common use cases and example apps

These examples show what you can build with Square, each with a prompt to start from.

How to connect Square

Who can create Square connections depends on your plan and workspace settings. App + chat connectors are available by default. On Business and Enterprise plans, Who can create connections and clients starts at Admins. Some Enterprise workspaces start at No one, which disables the connector. An admin or owner changes it in Connectors → Admin settings → App + chat connectors. You can create multiple Square connections using different access tokens, which is useful for separating test payments from live payments or connecting different Square accounts. Each connection uses one Square environment. A sandbox connection takes test payments only, and a production connection moves real money. To move an app from sandbox to production, see Go live. When the connection is created, you can link it to the projects where you want to use it.

Prerequisites

Before connecting Square, make sure you have:
  • A Square account. You sign in to the Square Developer Console with the same Square account you sell with. A new, free Square account is enough for the sandbox.
  • An application in the Square Developer Console
  • The access token of that application for the environment you want to use
  • Permission to create connections in your Lovable workspace (see Who can create connections and clients)
Payments made through this connector go to your Square account. Square charges its processing fees directly, and billing is handled by Square, not Lovable.

Step 1: Get a Square access token

A Square access token lets your Lovable app act on one Square account. Every Square application has two tokens. The sandbox token works in a test environment that Square creates for your account, where no real money moves. The production token works on the Square account you sell with and moves real money. Use the sandbox token while you build. When you’re ready to take real payments, see Go live. To get a Square access token:
1

Open the Square Developer Console

Sign in to the Square Developer Console.
2

Open or create an application

Open the application you want to use. If you have none, create an application and name it, for example Lovable integration.
3

Choose the environment

In the left pane, open Credentials. At the top of the page, choose Sandbox or Production.
4

Copy the access token

In the access token box, click Show, copy the token, and store it securely.
Your access token functions like a password. Keep it secure and never share it publicly. You’ll need it in the next step.
See Square documentation for more: Access tokens.

Step 2: Connect Square to Lovable

Use your sandbox token for the first connection, so you can try payments without moving real money.
1

Open Square in Connectors

Open Connectors and select Square. For the other places to open the catalog from, see Where to find connectors.
2

Add a connection

Click Connect on the connector page. The form is split into collapsible sections, Details, Configure connection, and Sharing.
3

Name the connection

Under Details, Lovable fills in a name for the connection, which you can change. The name is only used inside Lovable to identify the connection, for example Square Sandbox or Square Production.
4

Configure the connection

Under Configure connection, enter:
  1. Environment: select Sandbox (testing) or Production (live payments). It must match the environment you chose on the Credentials page. If it does not, Lovable cannot verify the token and does not save the connection.
  2. Access token: paste the access token you copied. Get value next to the field opens the Square Developer Console.
  3. Webhook signature key (optional): paste the signature key of the webhook subscription that notifies your app. You can leave it empty and add it later. Until you add it, your app rejects Square’s notifications, so payments are not confirmed by webhook. See How payments are confirmed.
5

Choose who can use this connection

Under Sharing, the connection is private to you by default and shows a Private label. To share it, click Share with others. Then add workspace members by email, or click Invite entire workspace to make the connection available to everyone in your Lovable workspace.See Who can use connections and clients for more information.
6

Connect

Click Connect at the bottom of the form. Lovable verifies the access token against the Square API before saving the connection.
When connected, anyone building in a project can ask Lovable in the project chat to link their project to Square. Linking follows the connection’s access rules. Your Lovable apps can then take payments and read orders, payments, and customers through Square.

How payments are confirmed

Square tells your app about a payment’s progress by calling your app’s webhook. Square can’t reach the editor’s preview, so Lovable sets up the webhook on a public address of your app. You can take test payments before you publish the app. Square signs every notification with the signature key of a webhook subscription. Lovable builds your app to check that signature. Your app marks an order as paid only after the check passes, or after it looks the order up in Square. Your app does not treat the customer’s return to your site as proof of payment. To let your app check the signature:
1

Ask Lovable for the webhook address

In the project chat, ask Lovable which address Square should send notifications to.
2

Add a webhook subscription in Square

In the Square Developer Console, open your application. In the left pane, under Webhooks, open Subscriptions. Select the same environment as your connection and click Add subscription. Enter that address as the notification URL, choose the events your app handles, and click Save. The events are usually:
  • payment.updated: a payment changed status, for example it completed or failed.
  • order.updated: an order changed, for example it was paid.
  • refund.updated: a refund changed status, for example it completed.
3

Copy the signature key

Open the subscription. In the Signature Key box, click Show and copy the key.
4

Add the key to the connection

In Lovable, open Connectors, select Square, and open the connection. Under Configure connection, paste the key into Webhook signature key and save the connection.
A webhook subscription has one address and one signature key. Square’s signature covers the address, so the subscription in Square and your app must use the same one.

Go live

Sandbox and production each need their own connection and their own webhook subscription. The address of your published app can also differ from the one your app used before you published it. A subscription that still points at the earlier address fails the signature check. To take real payments:
1

Create a production connection

Repeat Step 1 with Production selected to copy your production access token. Then repeat Step 2 with that token to create a second connection, and set Environment to Production (live payments).
2

Add a production webhook subscription

Publish your app, then ask Lovable in the project chat for the webhook address of the published app. In the Square Developer Console, add a webhook subscription with that address in the Production environment. Paste its signature key into the production connection.
3

Switch the project to production

Unlink the sandbox connection from the project and link the production one. Your app uses one Square connection, so linking a second one does not switch it.

Limitations

The Square connector cannot:
  • Let each seller connect their own Square account, as a marketplace or platform needs. Each connection represents a single Square account shared across all projects linked to it.
  • Connect by signing in with Square. Each connection uses the access token of your own Square application.
  • Check webhook signatures for more than one webhook subscription per connection.
  • Add or disable the bank accounts linked to your Square account. Your app can read them, and you change them in the Square Dashboard.

Manage your Square connection

Connections are managed from Connectors: select Square, then open the connection.
  • Unlink projects to remove Square access from specific projects while keeping the connection available for others. See Unlink projects from a connection for the steps.
  • Delete the connection to remove it from the workspace entirely. Deleting is permanent. It removes the credentials from all linked projects, and app features that use Square stop working until a new connection is added. See Delete a connection for the steps and who can delete.