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.
using Mollie ;
using Mollie . Models . Components ;
using Mollie . Models . Requests ;
var sdk = new Client ( security : new Security ( ) {
AdvancedAccessToken = "<YOUR_BEARER_TOKEN_HERE>" ,
} ) ;
var res = await sdk . Webhooks . CreateAsync (
idempotencyKey : "123e4567-e89b-12d3-a456-426" ,
requestBody : new CreateWebhookRequestBody ( ) {
Name = "Webhook #1" ,
Url = "https://mollie.com/" ,
EventTypesList = EventTypesList . CreateWebhookEventTypes (
WebhookEventTypes . PaymentLinkPaid
) ,
Testmode = false ,
}
) ;
// handle response
Parameter
Type
Required
Description
Example
IdempotencyKey
string
➖
A unique key to ensure idempotent requests. This key should be a UUID v4 string.
123e4567-e89b-12d3-a456-426
RequestBody
CreateWebhookRequestBody
➖
N/A
CreateWebhookResponse
Error Type
Status Code
Content Type
Mollie.Models.Errors.ErrorResponse
422, 429
application/hal+json
Mollie.Models.Errors.APIException
4XX, 5XX
*/*
Returns a paginated list of your webhooks. If no webhook endpoints are available, the resulting array will be empty. This request should never throw an error.
using Mollie ;
using Mollie . Models . Components ;
using Mollie . Models . Requests ;
var sdk = new Client (
testmode : false ,
security : new Security ( ) {
AdvancedAccessToken = "<YOUR_BEARER_TOKEN_HERE>" ,
}
) ;
ListWebhooksRequest req = new ListWebhooksRequest ( ) {
From = "hook_B2EyhTH5N4KWUnoYPcgiH" ,
Limit = 50 ,
Sort = Sorting . Desc ,
EventTypes = WebhookEventTypes . PaymentLinkPaid ,
IdempotencyKey = "123e4567-e89b-12d3-a456-426" ,
} ;
ListWebhooksResponse ? res = await sdk . Webhooks . ListAsync ( req ) ;
while ( res != null )
{
// handle items
res = await res . Next ! ( ) ;
}
Parameter
Type
Required
Description
request
ListWebhooksRequest
✔️
The request object to use for the request.
ListWebhooksResponse
Error Type
Status Code
Content Type
Mollie.Models.Errors.ErrorResponse
400, 429
application/hal+json
Mollie.Models.Errors.APIException
4XX, 5XX
*/*
Updates the webhook. You may edit the name, url and the list of subscribed event types.
using Mollie ;
using Mollie . Models . Components ;
using Mollie . Models . Requests ;
var sdk = new Client ( security : new Security ( ) {
AdvancedAccessToken = "<YOUR_BEARER_TOKEN_HERE>" ,
} ) ;
var res = await sdk . Webhooks . UpdateAsync (
webhookId : "hook_1234567890" ,
idempotencyKey : "123e4567-e89b-12d3-a456-426" ,
requestBody : new UpdateWebhookRequestBody ( ) {
Name = "Webhook #1" ,
Url = "https://mollie.com/" ,
EventTypes = EventTypes . CreateWebhookEventTypes (
WebhookEventTypes . PaymentLinkPaid
) ,
Testmode = false ,
}
) ;
// handle response
Parameter
Type
Required
Description
Example
WebhookId
string
✔️
Provide the ID of the related webhook.
hook_1234567890
IdempotencyKey
string
➖
A unique key to ensure idempotent requests. This key should be a UUID v4 string.
123e4567-e89b-12d3-a456-426
RequestBody
UpdateWebhookRequestBody
➖
N/A
UpdateWebhookResponse
Error Type
Status Code
Content Type
Mollie.Models.Errors.ErrorResponse
404, 422, 429
application/hal+json
Mollie.Models.Errors.APIException
4XX, 5XX
*/*
Retrieve a single webhook object by its ID.
Example Usage: get-webhook-200
using Mollie ;
using Mollie . Models . Components ;
var sdk = new Client (
testmode : false ,
security : new Security ( ) {
AdvancedAccessToken = "<YOUR_BEARER_TOKEN_HERE>" ,
}
) ;
var res = await sdk . Webhooks . GetAsync (
webhookId : "hook_1234567890" ,
idempotencyKey : "123e4567-e89b-12d3-a456-426"
) ;
// handle response
Example Usage: get-webhook-200-1
using Mollie ;
using Mollie . Models . Components ;
var sdk = new Client (
testmode : false ,
security : new Security ( ) {
AdvancedAccessToken = "<YOUR_BEARER_TOKEN_HERE>" ,
}
) ;
var res = await sdk . Webhooks . GetAsync (
webhookId : "hook_1234567890" ,
idempotencyKey : "123e4567-e89b-12d3-a456-426"
) ;
// handle response
Parameter
Type
Required
Description
Example
WebhookId
string
✔️
Provide the ID of the related webhook.
hook_1234567890
Testmode
bool
➖
You can enable test mode by setting the testmode query parameter to true. Test entities cannot be retrieved when the endpoint is set to live mode, and vice versa.
IdempotencyKey
string
➖
A unique key to ensure idempotent requests. This key should be a UUID v4 string.
123e4567-e89b-12d3-a456-426
GetWebhookResponse
Error Type
Status Code
Content Type
Mollie.Models.Errors.ErrorResponse
404, 422, 429
application/hal+json
Mollie.Models.Errors.APIException
4XX, 5XX
*/*
Delete a single webhook object by its webhook ID.
using Mollie ;
using Mollie . Models . Components ;
using Mollie . Models . Requests ;
var sdk = new Client ( security : new Security ( ) {
AdvancedAccessToken = "<YOUR_BEARER_TOKEN_HERE>" ,
} ) ;
var res = await sdk . Webhooks . DeleteAsync (
webhookId : "hook_1234567890" ,
idempotencyKey : "123e4567-e89b-12d3-a456-426" ,
requestBody : new DeleteWebhookRequestBody ( ) {
Testmode = false ,
}
) ;
// handle response
Parameter
Type
Required
Description
Example
WebhookId
string
✔️
Provide the ID of the related webhook.
hook_1234567890
IdempotencyKey
string
➖
A unique key to ensure idempotent requests. This key should be a UUID v4 string.
123e4567-e89b-12d3-a456-426
RequestBody
DeleteWebhookRequestBody
➖
N/A
DeleteWebhookResponse
Error Type
Status Code
Content Type
Mollie.Models.Errors.ErrorResponse
404, 422, 429
application/hal+json
Mollie.Models.Errors.APIException
4XX, 5XX
*/*
Sends a test event to the webhook to verify the endpoint is working as expected.
using Mollie ;
using Mollie . Models . Components ;
using Mollie . Models . Requests ;
var sdk = new Client ( security : new Security ( ) {
AdvancedAccessToken = "<YOUR_BEARER_TOKEN_HERE>" ,
} ) ;
var res = await sdk . Webhooks . TestAsync (
webhookId : "hook_1234567890" ,
idempotencyKey : "123e4567-e89b-12d3-a456-426" ,
requestBody : new TestWebhookRequestBody ( ) {
Testmode = false ,
}
) ;
// handle response
Parameter
Type
Required
Description
Example
WebhookId
string
✔️
Provide the ID of the related webhook.
hook_1234567890
IdempotencyKey
string
➖
A unique key to ensure idempotent requests. This key should be a UUID v4 string.
123e4567-e89b-12d3-a456-426
RequestBody
TestWebhookRequestBody
➖
N/A
TestWebhookResponse
Error Type
Status Code
Content Type
Mollie.Models.Errors.ErrorResponse
404, 422, 429
application/hal+json
Mollie.Models.Errors.APIException
4XX, 5XX
*/*