This is a wrapper for the Mollie REST webservice. All payment methods and webservice calls are supported.


Keywords
Mollie
License
MIT
Install
Install-Package Mollie.Api -Version 4.13.0

Documentation

Mollie Api Client for .NET

NuGet Build GitHub Repo stars GitHub contributors GitHub last commit GitHub commit activity open issues Read the Wiki

Easily integrate the Mollie payment provider into your .NET application.

Full documentation of this library is available on the Wiki β€” including usage examples, API references, and integration tips.

Mollie offers excellent API documentation that we highly recommend reviewing before using this library. If you encounter any issues or have feature requests, feel free to open an issue.

πŸ’¬ Need help with integration?
I’m happy to assist you with your implementation or questions. Feel free to connect with me on LinkedIn β€” I’d love to help!

Have feedback or ideas? Join the official Mollie Developer Discord or open an issue.


πŸ“š Table of Contents


πŸ’– Sponsor This Project

This project is proudly sponsored by Mollie β€” thank you for supporting open source and developer tooling!

If this library has helped you or saved you time, please consider sponsoring me on GitHub as well. Your support helps me keep improving the library and providing integration help to the community!


πŸ“– Full Documentation

Looking for the full API docs, usage examples, and advanced guides?

πŸ‘‰ Check out the full Wiki here:
➑️ https://github.com/Viincenttt/MollieApi/wiki You'll find:

  • Getting started walkthroughs
  • All supported APIs and code samples
  • Best practices for integration

πŸ›  Getting started

Install via NuGet:

Install-Package Mollie.Api

Dependency Injection

You can register all API client interfaces using the built-in DI extension:

builder.Services.AddMollieApi(options => {
    options.ApiKey = builder.Configuration["Mollie:ApiKey"];
    options.RetryPolicy = MollieHttpRetryPolicies.TransientHttpErrorRetryPolicy();
});

Each API (e.g. payments, customers, mandates) has its own dedicated API client class and interface:

  • IPaymentClient, PaymentClient
  • ICustomerClient, CustomerClient
  • ISubscriptionClient, SubscriptionClient
  • IMandateClient, MandateClient
  • ... and more

After registering via DI, inject the interface you need in your services or controllers.

Manual Instantiation

If you prefer not to use DI, you can manually instantiate a client:

using IPaymentClient paymentClient = new PaymentClient("{yourApiKey}", new HttpClient());

If you do not provide a HttpClient, one will be created automatically β€” in that case, remember to dispose the client properly.

πŸš€ Create a Payment in under a minute

Here’s a quick example of how to create an iDEAL payment for €100:

using IPaymentClient paymentClient = new PaymentClient("{yourApiKey}", new HttpClient());

var paymentRequest = new PaymentRequest {
    Amount = new Amount(Currency.EUR, 100.00m),
    Description = "The .NET library makes creating payments so easy!",
    RedirectUrl = "https://github.com/Viincenttt/MollieApi",
    Method = PaymentMethod.Ideal
};

PaymentResponse paymentResponse = await paymentClient.CreatePaymentAsync(paymentRequest);
// Redirect your user to the checkout URL
string checkoutUrl = paymentResponse.Links.Checkout.Href;

πŸ§ͺ Blazor Example Project

Want to see the library in action? Check out the full-featured .NET Blazor example project, which demonstrates real-world usage of several APIs:

  • Payments
  • Payment links
  • Orders
  • Customers
  • Mandates
  • Subscriptions
  • Payment Methods
  • Terminals
  • Webhooks

πŸ”— View the Example Project on GitHub

It’s a great starting point if you’re new to Mollie or want to explore advanced scenarios like multi-step checkouts or managing recurring payments.


πŸ“¦ Supported API's

This library currently supports the following API's:


🀝 Contributions

Spotted a bug or want to add a new feature? Contributions are welcome! Please target the latest development branch and include a clear description of your changes.


βœ… Supported .NET Versions

This library targets .NET Standard 2.0, making it compatible with a wide range of platforms:

.NET implementation Version support
.NET and .NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0
.NET Framework 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Mono 5.4, 6.4
Universal Windows Platform 10.0.16299, TBD
Xamarin.iOS 10.14, 12.16
Xamarin.Mac 3.8, 5.16
Xamarin.Android 8.0, 10.0
Unity 2018.1

⚠️ Note: This library uses the required keyword in some model classes. Your project must target C# 11 or higher.