0

Submit onboarding data

by
Published Apr 8, 2025

**⚠️ We no longer recommend implementing this endpoint. Please refer to the Client Links API instead to kick off the onboarding process for your merchants.** Submit data that will be prefilled in the merchant's onboarding. The data you submit will only be processed when the onboarding status is `needs-data`. Information that the merchant has entered in their dashboard will not be overwritten. > 🔑 Access with > > Access token with **onboarding.write**

Script mollie Verified

The script

Submitted by hugo697 Bun
Verified 428 days ago
1
//native
2
type Mollie = {
3
  token: string;
4
};
5
/**
6
 * Submit onboarding data
7
 * **⚠️ We no longer recommend implementing this endpoint. Please refer to the Client Links API instead to kick off the onboarding process for your merchants.**
8

9
Submit data that will be prefilled in the merchant's onboarding. The data you submit will only be processed when the onboarding status is `needs-data`. Information that the merchant has entered in their dashboard will not be
10

11
overwritten.
12

13
> 🔑 Access with
14
>
15
> Access token with **onboarding.write**
16
 */
17
export async function main(
18
  auth: Mollie,
19
  body: {
20
    organization?: {
21
      name?: string;
22
      address?: {
23
        streetAndNumber?: string;
24
        postalCode?: string;
25
        city?: string;
26
        country?: string;
27
      };
28
      registrationNumber?: string;
29
      vatNumber?: string;
30
      vatRegulation?: string;
31
    };
32
    profile?: {
33
      name?: string;
34
      website?: string;
35
      email?: string;
36
      phone?: string;
37
      description?: string;
38
      businessCategory?: string;
39
    };
40
  },
41
) {
42
  const url = new URL(`https://api.mollie.com/v2/onboarding/me`);
43

44
  const response = await fetch(url, {
45
    method: "POST",
46
    headers: {
47
      "Content-Type": "application/json",
48
      Authorization: "Bearer " + auth.token,
49
    },
50
    body: JSON.stringify(body),
51
  });
52
  if (!response.ok) {
53
    const text = await response.text();
54
    throw new Error(`${response.status} ${text}`);
55
  }
56
  return await response.text();
57
}
58