Webhooks API

Create a webhook

A webhook must have a name, an url and a list of event types. You can also create webhooks in the webhooks settings section of the Dashboard.

🔑 Access with

Advanced access token with webhooks.write

OAuth access with webhooks.write

post/v2/webhooks

Request

  • Base URL
    https://api.mollie.com
  • URL
    https://api.mollie.com/v2/webhooks
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization code: https://my.mollie.com/oauth2/authorize
      Token URL: https://api.mollie.com/oauth2/tokens scopes: webhooks.write

Request body

namestring required

A name that identifies the webhook.

urlstring required

The URL Mollie will send the events to. This URL must be publicly accessible.

testmodeboolean

Whether to create the entity in test mode or live mode.

You can enable test mode by setting testmode to true.

Example request

{
  "name": "Webhook #1",
  "url": "https://mollie.com/",
  "eventTypes": [
    "payment-link.paid"
  ]
}

Response

The webhook object.

resourcestring required

Indicates the response contains a webhook subscription object. Will always contain the string webhook for this endpoint.

idstring required

The identifier uniquely referring to this subscription.

urlstring required

The subscription's events destination.

profileIdstring nullable required

The identifier uniquely referring to the profile that created the subscription.

createdAtstring required

The subscription's date time of creation.

namestring required

The subscription's name.

eventTypesstring[] required

The events types that are subscribed.

statusstring required

The subscription's current status.

Possible values: enabled blocked disabled deleted

modestring required

Whether this entity was created in live mode or in test mode.

Possible values: live test

webhookSecretstring required

The subscription's secret.

Example response

{
  "resource": "webhook",
  "id": "hook_tNP6fpF9fLJpFWziRcgiH",
  "url": "https://example.com/webhook-endpoint",
  "profileId": "pfl_YyoaNFjtHc",
  "createdAt": "2023-01-01T12:00:00+00:00",
  "name": "Profile Updates Webhook",
  "eventTypes": [
    "sales-invoice.paid, sales-invoice.canceled"
  ],
  "status": "enabled",
  "mode": "live",
  "webhookSecret": "secret",
  "_links": {
    "self": {
      "href": "https://...",
      "type": "application/hal+json"
    },
    "documentation": {
      "href": "https://...",
      "type": "application/hal+json"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.