Webhooks

Create webhook subscription

Changed on

Create webhook subscription

Required scopes: application/webhooks:read, application/webhooks:write

post/v1/webhooks/subscriptions/

Request

  • Base URL
    https://api.yoco.com
  • Auth
    HTTP bearer

Request body

namestring required

A friendly name to describe the subscription.

event_typesWebhookEventType[] required

A list of event types to bind the subscription to.

notification_urlstring uri required

The URL to be notified when an event occurs. It must use HTTPS and point to a public host.

Example request

{
  "event_types": [
    "payment.created"
  ],
  "name": "Example Webhook Subscription",
  "notification_url": "https://webhook.site/1d9d0c3c-c0f9-4def-8cf1-99efb5931eca"
}

Response

Successful Response

idstring required

The unique identifier of the subscription.

namestring required

A friendly name to describe the subscription.

enabledboolean required

A flag indicating whether the subscription is enabled.

event_typesWebhookEventType[] required

A list of event types the subscription is bound to.

notification_urlstring required

The URL to be notified when an event occurs.

secretstring nullable required

The secret used to verify the payload of a webhook, only available upon creation.

created_atstring date-time required

The subscription creation date and time in ISO 8601 format.

updated_atstring date-time required

The date and time the subscription was last modified in ISO 8601 format.

Example response

{
  "created_at": "2024-11-19T15:27:02+00:00",
  "enabled": true,
  "event_types": [
    "payment.created"
  ],
  "id": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2",
  "name": "Example Webhook Subscription",
  "notification_url": "https://webhook.site/1d9d0c3c-c0f9-4def-8cf1-99efb5931eca",
  "secret": "whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD",
  "updated_at": "2024-11-19T15:27:02+00:00"
}

Changes

    • warning

      added the new content_too_large enum value to the response property for the response status

    • warning

      added the new content_too_large enum value to the response property for the response status

    • warning

      added the new content_too_large enum value to the response property for the response status

    • warning

      added the new content_too_large enum value to the response property for the response status

    • warning

      added the new content_too_large enum value to the /// response property for the response status

    • warning

      added the new content_too_large enum value to the /// response property for the response status

    • warning

      added the new content_too_large enum value to the /// response property for the response status

    • warning

      added the new content_too_large enum value to the /// response property for the response status

    • warning

      added the new unsupported_media_type enum value to the response property for the response status

    • warning

      added the new unsupported_media_type enum value to the response property for the response status

    • warning

      added the new unsupported_media_type enum value to the response property for the response status

    • warning

      added the new unsupported_media_type enum value to the response property for the response status

    • warning

      added the new unsupported_media_type enum value to the /// response property for the response status

    • warning

      added the new unsupported_media_type enum value to the /// response property for the response status

    • warning

      added the new unsupported_media_type enum value to the /// response property for the response status

    • warning

      added the new unsupported_media_type enum value to the /// response property for the response status

    • warning

      added the new conflict enum value to the response property for the response status

    • warning

      added the new conflict enum value to the response property for the response status

    • warning

      added the new conflict enum value to the response property for the response status

    • warning

      added the new conflict enum value to the response property for the response status

    • warning

      added the new conflict enum value to the /// response property for the response status

    • warning

      added the new conflict enum value to the /// response property for the response status

    • warning

      added the new conflict enum value to the /// response property for the response status

    • warning

      added the new conflict enum value to the /// response property for the response status