code: import stripe
  stripe.api_key = "sk_test_your_key"
  
  stripe.WebhookEndpoint.create(
    url="https://example.com/my/webhook/endpoint",
    enabled_events=[
      "charge.failed",
      "charge.succeeded",
    ],
  )
  '''Response {
    "id": "we_1LSdif2eZvKYlo2CBeXfpCQI",
    "object": "webhook_endpoint",
    "api_version": null,
    "application": null,
    "created": 1659518305,
    "description": "This is my webhook, I like it a lot",
    "enabled_events": [
      "charge.failed",
      "charge.succeeded"
    ],
    "livemode": false,
    "metadata": {},
    "status": "enabled",
    "url": "https://example.com/my/webhook/endpoint",
    "secret": "whsec_aKrkHBqtwVgxCtwNCqSSXwHR75MUvCEI"
  }'''
nl: Create a webhook endpointA 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_events required The list of events to enable for this endpoint. You may specify [’*’] to enable all events, except those that require explicit selection.Possible enum valuesaccount.updated Occurs whenever an account status or property has changed.account.application.authorized Occurs whenever a user authorizes an application. Sent to the related application only.account.application.deauthorized Occurs whenever a user deauthorizes an application. Sent to the related application only.account.external_account.created Occurs whenever an external account is created.account.external_account.deleted Occurs whenever an external account is deleted.account.external_account.updated Occurs whenever an external account is updated.application_fee.created Occurs whenever an application fee is created on a charge.Show 182 more url required The URL of the webhook endpoint. api_version optional Events sent to this endpoint will be generated with this Stripe Version instead of your account’s default Stripe Version. description optional An optional description of what the webhook is used for. metadata optional dictionary 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 parametersExpand all  connect optional ReturnsReturns the webhook endpoint object with the secret field populated