Mollie API TypeScript SDK

1.5.2 · active · verified Sun Apr 19

This is the official TypeScript SDK for interacting with the Mollie Payments API, providing a type-safe and developer-friendly interface. It is currently at version 1.5.2 and maintains a rapid release cadence, with updates often published multiple times a week. The SDK is automatically generated using the Speakeasy CLI based on the Mollie OpenAPI specification, ensuring it stays up-to-date with the latest API changes. Key differentiators include full TypeScript support for robust development, explicit handling for authentication via API keys, organization access tokens, or OAuth, and built-in features like idempotency keys, custom User-Agent headers, pagination helpers, and automatic retry mechanisms. It supports both CommonJS and ES Modules runtimes for broad compatibility.

Common errors

Warnings

Install

Imports

Quickstart

This example initializes the Mollie client with an organization access token and fetches a paginated list of balances in EUR, demonstrating basic client setup and API interaction.

import { Client } from "mollie-api-typescript";

const client = new Client({
  testmode: false,
  security: {
    organizationAccessToken: process.env["CLIENT_ORGANIZATION_ACCESS_TOKEN"]
      ?? "",
  },
});

async function run() {
  try {
    const result = await client.balances.list({
      currency: "EUR",
      from: "bal_gVMhHKqSSRYJyPsuoPNFH",
      limit: 50,
      idempotencyKey: "123e4567-e89b-12d3-a456-426",
    });

    for await (const page of result) {
      console.log(page);
    }
  } catch (error) {
    console.error("Error fetching balances:", error);
  }
}

run();

view raw JSON →