Test mode. Use your secret key on your server; live processing is currently disabled.
Operations and schemas are based on the pinned Stripe OpenAPI specification (MIT). Nested object definitions and enums are available in the complete specification.
POST /v1/webhook_endpoints
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.
Request parameters
| Field | Type | Description |
|---|
api_version | string | Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version. |
connect | boolean | Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`). Defaults to `false`. |
description | one of multiple schemas | An optional description of what the webhook is used for. |
enabled_events required | array of string | The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. |
expand | array of string | Specifies which fields in the response should be expanded. |
metadata | one of multiple schemas | Set of [key-value pairs](https://docs.stripe.com/api/metadata) 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`. |
url required | string | The URL of the webhook endpoint. |
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|
api_version | string | The API version events are rendered as for this webhook endpoint. |
application | string | The ID of the associated Connect application. |
created required | integer | Time at which the object was created. Measured in seconds since the Unix epoch. |
description | string | An optional description of what the webhook is used for. |
enabled_events required | array of string | The list of events to enable for this endpoint. `['*']` indicates that all events are enabled, except those that require explicit selection. |
id required | string | Unique identifier for the object. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
metadata required | object | Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. |
object required | string | String representing the object's type. Objects of the same type share the same value. |
secret | string | The endpoint's secret, used to generate [webhook signatures](https://docs.stripe.com/webhooks/signatures). Only returned at creation. |
status required | string | The status of the webhook. It can be `enabled` or `disabled`. |
url required | string | The URL of the webhook endpoint. |
HTTP default: Error response.
| Field | Type | Description |
|---|
error required | api_errors | |
POST /v1/webhook_endpoints/{webhook_endpoint}
Update a webhook endpoint
Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint.
Request parameters
| Parameter | Location | Type | Description |
|---|
webhook_endpoint | path | string | |
| Field | Type | Description |
|---|
description | one of multiple schemas | An optional description of what the webhook is used for. |
disabled | boolean | Disable the webhook endpoint if set to true. |
enabled_events | array of string | The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. |
expand | array of string | Specifies which fields in the response should be expanded. |
metadata | one of multiple schemas | Set of [key-value pairs](https://docs.stripe.com/api/metadata) 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`. |
url | string | The URL of the webhook endpoint. |
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|
api_version | string | The API version events are rendered as for this webhook endpoint. |
application | string | The ID of the associated Connect application. |
created required | integer | Time at which the object was created. Measured in seconds since the Unix epoch. |
description | string | An optional description of what the webhook is used for. |
enabled_events required | array of string | The list of events to enable for this endpoint. `['*']` indicates that all events are enabled, except those that require explicit selection. |
id required | string | Unique identifier for the object. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
metadata required | object | Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. |
object required | string | String representing the object's type. Objects of the same type share the same value. |
secret | string | The endpoint's secret, used to generate [webhook signatures](https://docs.stripe.com/webhooks/signatures). Only returned at creation. |
status required | string | The status of the webhook. It can be `enabled` or `disabled`. |
url required | string | The URL of the webhook endpoint. |
HTTP default: Error response.
| Field | Type | Description |
|---|
error required | api_errors | |