Create client link¶
Note
The Client Links API is in closed beta and only available to selected partners. Please contact your partner manager / partners@mollie.com if you want to implement this.
POST
https://api.mollie.com/v2/client-links
Link a new organization to your OAuth application, in effect creating a new client. This is a two step process.
First, you must send your customer’s details to this endpoint. You can provide data that will be pre-filled during onboarding.
This endpoint’s response will contain a special clientLink
link where you are expected to redirect your customer.
This is the second step.
To the clientLink
link, you must then add the OAuth details of your application, the client_id
, scope
you
want to request et cetera. These are the same parameters the Authorize endpoint takes. All
accepted parameters are listed below.
When you redirect your customer, an organization will be created, your OAuth application will be authorized automatically and your customer will be logged in to their (newly created) Mollie Dashboard.
If the organization already exists, no new organization will be created. Instead the OAuth Authorize screen will be shown to your customer, allowing them to grant the requested authorizations for their existing organization to your OAuth application.
Finally, your customer will be redirected back to you (to the redirect_uri
you specified when creating your OAuth
application). Then, the normal OAuth Authorize flow where you exchange an auth
token for an app access token can be followed.
Once you have received the app access token for the organization, you can perform any other API calls on behalf of the (newly created) organization using OAuth.
Your next step should probably be to create a Profile using the Create profile endpoint and enable the payment methods you want your customer to use with Mollie.
Parameters¶
owner
objectrequiredPersonal data of your customer which is required for this endpoint.
email
stringrequiredgivenName
stringrequiredfamilyName
stringrequiredlocale
stringoptionalAllows you to preset the language to be used in the login / authorize flow. When this parameter is omitted, the
browser language will be used instead. You can provide any xx_XX
format ISO 15897 locale, but the authorize flow
currently only supports the following languages:
Possible values: en_US
nl_NL
nl_BE
fr_FR
fr_BE
de_DE
es_ES
it_IT
name
stringrequiredaddress
address objectrequiredAddress of the organization. Note that the country
parameter must always be provided.
streetAndNumber
stringconditionalpostalCode
stringconditionalcity
stringconditionalcountry
stringrequiredregistrationNumber
stringoptionalvatNumber
stringoptionalThe VAT number of the organization, if based in the European Union or the United Kingdom.
Example: NL123456789B01
Parameters for the clientLink
link¶
The clientLink
link takes a subset of the parameters allowed for the Authorize endpoint:
client_id
, state
, approval_prompt
and scope
.
Note
At a minimum, we recommend you request onboarding.read onboarding.write
and any scopes required for
orders or payments you want to create. onboarding.read
is required if you wish to follow the onboarding
progress via the Get onboarding status endpoint
or Mollie Dashboard.
Example¶
1 | https://my.mollie.com/dashboard/client-link/finalize/csr_vZCnNQsV2UtfXxYifWKWH?client_id=app_j9Pakf56Ajta6Y65AkdTtAv&state=decafbad&scope=onboarding.read+organizations.read+payments.write+payments.read+profiles.write |
In case of an invalid value, your customer will be redirected to the redirect URI set for your OAuth application with
the error
and error_description
query parameters added.
Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | curl -X POST https://api.mollie.com/v2/client-links \ -H "Content-Type: application/json" \ -H "Authorization: Bearer access_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" \ -d '{ "owner": { "email": "norris@chucknorrisfacts.net", "givenName": "Chuck", "familyName": "Norris", "locale": "en_US" }, "address": { "streetAndNumber": "Keizersgracht 126", "postalCode": "1015 CW", "city": "Amsterdam", "country": "NL" }, "name": "Mollie B.V.", "registrationNumber": "30204462", "vatNumber": "NL815839091B01" }' |
1 2 3 4 | We don't have a PHP code example for this API call yet. If you have some time to spare, feel free to share suggestions on our Discord: https://discord.gg/VaTVkXB4aQ |
1 2 3 4 | We don't have a Python code example for this API call yet. If you have some time to spare, feel free to share suggestions on our Discord: https://discord.gg/VaTVkXB4aQ |
1 2 3 4 | We don't have a Ruby code example for this API call yet. If you have some time to spare, feel free to share suggestions on our Discord: https://discord.gg/VaTVkXB4aQ |
1 2 3 4 | We don't have a Node.js code example for this API call yet. If you have some time to spare, feel free to share suggestions on our Discord: https://discord.gg/VaTVkXB4aQ |
Response¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | HTTP/1.1 201 Created Content-Type: application/hal+json; charset=utf-8 { "id": "csr_vZCnNQsV2UtfXxYifWKWH", "resource": "client-link", "_links": { "clientLink": { "href": "https://my.mollie.com/dashboard/client-link/csr_vZCnNQsV2UtfXxYifWKWH", "type": "text/html" }, "documentation": { "href": "https://docs.mollie.com/reference/v2/clients-api/create-client-link", "type": "text/html" } } } |