### Install Mollie.Api NuGet Package Source: https://github.com/viincenttt/mollieapi/blob/development/README.md Install the Mollie API client library using the NuGet Package Manager Console. ```bash Install-Package Mollie.Api ``` -------------------------------- ### Install Mollie.Api.AspNet NuGet Package for Webhooks Source: https://github.com/viincenttt/mollieapi/blob/development/README.md Install the ASP.NET integration package to enable automatic webhook parsing and validation in your web application. ```bash Install-Package Mollie.Api.AspNet ``` -------------------------------- ### Install Mollie ASP.NET package Source: https://github.com/viincenttt/mollieapi/wiki/01.-Getting-started Use the .NET CLI to add the required package to your project. ```bash dotnet add package Mollie.Api.AspNet ``` -------------------------------- ### GET /onboarding/status Source: https://github.com/viincenttt/mollieapi/wiki/13.-Onboarding-Api Retrieves the current onboarding status of the authenticated organization. ```APIDOC ## GET /onboarding/status ### Description Get the status of onboarding of the authenticated organization. ### Method GET ### Endpoint /onboarding/status ### Request Example ```csharp using IOnboardingClient onboardingClient = new OnboardingClient({yourApiKey}); OnboardingStatusResponse onboardingResponse = await onboardingClient.GetOnboardingStatusAsync(); ``` ``` -------------------------------- ### Start ngrok for local webhook testing Source: https://github.com/viincenttt/mollieapi/wiki/01.-Getting-started Command to expose a local HTTPS port to the internet for receiving webhook callbacks. ```bash ngrok http https://localhost:{your-https-port} ``` -------------------------------- ### Create order with specific payment parameters (Bank Transfer) Source: https://github.com/viincenttt/mollieapi/wiki/08.-Order-API This example demonstrates creating an order with specific payment parameters, such as setting the billing email and due date for a bank transfer. Refer to Mollie's documentation for a full list of payment-specific parameters. ```csharp using IOrderClient orderClient = new OrderClient("{yourApiKey}"); OrderRequest orderRequest = new OrderRequest() { Amount = new Amount(Currency.EUR, 100.00m), OrderNumber = "16738", Method = PaymentMethod.BankTransfer, Payment = new BankTransferSpecificParameters { BillingEmail = "example@example.nl" }, Lines = new List() { new OrderLineRequest() { Name = "A box of chocolates", Quantity = 1, UnitPrice = new Amount(Currency.EUR, 100.00m), TotalAmount = new Amount(Currency.EUR, 100.00m), VatRate = "21.00", VatAmount = new Amount(Currency.EUR, "17.36") } }, BillingAddress = new OrderAddressDetails() { GivenName = "John", FamilyName = "Smit", Email = "johnsmit@gmail.com", City = "Rotterdam", Country = "NL", PostalCode = "0000AA", Region = "Zuid-Holland", StreetAndNumber = "Coolsingel 1" }, RedirectUrl = "http://www.google.nl", Locale = Locale.nl_NL }; ``` -------------------------------- ### GET /balances Source: https://github.com/viincenttt/mollieapi/wiki/15.-Balances-Api Retrieve a list of all organization balances. ```APIDOC ## GET /balances ### Description Retrieve all the organization’s balances, including the primary balance, ordered from newest to oldest. ### Method GET ### Endpoint /balances ``` -------------------------------- ### Create an iDEAL Payment Source: https://github.com/viincenttt/mollieapi/blob/development/README.md Example of creating an iDEAL payment request with specified amount, description, redirect URL, and payment method. The response contains a checkout URL for the user. ```csharp 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; ``` -------------------------------- ### GET /webhooks Source: https://github.com/viincenttt/mollieapi/wiki/19.-Webhook-Api Retrieves a list of webhooks with optional pagination. ```APIDOC ## GET /webhooks ### Description Retrieves a list of configured webhooks. Supports pagination via offset and count parameters. ### Parameters #### Query Parameters - **offset** (int) - Optional - Number of items to skip. - **count** (int) - Optional - Number of items to return. ``` -------------------------------- ### GET /organizations/me Source: https://github.com/viincenttt/mollieapi/wiki/09.-Organization-API Retrieve the currently authenticated organization. ```APIDOC ## GET /organizations/me ### Description Retrieve the currently authenticated organization. ### Method GET ### Endpoint /organizations/me ### Request Example ```csharp using IOrganizationClient client = new OrganizationClient("{yourApiKey}"); OrganizationResponse result = await client.GetCurrentOrganizationAsync(); ``` ``` -------------------------------- ### Register Mollie API with Dependency Injection Source: https://github.com/viincenttt/mollieapi/blob/development/README.md Configure the Mollie API client services in your .NET application using dependency injection. This example shows how to set the API key and a retry policy. ```csharp builder.Services.AddMollieApi(options => { options.ApiKey = builder.Configuration["Mollie:ApiKey"]; options.RetryPolicy = MollieHttpRetryPolicies.TransientHttpErrorRetryPolicy(); }); ``` -------------------------------- ### Get Onboarding Status Source: https://github.com/viincenttt/mollieapi/wiki/13.-Onboarding-Api Retrieve the onboarding status for the authenticated organization. Requires an initialized OnboardingClient with your API key. ```C# using IOnboardingClient onboardingClient = new OnboardingClient({yourApiKey}); OnboardingStatusResponse onboardingResponse = await onboardingClient.GetOnboardingStatusAsync(); ``` -------------------------------- ### GET /customers Source: https://github.com/viincenttt/mollieapi/wiki/05.-Customer-API Retrieves a list of customers. Supports pagination using offset and count parameters. ```APIDOC ## GET /customers ### Description Retrieves a list of customers. Supports pagination using offset and count parameters. ### Method GET ### Endpoint /customers ### Parameters #### Query Parameters - **offset** (integer) - Optional - The number of customers to skip before returning results. - **count** (integer) - Optional - The maximum number of customers to return. ### Request Example ```csharp using ICustomerClient customerClient = new CustomerClient("{yourApiKey}"); ListResponse response = await customerClient.GetCustomerListAsync(); ``` ### Response #### Success Response (200) - **response** (ListResponse) - A list of customer objects. #### Response Example ```json { "_count": 2, "_embedded": { "customers": [ { "id": "cst_dK284g9p", "name": "John Doe", "email": "john.doe@example.com", "locale": "nl_NL", "metadata": null, "mode": "test", "createdDatetime": "2023-10-27T10:00:00+00:00" }, { "id": "cst_aBcDeFgH", "name": "Jane Smith", "email": "jane.smith@example.com", "locale": "en_US", "metadata": null, "mode": "test", "createdDatetime": "2023-10-26T09:00:00+00:00" } ] }, "_links": { "self": {"href": "https://api.mollie.com/v2/customers?offset=0&count=2"}, "next": {"href": "https://api.mollie.com/v2/customers?offset=2&count=2"} } } ``` ``` -------------------------------- ### GET /customers/{customerId} Source: https://github.com/viincenttt/mollieapi/wiki/05.-Customer-API Retrieves a single customer by their unique ID. ```APIDOC ## GET /customers/{customerId} ### Description Retrieves a single customer by their unique ID. ### Method GET ### Endpoint /customers/{customerId} ### Parameters #### Path Parameters - **customerId** (string) - Required - The unique identifier of the customer. ### Request Example ```csharp using ICustomerClient customerClient = new CustomerClient("{yourApiKey}"); CustomerResponse customerResponse = await customerClient.GetCustomerAsync(customerId); ``` ### Response #### Success Response (200) - **customerResponse** (CustomerResponse) - The customer object. #### Response Example ```json { "id": "cst_dK284g9p", "name": "John Doe", "email": "john.doe@example.com", "locale": "nl_NL", "metadata": null, "mode": "test", "createdDatetime": "2023-10-27T10:00:00+00:00" } ``` ``` -------------------------------- ### GET /customers/{customerId}/subscriptions/{subscriptionId} Source: https://github.com/viincenttt/mollieapi/wiki/07.-Subscription-API Retrieve a subscription by its ID and its customer’s ID. ```APIDOC ## GET /customers/{customerId}/subscriptions/{subscriptionId} ### Description Retrieve a subscription by its ID and its customer’s ID. ### Method GET ### Endpoint /customers/{customerId}/subscriptions/{subscriptionId} ### Parameters #### Path Parameters - **customerId** (string) - Required - The ID of the customer. - **subscriptionId** (string) - Required - The ID of the subscription. ``` -------------------------------- ### GET /customers/{customerId}/mandates Source: https://github.com/viincenttt/mollieapi/wiki/06.-Mandate-API Retrieves a list of all mandates for a given customer, with optional pagination. ```APIDOC ## GET /customers/{customerId}/mandates ### Description Retrieve all mandates for the given customerId, ordered from newest to oldest. Mollie allows you to set offset and count properties so you can paginate the list. The offset and count parameters are optional. ### Method GET ### Endpoint `/customers/{customerId}/mandates` ### Parameters #### Path Parameters - **customerId** (string) - Required - The ID of the customer whose mandates are to be retrieved. #### Query Parameters - **offset** (integer) - Optional - The number of mandates to skip before returning results. - **count** (integer) - Optional - The maximum number of mandates to return. ### Request Example ```csharp using IMandateClient mandateclient = new MandateClient("{yourApiKey}"); ListResponse response = await mandateclient.GetMandateListAsync("{customerId}"); ``` ### Response #### Success Response (200) - **response** (ListResponse) - A paginated list of mandate responses. #### Response Example (Response structure will be a list of MandateResponse objects, potentially with pagination metadata) ``` -------------------------------- ### GET /terminals Source: https://github.com/viincenttt/mollieapi/wiki/16.-Terminal-Api Retrieve all point-of-sale terminal devices linked to your organization or profile, ordered from newest to oldest. ```APIDOC ## GET /terminals ### Description Retrieve all point-of-sale terminal devices linked to your organization or profile, ordered from newest to oldest. ### Method GET ### Endpoint /terminals ### Request Example ```csharp using ITerminalClient client = new TerminalClient({yourApiKey}); ListResponse response = await client.GetTerminalListAsync(); ``` ``` -------------------------------- ### Get Terminal by ID Source: https://github.com/viincenttt/mollieapi/wiki/16.-Terminal-Api Retrieve a specific point-of-sale terminal device by its unique identifier. Requires an initialized TerminalClient. ```C# using ITerminalClient client = new TerminalClient({yourApiKey}); TerminalResponse response = await client.GetTerminalAsync({yourTerminalId}); ``` -------------------------------- ### Get Primary Balance Report Source: https://github.com/viincenttt/mollieapi/wiki/15.-Balances-Api Retrieve a summarized report for movements on your primary balance within a given timeframe, grouped by status. Requires your API key and a specified grouping. ```C# using IBalanceClient client = new BalanceClient({yourApiKey}); string reportGrouping = ReportGrouping.StatusBalances; BalanceReportResponse balanceReport = await this._balanceClient.GetPrimaryBalanceReportAsync(grouping: reportGrouping); ``` -------------------------------- ### GET /balances/primary/transactions Source: https://github.com/viincenttt/mollieapi/wiki/15.-Balances-Api List all movements on the primary balance. ```APIDOC ## GET /balances/primary/transactions ### Description Retrieve a list of all the movements on your primary balance, including payments, refunds, chargebacks, and settlements. ### Method GET ### Endpoint /balances/primary/transactions ``` -------------------------------- ### Create a Webhook Source: https://github.com/viincenttt/mollieapi/wiki/19.-Webhook-Api Initializes a new webhook with specified event types and test mode settings. ```c# var request = new WebhookRequest { Name = "my-webhook", Url = "https://github.com/Viincenttt/MollieApi/", EventTypes = [WebhookEventTypes.PaymentLinkPaid, WebhookEventTypes.SalesInvoiceCreated], Testmode = true }; using IWebhookClient client = new WebhookClient("{yourKey}"); WebhookResponse response = await client.CreateWebhookAsync(customerRequest); ``` -------------------------------- ### GET /balances/primary Source: https://github.com/viincenttt/mollieapi/wiki/15.-Balances-Api Retrieve the primary balance of the account. ```APIDOC ## GET /balances/primary ### Description Retrieve the primary balance. This is the balance of your account’s primary currency, where all payments are settled to by default. ### Method GET ### Endpoint /balances/primary ``` -------------------------------- ### Manually Instantiate Payment Client Source: https://github.com/viincenttt/mollieapi/blob/development/README.md Create a new instance of the PaymentClient without using dependency injection. Ensure to dispose of the HttpClient if one is not provided. ```csharp using IPaymentClient paymentClient = new PaymentClient("{yourApiKey}", new HttpClient()); ``` -------------------------------- ### GET /organizations/{organizationId} Source: https://github.com/viincenttt/mollieapi/wiki/09.-Organization-API Retrieve a specific organization by its ID. ```APIDOC ## GET /organizations/{organizationId} ### Description Retrieve a specific organization by its ID. ### Method GET ### Endpoint /organizations/{organizationId} ### Parameters #### Path Parameters - **organizationId** (string) - Required - The unique identifier of the organization. ### Request Example ```csharp using IOrganizationClient client = new OrganizationClient("{yourApiKey}"); OrganizationResponse result = await client.GetOrganizationAsync({organizationId}); ``` ``` -------------------------------- ### Submit Onboarding Data Source: https://github.com/viincenttt/mollieapi/wiki/13.-Onboarding-Api Submit data to prefill merchant onboarding when the status is 'needs-data'. Ensure the data is accurate as it will be processed upon submission. ```C# SubmitOnboardingDataRequest submitOnboardingDataRequest = new SubmitOnboardingDataRequest() { Organization = new OnboardingOrganizationRequest() { Name = {name}, Address = new AddressObject() { StreetAndNumber = {streetAndNumber} } }, Profile = new OnboardingProfileRequest() { Name = {name} } }; using IOnboardingClient onboardingClient = new OnboardingClient({yourApiKey}); await onboardingClient.SubmitOnboardingDataAsync(submitOnboardingDataRequest); ``` -------------------------------- ### GET /balances/{balanceId}/transactions Source: https://github.com/viincenttt/mollieapi/wiki/15.-Balances-Api List all movements on a specific balance. ```APIDOC ## GET /balances/{balanceId}/transactions ### Description Retrieve a list of all the movements on your balance, including payments, refunds, chargebacks, and settlements. ### Method GET ### Endpoint /balances/{balanceId}/transactions ### Parameters #### Path Parameters - **balanceId** (string) - Required - The unique identifier for the balance. ``` -------------------------------- ### GET /balances/primary/report Source: https://github.com/viincenttt/mollieapi/wiki/15.-Balances-Api Retrieve a summarized report for all movements on the primary balance. ```APIDOC ## GET /balances/primary/report ### Description Retrieve a summarized report for all movements on your primary balance within a given timeframe. ### Method GET ### Endpoint /balances/primary/report ### Parameters #### Query Parameters - **grouping** (string) - Required - The report format (status-balances or transaction-categories). ``` -------------------------------- ### Create a Standard Payment Source: https://github.com/viincenttt/mollieapi/wiki/02.-Payment-API Use this snippet to create a basic payment request. Ensure your API key is correctly set. ```csharp using IPaymentClient paymentClient = new PaymentClient("{yourApiKey}"); PaymentRequest paymentRequest = new PaymentRequest() { Amount = new Amount(Currency.EUR, 100.00m), Description = "Test payment of the example project", RedirectUrl = "http://google.com" }; PaymentResponse paymentResponse = await paymentClient.CreatePaymentAsync(paymentRequest); string checkoutUrl = paymentResponse.Links.Checkout.Href; ``` -------------------------------- ### GET /webhooks/{id} Source: https://github.com/viincenttt/mollieapi/wiki/19.-Webhook-Api Retrieves details of a specific webhook by its ID. ```APIDOC ## GET /webhooks/{id} ### Description Retrieves the details of a specific webhook using its unique identifier. ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the webhook. ``` -------------------------------- ### POST /onboarding/submit Source: https://github.com/viincenttt/mollieapi/wiki/13.-Onboarding-Api Submits data to be prefilled in the merchant's onboarding process. This data is only processed when the status is 'needs-data'. ```APIDOC ## POST /onboarding/submit ### Description Submit data that will be prefilled in the merchant’s onboarding. Please note that the data you submit will only be processed when the onboarding status is needs-data. ### Method POST ### Endpoint /onboarding/submit ### Request Body - **Organization** (Object) - Required - The organization details including name and address. - **Profile** (Object) - Required - The profile details including name. ### Request Example ```csharp SubmitOnboardingDataRequest submitOnboardingDataRequest = new SubmitOnboardingDataRequest() { Organization = new OnboardingOrganizationRequest() { Name = {name}, Address = new AddressObject() { StreetAndNumber = {streetAndNumber} } }, Profile = new OnboardingProfileRequest() { Name = {name} } }; using IOnboardingClient onboardingClient = new OnboardingClient({yourApiKey}); await onboardingClient.SubmitOnboardingDataAsync(submitOnboardingDataRequest); ``` ``` -------------------------------- ### Implement Unit Tests for API Clients Source: https://github.com/viincenttt/mollieapi/blob/development/AGENTS.md Follow the Arrange/Act/Assert pattern using xUnit, Shouldly, and MockHttpMessageHandler to test API client methods. ```csharp [Fact] public async Task GetFooAsync_WithValidId_ResponseIsDeserializedCorrectly() { // Given const string fooId = "foo_123"; const string jsonResponse = "{ ... }"; var mockHttp = CreateMockHttpMessageHandler( HttpMethod.Get, $"{BaseMollieClient.DefaultBaseApiEndPoint}foos/{fooId}", jsonResponse); var client = new FooClient("test_api_key", mockHttp.ToHttpClient()); // When FooResponse result = await client.GetFooAsync(fooId); // Then result.Id.ShouldBe(fooId); mockHttp.VerifyNoOutstandingExpectation(); } ``` -------------------------------- ### GET /payments Source: https://github.com/viincenttt/mollieapi/wiki/02.-Payment-API Retrieves a paginated list of payments with optional sorting. ```APIDOC ## GET /payments ### Description Retrieves a list of payments. Supports pagination via offset and count, and sorting direction. ### Method GET ### Endpoint /payments ### Parameters #### Query Parameters - **offset** (string) - Optional - The number of payments to skip. - **count** (string) - Optional - The number of payments to retrieve (max 250). - **from** (string) - Optional - The payment ID to start from. - **sort** (string) - Optional - The sort direction (e.g., Asc or Desc). ``` -------------------------------- ### Create a payment link Source: https://github.com/viincenttt/mollieapi/wiki/14.-Payment-link-Api Initializes a new payment link with a specified amount, description, and expiration date. ```C# PaymentLinkRequest paymentLinkRequest = new PaymentLinkRequest() { Description = "Test", Amount = new Amount(Currency.EUR, 50), WebhookUrl = this.DefaultWebhookUrl, RedirectUrl = this.DefaultRedirectUrl, ExpiresAt = DateTime.Now.AddDays(1) }; using IPaymentLinkClient client = new PaymentLinkClient({yourApiKey}); PaymentLinkResponse createdPaymentLink = await this._paymentLinkClient.CreatePaymentLinkAsync(paymentLinkRequest); ``` -------------------------------- ### Create customer payment Source: https://github.com/viincenttt/mollieapi/wiki/05.-Customer-API Initiates a payment specifically for a given customer. ```c# PaymentRequest paymentRequest = new PaymentRequest() { Amount = new Amount(Currency.EUR, 100.00m), Description = "{description}", RedirectUrl = this.DefaultRedirectUrl, }; using ICustomerClient customerClient = new CustomerClient("{yourApiKey}"); PaymentResponse result = await customerClient.CreateCustomerPayment({customerId}, paymentRequest); ``` -------------------------------- ### GET /balances/{balanceId}/report Source: https://github.com/viincenttt/mollieapi/wiki/15.-Balances-Api Retrieve a balance report for a specific balance. ```APIDOC ## GET /balances/{balanceId}/report ### Description Retrieve reports in status-balances or transaction-categories format. ### Method GET ### Endpoint /balances/{balanceId}/report ### Parameters #### Path Parameters - **balanceId** (string) - Required - The unique identifier for the balance. #### Query Parameters - **grouping** (string) - Required - The report format (status-balances or transaction-categories). ``` -------------------------------- ### Create a balance transfer request in C# Source: https://github.com/viincenttt/mollieapi/wiki/21.-Balance-Transfer-API Initializes a BalanceTransferRequest object and uses the BalanceTransferClient to execute the creation. ```C# BalanceTransferRequest request = new() { Description = "Test Description", Amount = new Amount(Currency.EUR, 50), Source = new BalanceTransferParty { Id = "source", Description = "Test Source", Type = "organization" }, Destination = new BalanceTransferParty { Id = "destination", Description = "Test Destination", Type = "organization" } }; using var balanceTransferClient = new BalanceTransferClient({yourOAuthToken}); BalanceTransferResponse response = await balanceTransferClient.CreateBalanceTransferAsync(request); ``` -------------------------------- ### GET /balances/{balanceId} Source: https://github.com/viincenttt/mollieapi/wiki/15.-Balances-Api Retrieve a specific balance using its unique identifier. ```APIDOC ## GET /balances/{balanceId} ### Description Retrieve a balance using a balance id string identifier. ### Method GET ### Endpoint /balances/{balanceId} ### Parameters #### Path Parameters - **balanceId** (string) - Required - The unique identifier for the balance. ``` -------------------------------- ### Generate Client Link URL with Parameters Source: https://github.com/viincenttt/mollieapi/wiki/17.-Client-Link-Api After creating a client link, use this to generate the full URL, including OAuth details, client ID, requested scope, and approval prompt. Requires the client link URL obtained from the API response. ```C# using IClientLinkClient client = new ClientLinkClient({yourClientId}, {yourClientSecret}); ClientLinkResponse response = await clientLinkClient.CreateClientLinkAsync(request); var clientLinkUrl = response.Links.ClientLink; string result = clientLinkClient.GenerateClientLinkWithParameters(clientLinkUrl, {yourState}, {yourScope}, {forceApprovalPrompt}); ``` -------------------------------- ### Create a client link Source: https://github.com/viincenttt/mollieapi/wiki/17.-Client-Link-Api Link a new organization to your OAuth application, in effect creating a new client. ```APIDOC ## POST /client/link ### Description Creates a new client link, associating an organization with your OAuth application. ### Method POST ### Endpoint /client/link ### Request Body - **owner** (object) - Required - Information about the owner of the organization. - **email** (string) - Required - The email address of the owner. - **givenName** (string) - Required - The given name of the owner. - **familyName** (string) - Required - The family name of the owner. - **locale** (string) - Required - The locale for the owner. - **address** (object) - Required - The address of the organization. - **streetAndNumber** (string) - Required - The street name and number. - **postalCode** (string) - Required - The postal code. - **city** (string) - Required - The city. - **country** (string) - Required - The country code (e.g., 'NL'). - **name** (string) - Required - The name of the organization. - **registrationNumber** (string) - Optional - The registration number of the organization. - **vatNumber** (string) - Optional - The VAT number of the organization. ### Request Example ```json { "owner": { "email": "norris@chucknorrisfacts.net", "givenName": "Chuck", "familyName": "Norris", "locale": "en_US" }, "address": { "streetAndNumber": "Keizersgracht 126", "postalCode": "1015 CW", "city": "Amsterdam", "country": "NL" }, "name": "Mollie B.V.", "registrationNumber": "30204462", "vatNumber": "NL815839091B01" } ``` ### Response #### Success Response (200) - **links** (object) - Contains links related to the client link. - **clientLink** (string) - The URL to the client link. #### Response Example ```json { "links": { "clientLink": "https://www.mollie.com/oauth2/clients/new?client_id=abc123..." } } ``` ``` -------------------------------- ### GET /orders/{orderId}/refunds Source: https://github.com/viincenttt/mollieapi/wiki/04.-Refund-API Retrieves a list of all refunds for a specific order. ```APIDOC ## List order refunds ### Description Retrieves a list of all refunds associated with a specific order. ### Method GET ### Endpoint /v2/orders/{orderId}/refunds ### Parameters #### Path Parameters - **orderId** (string) - Required - The ID of the order. ### Response #### Success Response (200 OK) - **count** (integer) - The number of refunds returned. - **_embedded** (object) - Contains the list of refunds. - **refunds** (array) - A list of refund objects. - **id** (string) - The unique identifier for the refund. - **orderId** (string) - The ID of the order this refund is associated with. - **lines** (array) - Details of the refunded order lines. - **id** (string) - The ID of the order line. - **quantity** (integer) - The quantity refunded. - **amount** (object) - The amount refunded for this line. - **currency** (string) - The currency of the amount. - **value** (string) - The refund value. - **status** (string) - The status of the refund. #### Response Example ```json { "count": 1, "_embedded": { "refunds": [ { "id": "ord_rfnd_4Kqf7p9f4", "orderId": "ord_4Kqf7p9f4", "lines": [ { "id": "odl_4Kqf7p9f4", "quantity": 5, "amount": { "currency": "EUR", "value": "5.00" } } ], "status": "succeeded", "_links": { "self": {"href": "https://api.mollie.com/v2/orders/ord_4Kqf7p9f4/refunds/ord_rfnd_4Kqf7p9f4"}, "order": {"href": "https://api.mollie.com/v2/orders/ord_4Kqf7p9f4"} } } ] } } ``` ``` -------------------------------- ### Typical Method Signature for Mollie API Client Source: https://github.com/viincenttt/mollieapi/blob/development/AGENTS.md Illustrates a standard method signature for interacting with Mollie API resources. It includes parameter validation, query parameter construction, and asynchronous operation handling with cancellation tokens. ```csharp public async Task GetFooAsync( string fooId, bool testmode = false, CancellationToken cancellationToken = default) { ValidateRequiredUrlParameter(nameof(fooId), fooId); var queryParameters = BuildQueryParameters(testmode: testmode); return await GetAsync( $"foos/{fooId}{queryParameters.ToQueryString()}", cancellationToken: cancellationToken).ConfigureAwait(false); } ``` -------------------------------- ### Get a payout by ID Source: https://github.com/viincenttt/mollieapi/wiki/22.-Payout-API Retrieves details of a specific payout using its unique ID. ```APIDOC ## Get a payout by ID ### Description Retrieves the details of a specific payout using its unique identifier. ### Method GET ### Endpoint /v2/payouts/{payoutId} ### Parameters #### Path Parameters - **payoutId** (string) - Required - The unique identifier of the payout to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the payout. - **balanceId** (string) - The ID of the balance the payout originated from. - **amount** (object) - The payout amount. - **currency** (string) - The currency of the amount. - **value** (string) - The value of the amount. - **description** (string) - The description of the payout. - **status** (string) - The current status of the payout. - **createdAt** (string) - The date and time the payout was created. #### Response Example ```json { "id": "po_38a3efj", "balanceId": "bal_gVMhHKqSSRYJyPsuoPNFH", "amount": { "currency": "EUR", "value": "10.00" }, "description": "My payout description", "status": "completed", "createdAt": "2023-01-01T10:00:00+00:00" } ``` ``` -------------------------------- ### GET /payments/{paymentId}/refunds Source: https://github.com/viincenttt/mollieapi/wiki/04.-Refund-API Lists all refunds for a specific payment, with optional pagination. ```APIDOC ## List payment refunds ### Description Retrieves a list of all refunds for a specific payment. Supports pagination using `offset` and `count` parameters. ### Method GET ### Endpoint /v2/payments/{paymentId}/refunds ### Parameters #### Path Parameters - **paymentId** (string) - Required - The ID of the payment. #### Query Parameters - **offset** (integer) - Optional - The number of refunds to skip. Defaults to 0. - **count** (integer) - Optional - The maximum number of refunds to return. Defaults to 20. ### Response #### Success Response (200 OK) - **count** (integer) - The number of refunds returned. - **_embedded** (object) - Contains the list of refunds. - **refunds** (array) - A list of refund objects. - **id** (string) - The unique identifier for the refund. - **amount** (object) - The amount that was refunded. - **currency** (string) - The currency of the amount. - **value** (string) - The refund value. - **paymentId** (string) - The ID of the payment this refund is associated with. - **status** (string) - The status of the refund. #### Response Example ```json { "count": 1, "_embedded": { "refunds": [ { "id": "re_4Kqf7p9f4", "amount": { "currency": "EUR", "value": "100.00" }, "paymentId": "tr_4Kqf7p9f4", "status": "succeeded", "_links": { "self": {"href": "https://api.mollie.com/v2/payments/tr_4Kqf7p9f4/refunds/re_4Kqf7p9f4"}, "payment": {"href": "https://api.mollie.com/v2/payments/tr_4Kqf7p9f4"} } } ] } } ``` ``` -------------------------------- ### GET /terminals/{terminalId} Source: https://github.com/viincenttt/mollieapi/wiki/16.-Terminal-Api Retrieve details for a specific point-of-sale terminal by its unique identifier. ```APIDOC ## GET /terminals/{terminalId} ### Description Retrieve details for a specific point-of-sale terminal by its unique identifier. ### Method GET ### Endpoint /terminals/{terminalId} ### Parameters #### Path Parameters - **terminalId** (string) - Required - The unique identifier of the terminal. ### Request Example ```csharp using ITerminalClient client = new TerminalClient({yourApiKey}); TerminalResponse response = await client.GetTerminalAsync({yourTerminalId}); ``` ``` -------------------------------- ### Create a Client Link Source: https://github.com/viincenttt/mollieapi/wiki/17.-Client-Link-Api Use this to link a new organization to your OAuth application. Ensure you have the necessary client ID and secret for authentication. ```C# var request = new ClientLinkRequest { Owner = new ClientLinkOwner { Email = "norris@chucknorrisfacts.net", GivenName = "Chuck", FamilyName = "Norris", Locale = "en_US" }, Address = new AddressObject() { StreetAndNumber = "Keizersgracht 126", PostalCode = "1015 CW", City = "Amsterdam", Country = "NL" }, Name = "Mollie B.V.", RegistrationNumber = "30204462", VatNumber = "NL815839091B01" }; using IClientLinkClient client = new ClientLinkClient({yourClientId}, {yourClientSecret}); ClientLinkResponse response = await clientLinkClient.CreateClientLinkAsync(request); ``` -------------------------------- ### Get Profile API Source: https://github.com/viincenttt/mollieapi/wiki/11.-Profile-Api Retrieves the details of a specific profile using its unique identifier. ```APIDOC ## GET /profiles/{profileId} ### Description Retrieves the details of a specific website profile. ### Method GET ### Endpoint /profiles/{profileId} ### Parameters #### Path Parameters - **profileId** (string) - Required - The unique identifier of the profile to retrieve. ### Response #### Success Response (200) - **ProfileResponse** (object) - Details of the requested profile. #### Response Example ```json { "id": "pfl_xxxxxxxxxx", "name": "Example Company", "website": "https://example.com", "mode": "test", "createdAt": "2023-10-27T10:00:00+00:00" } ``` ``` -------------------------------- ### Create a manual payment capture Source: https://github.com/viincenttt/mollieapi/wiki/12.-Captures-API Configures a payment for manual capture and executes the capture request using the capture client. ```C# PaymentRequest paymentRequest = new PaymentRequest() { Amount = new Amount(Currency.EUR, 10m), Description = "Description", RedirectUrl = RedirectUrl = "http://www.google.nl", Method = PaymentMethod.CreditCard, CaptureMode = CaptureMode.Manual }; using IPaymentClient paymentClient = new PaymentClient({yourApiKey}); var paymentResponse = await paymentClient.GetPaymentAsync(paymentResponse.Id); CaptureResponse captureResponse = await _captureClient.CreateCapture(paymentResponse.Id, new CaptureRequest { Amount = new Amount(Currency.EUR, 10m), Description = "capture" }); using ICaptureClient captureClient = new CaptureClient({yourApiKey}); CaptureResponse result = await captureClient.GetCaptureAsync({paymentId}, {captureId}); ``` -------------------------------- ### GET /payments/{paymentId}/refunds/{refundId} Source: https://github.com/viincenttt/mollieapi/wiki/04.-Refund-API Retrieves a specific refund for a given payment. ```APIDOC ## Retrieve a refund by payment and refund id ### Description Retrieves a specific refund for a given payment using its payment ID and refund ID. ### Method GET ### Endpoint /v2/payments/{paymentId}/refunds/{refundId} ### Parameters #### Path Parameters - **paymentId** (string) - Required - The ID of the payment. - **refundId** (string) - Required - The ID of the refund. ### Response #### Success Response (200 OK) - **id** (string) - The unique identifier for the refund. - **amount** (object) - The amount that was refunded. - **currency** (string) - The currency of the amount. - **value** (string) - The refund value. - **paymentId** (string) - The ID of the payment this refund is associated with. - **status** (string) - The status of the refund. #### Response Example ```json { "id": "re_4Kqf7p9f4", "amount": { "currency": "EUR", "value": "100.00" }, "paymentId": "tr_4Kqf7p9f4", "status": "succeeded", "_links": { "self": {"href": "https://api.mollie.com/v2/payments/tr_4Kqf7p9f4/refunds/re_4Kqf7p9f4"}, "payment": {"href": "https://api.mollie.com/v2/payments/tr_4Kqf7p9f4"} } } ``` ``` -------------------------------- ### POST /webhooks Source: https://github.com/viincenttt/mollieapi/wiki/19.-Webhook-Api Creates a new webhook configuration. ```APIDOC ## POST /webhooks ### Description Creates a new webhook with the specified name, URL, and event types. ### Request Body - **Name** (string) - Required - The name of the webhook. - **Url** (string) - Required - The endpoint URL for the webhook. - **EventTypes** (array) - Required - List of events to subscribe to. - **Testmode** (boolean) - Optional - Whether to use test mode. ``` -------------------------------- ### Get a payment link Source: https://github.com/viincenttt/mollieapi/wiki/14.-Payment-link-Api Retrieves details of an existing payment link by its unique identifier. ```C# using IPaymentLinkClient client = new PaymentLinkClient({yourApiKey}); PaymentLinkResponse result = await this._paymentLinkClient.GetPaymentLinkAsync({yourPaymentLinkId}); ``` -------------------------------- ### Retrieve All Payment Methods Source: https://github.com/viincenttt/mollieapi/wiki/03.-Payment-method-API Fetches a list of all available payment methods. Supports pagination with optional offset and count parameters. ```csharp using IPaymentMethodClient _paymentMethodClient = new PaymentMethodClient("{yourApiKey}"); ListResponse paymentMethodList = await this._paymentMethodClient.GetPaymentMethodListAsync(); foreach (PaymentMethodResponse paymentMethod in paymentMethodList.Items) { // Your code here } ``` -------------------------------- ### List All Balances Source: https://github.com/viincenttt/mollieapi/wiki/15.-Balances-Api Retrieve a list of all balances associated with your organization, ordered by creation date. Requires your API key. ```C# using IBalanceClient client = new BalanceClient({yourApiKey}); ListResponse balanceList = await this._balanceClient.GetBalanceListAsync(); ``` -------------------------------- ### Use Open Iconic with Foundation Source: https://github.com/viincenttt/mollieapi/blob/development/samples/Mollie.WebApplication.Blazor/wwwroot/css/open-iconic/README.md Apply Open Iconic icons in Foundation projects using the 'fi-icon-name' class. ```html ``` -------------------------------- ### Create a new customer Source: https://github.com/viincenttt/mollieapi/wiki/05.-Customer-API Initializes a new customer record in the Mollie Dashboard. Requires a valid API key and customer details. ```c# CustomerRequest customerRequest = new CustomerRequest() { Email = "{email}", Name = "{name}", Locale = Locale.nl_NL }; using ICustomerClient customerClient = new CustomerClient("{yourApiKey}"); CustomerResponse customerResponse = await customerClient.CreateCustomerAsync(customerRequest); ``` -------------------------------- ### Get Capture Source: https://github.com/viincenttt/mollieapi/wiki/12.-Captures-API Retrieves the details of a specific capture using its ID and the associated payment ID. ```APIDOC ## GET /payments/{paymentId}/captures/{captureId} ### Description Retrieves the details of a specific capture by providing both the payment ID and the capture ID. ### Method GET ### Endpoint /payments/{paymentId}/captures/{captureId} ### Parameters #### Path Parameters - **paymentId** (string) - Required - The ID of the payment. - **captureId** (string) - Required - The ID of the capture to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the capture. - **amount** (object) - The amount that was captured. - **currency** (string) - The ISO currency code. - **value** (string) - The captured amount value. - **description** (string) - The description provided for the capture. - **paymentId** (string) - The ID of the payment this capture belongs to. - **status** (string) - The status of the capture (e.g., `pending`, `completed`). - **createdAt** (string) - The date and time the capture was created. #### Response Example ```json { "id": "cap_abc123", "amount": { "currency": "EUR", "value": "10.00" }, "description": "capture", "paymentId": "pay_xyz789", "status": "completed", "createdAt": "2023-10-27T10:00:00+00:00" } ``` ``` -------------------------------- ### Get Current Organization Source: https://github.com/viincenttt/mollieapi/wiki/09.-Organization-API Retrieve the currently authenticated organization. Ensure you have your API key ready. ```C# using IOrganizationClient client = new OrganizationClient("{yourApiKey}"); OrganizationResponse result = await client.GetCurrentOrganizationAsync(); ``` -------------------------------- ### Specify Multiple Payment Methods Source: https://github.com/viincenttt/mollieapi/wiki/02.-Payment-API When creating a payment, you can provide a list of preferred payment methods. Mollie will then only display the specified methods to the customer. ```csharp PaymentRequest paymentRequest = new PaymentRequest() { Amount = new Amount(Currency.EUR, 100.00m), Description = "Description", RedirectUrl = "http://www.mollie.com", Methods = new List() { PaymentMethod.Ideal, PaymentMethod.CreditCard, PaymentMethod.DirectDebit } }; ``` -------------------------------- ### Get a balance transfer by id Source: https://github.com/viincenttt/mollieapi/wiki/21.-Balance-Transfer-API Retrieves the details of a specific balance transfer using its unique identifier. ```APIDOC ## GET /balance/transfers/{balanceTransferId} ### Description Retrieves a specific balance transfer by its ID. ### Method GET ### Endpoint /balance/transfers/{balanceTransferId} ### Parameters #### Path Parameters - **balanceTransferId** (string) - Required - The unique identifier of the balance transfer to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the balance transfer. - **description** (string) - The description of the balance transfer. - **amount** (object) - The amount that was transferred. - **currency** (string) - The ISO currency code. - **value** (integer) - The amount in the smallest currency unit. - **source** (object) - Details about the source of the transfer. - **id** (string) - The ID of the source. - **type** (string) - The type of the source. - **description** (string) - The description of the source. - **destination** (object) - Details about the destination of the transfer. - **id** (string) - The ID of the destination. - **type** (string) - The type of the destination. - **description** (string) - The description of the destination. - **createdAt** (string) - The date and time the balance transfer was created. - **status** (string) - The current status of the balance transfer (e.g., 'pending', 'completed', 'failed'). #### Response Example ```json { "id": "bt_1234567890abcdef", "description": "Test Description", "amount": { "currency": "EUR", "value": 50 }, "source": { "id": "org_abcdef1234567890", "type": "organization", "description": "Test Source" }, "destination": { "id": "org_fedcba0987654321", "type": "organization", "description": "Test Destination" }, "createdAt": "2023-10-27T10:00:00Z", "status": "pending" } ``` ``` -------------------------------- ### Create a new mandate Source: https://github.com/viincenttt/mollieapi/wiki/06.-Mandate-API Initializes a mandate for a specific customer using a mandate request object. ```c# using IMandateClient mandateclient = new MandateClient("{yourApiKey}"); MandateRequest mandateRequest = new SepaDirectDebitMandateRequest() { // Or PayPalMandateRequest ConsumerName = "John Smit", MandateReference = "My reference", SignatureDate = DateTime.Now }; MandateResponse mandateResponse = await this._mandateClient.CreateMandateAsync("{customerId}", mandateRequest); ``` -------------------------------- ### GET /v2/webhook-events/{id} Source: https://github.com/viincenttt/mollieapi/wiki/20.-Webhook-Api Retrieves a specific webhook event by its ID. Supports both generic and strongly-typed responses. ```APIDOC ## GET /v2/webhook-events/{id} ### Description Retrieves a webhook event published by the next-gen webhooks system. The client supports retrieving the event with a specific entity type (generic) or as a base entity. ### Method GET ### Endpoint /v2/webhook-events/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the webhook event. ### Request Example // No request body required for GET requests. ### Response #### Success Response (200) - **Entity** (object) - The embedded entity associated with the webhook event. #### Response Example { "id": "event_GvJ8WHrp5isUdRub9CJyH", "entity": { ... } } ``` -------------------------------- ### Include Open Iconic with Foundation Source: https://github.com/viincenttt/mollieapi/blob/development/samples/Mollie.WebApplication.Blazor/wwwroot/css/open-iconic/README.md Link the Foundation-specific stylesheet to integrate Open Iconic with Foundation projects. ```html ``` -------------------------------- ### Get Current Profile API Source: https://github.com/viincenttt/mollieapi/wiki/11.-Profile-Api Confirms the website profile that will be used, useful for plugins or SaaS applications. ```APIDOC ## GET /profiles/me ### Description Retrieves details of the currently authenticated website profile. Useful for confirming the profile associated with an API key. ### Method GET ### Endpoint /profiles/me ### Response #### Success Response (200) - **ProfileResponse** (object) - Details of the current profile. #### Response Example ```json { "id": "pfl_xxxxxxxxxx", "name": "Example Company", "website": "https://example.com", "mode": "test", "createdAt": "2023-10-27T10:00:00+00:00" } ``` ``` -------------------------------- ### Build Query Parameters with Extension Helpers Source: https://github.com/viincenttt/mollieapi/blob/development/AGENTS.md Use these extension methods from Mollie.Api.Extensions to conditionally add query parameters to requests. ```csharp result.AddValueIfNotNullOrEmpty("include", someValue); result.AddValueIfTrue("testmode", testmode); includeList.AddValueIfTrue("details.qrCode", includeQrCode); return includeList.ToIncludeParameter(); ```