Webhook Endpoints
You can configure webhook endpoints via the API to be notified about events that happen in your Stripe account or connected accounts.
Most users configure webhooks from the dashboard, which provides a user interface for registering and testing your webhook endpoints.
Related guide: Setting up webhooks
The Webhook Endpoint object
Attributes
- idstring
Unique identifier for the object.
- api_
versionnullable string The API version events are rendered as for this webhook endpoint.
- descriptionnullable string
An optional description of what the webhook is used for.
- enabled_
eventsarray of strings The list of events to enable for this endpoint.
['*']
indicates that all events are enabled, except those that require explicit selection. - metadatamap
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
- secretstring
The endpoint’s secret, used to generate webhook signatures. Only returned at creation.
- statusstring
The status of the webhook. It can be
enabled
ordisabled
. - urlstring
The URL of the webhook endpoint.
More attributes
- objectstring
- applicationnullable string
- createdtimestamp
- livemodeboolean
Create a webhook endpoint
A webhook endpoint must have a url
and a list of enabled_events
. You may optionally specify the Boolean connect
parameter. If set to true, then a Connect webhook endpoint that notifies the specified url
about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url
only about events from your account is created. You can also create webhook endpoints in the webhooks settings section of the Dashboard.
Parameters
- enabled_
eventsarray of enumsRequired The list of events to enable for this endpoint. You may specify
['*']
to enable all events, except those that require explicit selection. - urlstringRequired
The URL of the webhook endpoint.
- api_
versionstring Events sent to this endpoint will be generated with this Stripe Version instead of your account’s default Stripe Version.
- descriptionstring
An optional description of what the webhook is used for.
- metadatamap
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata
.
More parameters
- connectboolean
Returns
Returns the webhook endpoint object with the secret
field populated.
Update a webhook endpoint
Updates the webhook endpoint. You may edit the url
, the list of enabled_events
, and the status of your endpoint.
Parameters
- descriptionstring
An optional description of what the webhook is used for.
- enabled_
eventsarray of enums The list of events to enable for this endpoint. You may specify
['*']
to enable all events, except those that require explicit selection. - metadatamap
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata
. - urlstring
The URL of the webhook endpoint.
More parameters
- disabledboolean
Returns
The updated webhook endpoint object if successful. Otherwise, this call returns an error.
Retrieve a webhook endpoint
Retrieves the webhook endpoint with the given ID.
Parameters
No parameters.
Returns
Returns a webhook endpoint if a valid webhook endpoint ID was provided. Returns an an error otherwise.