Skip to content

06. Mandate API

Vincent Kok edited this page Dec 4, 2023 · 1 revision

Mandates allow you to charge a customer’s credit card or bank account recurrently.

Creating a new mandate

Create a mandate for a specific customer.

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);

Retrieve a mandate by id

Retrieve a mandate by its ID and its customer’s ID. The mandate will either contain IBAN or credit card details, depending on the type of mandate.

using IMandateClient mandateclient = new MandateClient("{yourApiKey}");
MandateResponse mandateResponse = await mandateclient.GetMandateAsync("{customerId}", "{mandateId}");

Retrieve mandate list

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.

using IMandateClient mandateclient = new MandateClient("{yourApiKey}");
ListResponse<MandateResponse> response = await mandateclient.GetMandateListAsync("{customerId}");

Revoking a mandate

Revoke a customer’s mandate. You will no longer be able to charge the consumer’s bank account or credit card with this mandate.

using IMandateClient mandateclient = new MandateClient("{yourApiKey}");
await mandateclient.RevokeMandate("{customerId}", "{mandateId}");