Skip to main content

PUT /api/v1/internal/projects/:projectUuid/apps/:appUuid/payment-providers/mollie/accounts

Modifies an existing accounts 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/internal/private/bearer/projects/apps/payment-providers/mollie/accounts/put.ts

Request Method

PUT

Base URL

https://api.userdocks.local:5000

Endpoint

/api/v1/internal/projects/:projectUuid/apps/:appUuid/payment-providers/mollie/accounts

Path Variables

VariableTypeRequiredDescription
projectUuidstringtruePath variable from route pattern.
appUuidstringtruePath variable from route pattern.

Query Parameters

VariableTypeRequiredDescription
connectedstringtrueUse false to start or refresh the connect flow, true to finish it.
codestringfalseRequired when connected=true. OAuth authorization code returned by Mollie.
statestringfalseRequired when connected=true. Must match the previously issued OAuth state.

HTTP Headers

VariableTypeRequiredDescription
AuthorizationstringtrueBearer token in the form Bearer <jwt>.
Content-TypestringfalseOptional because this route does not consume a request body.

Request Body

No request body.

Behavior Notes

  • Call the route with connected=false to create a fresh nextAction.url for the Mollie OAuth onboarding flow.
  • Call the same route with connected=true, code, and state after Mollie redirects back to your app.
  • The response may include nextAction.type = "appSettings" when the app is missing business fields required for Mollie.
  • The response may include nextAction.type = "accountLink" when the Mollie account still needs onboarding before it can receive payments.

Successful Response

Success status code(s): 200.

Starting the connection flow:

{
"kind": "paymentProviders",
"totalItems": 1,
"itemsLength": 1,
"items": [
{
"id": 1,
"uuid": "pp_11111111-1111-1111-1111-111111111111",
"appUuid": "app_11111111-1111-1111-1111-111111111111",
"name": "mollie",
"account": "pending_7f1a83c4-44fb-44f4-9648-dcb1c06d9be0",
"profileId": null,
"refreshTokenSecretPath": null,
"providerMetadata": null,
"connected": false,
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z",
"deletedAt": null,
"nextAction": {
"type": "accountLink",
"url": "https://my.mollie.com/oauth2/authorize?client_id=client_123&state=projectUuid-value%3AappUuid-value%3A4ce8d52c-b9d8-4bdd-a4eb-159f662cb1fc"
}
}
]
}

After a successful callback, the route may return an updated provider:

{
"kind": "paymentProviders",
"totalItems": 1,
"itemsLength": 1,
"items": [
{
"id": 1,
"uuid": "pp_11111111-1111-1111-1111-111111111111",
"appUuid": "app_11111111-1111-1111-1111-111111111111",
"name": "mollie",
"account": "org_12345",
"profileId": "pfl_12345",
"refreshTokenSecretPath": "secrets/payment-providers/mollie/pp_11111111-1111-1111-1111-111111111111/refresh-token",
"providerMetadata": {
"onboardingStatus": "completed",
"organizationName": "Example BV",
"canReceivePayments": true,
"canReceiveSettlements": true,
"missingFields": []
},
"connected": true,
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z",
"deletedAt": null
}
]
}

Error Responses

HTTP StatusExample Error
401{"errors":[{"validation":"error","code":"[E4010]","message":"Unauthorized Token"}]}
403{"errors":[{"validation":"error","code":"[E4030]","message":"App Is Disabled"}]}
404{"errors":[{"validation":"error","code":"[E4040]","message":"Not Found"}]}
400{"errors":[{"validation":"error","code":"[E4000]","message":"Bad Request / validation error"}]}
500{"errors":[{"validation":"error","code":"[E0000]","message":"Internal Server Error"}]}

Example

Start the connection:

const startQuery = new URLSearchParams({
connected: 'false',
});
const startUrl = `https://api.userdocks.local:5000/api/v1/internal/projects/projectUuid-value/apps/appUuid-value/payment-providers/mollie/accounts?${startQuery.toString()}`;

const startResponse = await fetch(startUrl, {
method: 'PUT',
headers: {
Authorization: 'Bearer <jwt>',
},
});
const startData = await startResponse.json();
console.log(startResponse.status, startData);

Finish the callback:

const finishQuery = new URLSearchParams({
connected: 'true',
code: '<mollie-auth-code>',
state: '<stored-oauth-state>',
});
const finishUrl = `https://api.userdocks.local:5000/api/v1/internal/projects/projectUuid-value/apps/appUuid-value/payment-providers/mollie/accounts?${finishQuery.toString()}`;

const finishResponse = await fetch(finishUrl, {
method: 'PUT',
headers: {
Authorization: 'Bearer <jwt>',
},
});
const finishData = await finishResponse.json();
console.log(finishResponse.status, finishData);