0

List capabilities

by
Published Apr 8, 2025

> 🚧 Beta feature > > This feature is currently in beta testing, and the final specification may still change.

Script mollie Verified

The script

Submitted by hugo697 Bun
Verified 428 days ago
1
//native
2
type Mollie = {
3
  token: string;
4
};
5
/**
6
 * List capabilities
7
 * > 🚧 Beta feature
8
>
9
> This feature is currently in beta testing, and the final specification may still change.
10
 */
11
export async function main(auth: Mollie) {
12
  const url = new URL(`https://api.mollie.com/v2/capabilities`);
13

14
  const response = await fetch(url, {
15
    method: "GET",
16
    headers: {
17
      Authorization: "Bearer " + auth.token,
18
    },
19
    body: undefined,
20
  });
21
  if (!response.ok) {
22
    const text = await response.text();
23
    throw new Error(`${response.status} ${text}`);
24
  }
25
  return await response.text();
26
}
27