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.
- Sponsor This Project
- Full documentation
- Getting Started
- Supported APIs
- Contributions
- Supported .NET Versions
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:
- Getting started walkthroughs
- All supported APIs and code samples
- Best practices for integration
Install via NuGet:
Install-Package Mollie.Api
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.
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;
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.
This library currently supports the following API's:
- Payment API
- PaymentMethod API
- PaymentLink API
- Customer API
- Mandate API
- Subscription API
- Refund API
- Connect API
- Chargeback API (documentation coming soon)
- Invoice API (documentation coming soon)
- Permissions API (documentation coming soon)
- Profile API
- Organizations API
- Order API
- Capture API
- Onboarding API
- Balances API
- Terminal API (documentation coming soon)
- ClientLink API (documentation coming soon)
- Wallet API (documentation coming soon)
- Client API (documentation coming soon)
- Capability API (documentation coming soon)
- Webhooks API
- WebhooksEvents API
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.