Subscribe to Events
Subscribe to Square Webhook events for the Connect v1 API.
You must have a Square account to use Square Webhooks. Create a Square account in minutes if you don't already have one.
This guide also makes the following assumptions:
You have read Webhooks What it Does for an overview of how Square Webhooks work.
You are subscribing to events on the Connect v1 API.
You are familiar with HTTP, cURL, and PHP.
To use the steps in this guide you will need the following information:
A valid access token. Square recommends testing with sandbox credentials whenever possible. See Square API Access Tokens for more information.
An active location ID. Copy a valid Developer Account location ID from the Locations setting page of your Square application in the Developer Dashboard, or set the dashboard to Sandbox Settings mode and then copy a sandbox location ID.
To initialize your webhook listener, you need to subscribe to the Connect v1 events you want notifications for. You only need to do this once. The quickest way to subscribe to webhook events is to use the following cURL command.
The following subscription command cannot be used to subscribe to Connect v2 events. To subscribe to v2 events, go to the Developer Portal to add v2 event subscriptions.
ACCESS_TOKENwith the access token for the account being targeted.
LOCATION_IDwith a valid location ID for the account being targeted.
EVENT_LISTwith a comma-separated list of the notification events you want to subscribe to.
EVENT_LISTuses the following syntax:
See the list of Available webhook events in the Connect Technical Reference for possible values.
curl -X PUT \ -H "Authorization: Bearer ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '[EVENT_LIST]' \ https://connect.squareup.com/v1/LOCATION_ID/webhooks
If the subscription request is successful, you will receive an array with all the webhook notifications you are now subscribed to.
Go to the Dashboard.
Click on the app you want to enable webhooks for. Then, click on the Webhooks tab.
Click enable Webhooks.
Add a link to your notification URL
You can test your webhook subscriptions using webhook.site to make sure they are sending events before you finish setting up your notification URL.
In a new tab, go to https://webhook.site and create a subdomain. It will automatically generate a notification URL for you to use. Copy the URL.
Go to the Application Dashboard and click the application you want to work with. Select the Webhooks tab.
Click Enable Webhooks if it is not already enabled.
In the Notification URL field, paste the URL you received from webhook.site.
If you use webhook.site for testing, be sure to update your Notification URL settings before moving your webhook functionality to production.
Learn about validating webhook notifications on a notification endpoint