Webhooks
Webhooks are used to send event data to an external system (i.e. your application). Using the API, you can set up webhooks and subscribe to events programatically.
A webhook belongs to a Store.
Find out how to implement webhooks, how to sign requests and which events are supported in the Webhooks help docs.
Read a step-by-step webhooks implementation tutorial in our Developer Guide.
The webhook object
Attributes
store_id
The ID of the store this webhook belongs to.
url
The URL that events will be sent to.
events
An array of events that will be sent.
last_sent_at
An ISO 8601 formatted date-time string indicating when the last webhook event was sent. Will be null
if no events have been sent yet.
created_at
An ISO 8601 formatted date-time string indicating when the object was created.
updated_at
An ISO 8601 formatted date-time string indicating when the object was last updated.
test_mode
A boolean indicating if the object was created within test mode.
Webhook object
Create a webhook
Create a webhook.
Attributes
url
Required
A valid URL of the endpoint that should receive webhook events.
events
Required
An array of webhook event types that should be sent to the webhook endpoint.
See the list of available event types.
secret
Required
A string used by Lemon Squeezy to sign requests for increased security.
Learn about receiving signed requests.
Note: The secret
is never returned in the API. To view the secret of a webhook, open the webhook in your dashboard.
test_mode
Set this to true
if the webhook should be created in test mode.
Relationships
store
The store this webhook belongs to.
POST /v1/webhooks
Returns
Returns a webhook object.
Response
Retrieve a webhook
Retrieves the webhook with the given ID.
GET /v1/webhooks/:id
Returns
Returns a webhook object.
Response
Update a webhook
Update a webhook.
Attributes
url
A valid URL of the endpoint that should receive webhook events.
events
An array of webhook event types that should be sent to the webhook endpoint.
See the list of available event types.
secret
A string used by Lemon Squeezy to sign requests for increased security.
Learn about receiving signed requests.
Note: The secret
is never returned in the API. To view the secret of a webhook, open the webhook in your dashboard.
PATCH /v1/webhooks/:id
Returns
Returns a webhook object.
Response
Delete a webhook
Delete a webhook with the given ID.
Returns
Returns a 204 No Content
response on success.
DELETE /v1/webhooks/:id
List all webhooks
Returns a paginated list of webhooks.
Parameters
store_id
Only return webhooks belonging to the store with this ID.
GET /v1/webhooks
Returns
Returns a paginated list of webhook objects ordered by created_at
.