Connect your app to Square
Connect your Lovable app to Square to collect payments, create checkout links, and view your orders and customers. You can build and test transactions in a safe sandbox mode before switching to real payments.
Anyone who uses Square for their business and wants their Lovable app to handle payments, orders, or customer records.
Do this, in order
- 1
Open the Square Developer Console, create or choose an application, open Credentials, select Sandbox, and copy the access token.
Your app needs this secret token to connect to your test Square account without moving real money.
- 2
In Lovable, navigate to Connectors, select Square, click Connect, choose the Sandbox environment, paste your access token, and save.
This sets up and verifies the connection between Lovable and your Square test account.
- 3
In your Lovable project chat, ask Lovable to link the project to your Square connection and request the webhook address for notifications.
Your app needs the connection linked to use Square, and you need the specific address where Square sends payment updates.
- 4
In the Square Developer Console under Webhooks Subscriptions, add a subscription using that address, select payment and order update events, and copy the signature key.
Square uses this key to sign its update notices so your app knows they are genuine.
- 5
Return to your Square connection in Lovable Connectors, paste the signature key into the Webhook signature key field, and save.
Your app will reject Square payment notifications until this key is saved, leaving orders unconfirmed.
Paste this into your project
Connect this project to my Square connection. Build a checkout for my shop cart that creates a Square payment link for the cart total, sends the customer to Square's hosted checkout page, and marks the order as paid once Square confirms the payment.
Words decoded
- Sandbox
- A safe testing mode provided by Square where you can simulate payments without using real credit cards or moving actual money.
- Access token
- A private digital password that allows your Lovable app to interact directly with your Square account.
- Webhook
- A specific web address in your app where Square sends instant alerts whenever a payment or order status changes.
Where people get stuck
- Picking an environment in Lovable that does not match your Square token will cause verification to fail.
- Treating a customer returning to your website as proof of payment instead of waiting for Square's verified webhook update.
- Forgetting to enter the webhook signature key in your connection settings, which causes your app to reject payment confirmation notices.
- Keeping the pre-publish webhook address in Square after publishing your app, which causes signature verification to fail.
- Linking a production connection without first unlinking the sandbox connection, as apps only use one Square connection at a time.
- Attempting to build a multi-vendor marketplace where different users connect their own Square accounts, which this connector does not support.
The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.