0

Get next settlement

by
Published Apr 8, 2025

Retrieve the details of the current settlement, that has not yet been paid out. For a complete reference of the settlement object, refer to the [Get settlement endpoint](get-settlement) documentation. For more accurate bookkeeping, refer to the [balance report](get-balance-report) endpoint or the [balance transactions](list-balance-transactions) endpoint. > 🔑 Access with > > Access token with **settlements.read**

Script mollie Verified

The script

Submitted by hugo697 Bun
Verified 428 days ago
1
//native
2
type Mollie = {
3
  token: string;
4
};
5
/**
6
 * Get next settlement
7
 * Retrieve the details of the current settlement, that has not yet been paid out.
8

9
For a complete reference of the settlement object, refer to the [Get settlement endpoint](get-settlement) documentation.
10

11
For more accurate bookkeeping, refer to the [balance report](get-balance-report) endpoint or the [balance transactions](list-balance-transactions) endpoint.
12

13
> 🔑 Access with
14
>
15
> Access token with **settlements.read**
16
 */
17
export async function main(auth: Mollie) {
18
  const url = new URL(`https://api.mollie.com/v2/settlements/next`);
19

20
  const response = await fetch(url, {
21
    method: "GET",
22
    headers: {
23
      Authorization: "Bearer " + auth.token,
24
    },
25
    body: undefined,
26
  });
27
  if (!response.ok) {
28
    const text = await response.text();
29
    throw new Error(`${response.status} ${text}`);
30
  }
31
  return await response.text();
32
}
33