This is a wrapper for the Mollie REST webservice. All payment methods and webservice calls are supported.
$ dotnet add package Mollie.ApiEasily 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.
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!
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:
Install via NuGet:
Install-Package Mollie.ApiYou 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, PaymentClientICustomerClient, CustomerClientISubscriptionClient, SubscriptionClientIMandateClient, MandateClientAfter registering via DI, inject the interface you need in your services or controllers.
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.
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;Mollie offers two different webhook systems:
Install via NuGet:
Install-Package Mollie.Api.AspNet The Mollie.Api.AspNet NuGet package has built in attributes that automatically parse and validate incoming objects in your ASP.NET application. For example:
[HttpPost("full/specific")]
[ServiceFilter(typeof(MollieSignatureFilter))]
public Task<ActionResult> WebhookWithSpecificType([FromMollieWebhook] FullWebhookEventResponse<PaymentLinkResponse> data) {
return Task.FromResult<ActionResult>(Ok());
}For more information about webhooks, take a look at the full webhook documentation on the Wiki page.
Want to see the library in action? Check out the full-featured .NET Blazor example project, which demonstrates real-world usage of several APIs:
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.
This library currently supports the following API's:
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.
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.