Revoke mandate¶
Mandates API v2
DELETE
https://api.mollie.com/v2/customers/*customerId*/mandates/*id*
Authentication:API keysOrganization access tokensApp access tokens
Revoke a customer’s mandate. You will no longer be able to charge the consumer’s bank account or credit card with this mandate and all connected subscriptions will be canceled.
Parameters¶
Replace customerId
in the endpoint URL by the customer’s ID, and replace id
by the mandate’s ID. For example:
/v2/customers/cst_stTC2WHAuS/mandates/mdt_pWUnw6pkBN
.
Access token parameters¶
If you are using organization access tokens or are creating an
OAuth app, you can enable test mode through the testmode
parameter.
Set this to
true
to revoke a test mode mandate.Response¶
204 No Content
Example¶
cURLPHPPythonRubyNode.js
1 2 | curl -X DELETE https://api.mollie.com/v2/customers/cst_stTC2WHAuS/mandates/mdt_pWUnw6pkBN \ -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" |
1 2 3 4 5 6 | <?php $mollie = new \Mollie\Api\MollieApiClient(); $mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM"); $customer = $mollie->customers->get("cst_stTC2WHAuS"); $mandate = $customer->getMandate("mdt_pWUnw6pkBN"); $mandate->revoke(); |
1 2 3 4 5 6 7 | from mollie.api.client import Client mollie_client = Client() mollie_client.set_api_key("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM") customer = mollie_client.customers.get("cst_4qqhO89gsT") customer.mandates.delete("mdt_h3gAaD5zP") |
1 2 3 4 5 6 7 | require 'mollie-api-ruby' Mollie::Client.configure do |config| config.api_key = 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' end Mollie::Customer::Mandate.delete('mdt_pWUnw6pkBN', customer_id: 'cst_stTC2WHAuS') |
1 2 3 4 5 6 | const { createMollieClient } = require('@mollie/api-client'); const mollieClient = createMollieClient({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' }); await mollieClient.customerMandates.revoke('mdt_pWUnw6pkBN', { customerId: 'cst_stTC2WHAuS' }); |
Response¶
1 | HTTP/1.1 204 No Content |