Skip to main content

POST /api/v1/webhooks/mollie

Creates a new webhooks resource.

This endpoint documentation is generated from the current Fastify route implementation and should be treated as the implementation-level contract for this version of the API.

Source route file: src/api/routes/external/public/webhooks/mollie/post.ts

Request Method​

POST

Base URL​

https://api.userdocks.local:5000

Endpoint​

/api/v1/webhooks/mollie

Path Variables​

No path variables.

Query Parameters​

VariableTypeRequiredDescription
paymentProviderUuidstringtrueIdentifies the connected Mollie provider for the app.

HTTP Headers​

VariableTypeRequiredDescription
Content-TypestringtrueUse application/json for JSON request bodies.

Request Body​

Mollie sends the payment id in the webhook body. Userdocks then fetches the full payment from Mollie using the stored provider credentials.

Example payload shape:

{
"id": "tr_12345"
}

Behavior Notes​

  • If paymentProviderUuid or id is missing, the route returns { "received": true, "ignored": true }.
  • mode: "setup" refunds the setup payment and stores the card mandate.
  • mode: "payment" creates a local one-time payment record.
  • mode: "subscription" creates or updates the local subscription after the first payment succeeds.

Successful Response​

Success status code(s): 200.

Typical success payload:

{
"received": true
}

Ignored payload example:

{
"received": true,
"ignored": true
}

Unsuccessful payment example:

{
"received": true,
"status": "open"
}

Error Responses​

HTTP StatusExample Error
500{"errors":[{"validation":"error","code":"[E0000]","message":"Internal Server Error"}]}

Example​

const query = new URLSearchParams({
paymentProviderUuid: '11111111-1111-1111-1111-111111111111',
});
const url = `https://api.userdocks.local:5000/api/v1/webhooks/mollie?${query.toString()}`;

const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: '{"id":"tr_12345"}',
});
const data = await response.json();
console.log(response.status, data);