Get mandate¶
GET
https://api.mollie.com/v2/customers/*customerId*/mandates/*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.
Note
Trying to retrieve a revoked mandate will result in a 410 exception.
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_8wmqcHMN4U/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
query string parameter.
true
to retrieve a test mode mandate.Response¶
200
application/json
resource
stringmandate
for this endpoint.id
stringmdt_pWUnw6pkBN
.mode
stringstatus
stringThe status of the mandate. A status can be pending
for mandates when the first payment is not yet finalized or
when we did not received the IBAN yet.
Possible values: valid
pending
invalid
method
stringPayment method of the mandate.
Possible values: directdebit
creditcard
paypal
details
objectmandateReference
stringsignatureDate
stringYYYY-MM-DD
format.createdAt
datetime_links
objectAn object with several URL objects relevant to the mandate. Every URL object will contain an href
and a type
field.
self
URL objectcustomer
URL objectdocumentation
URL objectPayment method-specific details¶
The mandate detail object contains different fields per payment method.
Direct Debit¶
consumerName
stringconsumerAccount
stringconsumerBic
stringCredit Card¶
cardHolder
stringcardNumber
stringcardLabel
stringThe credit card’s label. Note that not all labels can be processed through Mollie.
Possible values: American Express
Carta Si
Carte Bleue
Dankort
Diners Club
Discover
JCB
Laser
Maestro
Mastercard
Unionpay
Visa
null
cardFingerprint
stringcardExpiryDate
dateYYYY-MM-DD
format.PayPal¶
consumerName
stringconsumerAccount
stringExample¶
1 2 | curl -X GET https://api.mollie.com/v2/customers/cst_4qqhO89gsT/mandates/mdt_h3gAaD5zP \ -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" |
1 2 3 4 5 | <?php $mollie = new \Mollie\Api\MollieApiClient(); $mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM"); $customer = $mollie->customers->get("cst_4qqhO89gsT"); $mandate = $customer->getMandate("mdt_h3gAaD5zP"); |
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") mandate = customer.mandates.get("mdt_h3gAaD5zP") |
1 2 3 4 5 6 7 | require 'mollie-api-ruby' Mollie::Client.configure do |config| config.api_key = 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' end mandate = Mollie::Customer::Mandate.get('mdt_h3gAaD5zP', customer_id: 'cst_4qqhO89gsT') |
1 2 3 4 5 6 | const { createMollieClient } = require('@mollie/api-client'); const mollieClient = createMollieClient({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' }); const mandate = await mollieClient.customerMandates.get('mdt_h3gAaD5zP', { customerId: 'cst_4qqhO89gsT' }); |
Response¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | HTTP/1.1 200 OK Content-Type: application/json { "resource": "mandate", "id": "mdt_h3gAaD5zP", "mode": "test", "status": "valid", "method": "directdebit", "details": { "consumerName": "John Doe", "consumerAccount": "NL55INGB0000000000", "consumerBic": "INGBNL2A" }, "mandateReference": "YOUR-COMPANY-MD1380", "signatureDate": "2018-05-07", "createdAt": "2018-05-07T10:49:08+00:00", "_links": { "self": { "href": "https://api.mollie.com/v2/customers/cst_4qqhO89gsT/mandates/mdt_h3gAaD5zP", "type": "application/hal+json" }, "customer": { "href": "https://api.mollie.com/v2/customers/cst_4qqhO89gsT", "type": "application/hal+json" }, "documentation": { "href": "https://docs.mollie.com/reference/v2/mandates-api/get-mandate", "type": "text/html" } } } |