List of API USES Request.

Directives CR – DR WebSites Application.


Webhook Subscriptions API
Applies to: Webhook Subscriptions API | Events API | Square Webhooks
Learn about the Webhook Subscriptions API, which you can use to programmatically subscribe to webhooks.
Overview
Using the Developer Console to manually update webhook subscriptions can become complex when you have to update numerous applications for new event types or functionality.
The Webhook Subscriptions API lets you programmatically manage your webhook subscriptions, including creating, updating, and deleting webhook subscriptions associated with an event.
With the Webhook Subscriptions API, you can:
- Subscribe to receive notifications of events you want to know about. To subscribe, you need to register a notification URL, which Square sends notifications to when events occur.
- Retrieve all event types that an application can subscribe to.
- List all subscriptions for an application.
- Trigger a test notification to the subscription’s notification URL.
Note
Because webhook subscriptions are owned by the application and not by any one seller, you cannot use OAuth access tokens with the Webhook Subscriptions API. You must use the application’s personal access token.
The Events API is a pull-based alternative to webhook subscriptions. In addition to receiving real-time event notifications, you can periodically poll the Events API to retrieve events.
Example use cases
With the Webhook Subscriptions API, you can integrate webhook subscriptions into CI/CD (Continuous Integration/Continuous Delivery) pipelines. For example, you can rotate the signature key used to sign webhooks, configure webhooks while bootstrapping applications and test environments, and update webhooks for new event types or API versions.
Rotating the signature key
Consider a scenario where you want to rotate the signature key every 90 days. You can call UpdateWebhookSubscriptionSignatureKey to get a new key that you can use to validate all future webhooks with.
