<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$mandateId = '194612261';
$response = $api->Mandates->Get($mandateId);
print_r($response);
} catch(MGPResponseException $e) {
print_r($e);
} catch(MGPException $e) {
print_r($e);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
let myMandate = {
Id: '169718609',
}
const getMandate = async (mandateId) => {
return await mangopay.Mandates.get(mandateId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
getMandate(myMandate.Id)
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def viewMandate(mandateId)
begin
response = MangoPay::Mandate.fetch(mandateId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch mandate: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myMandate = {
Id:'194337135'
}
viewMandate(myMandate[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.Mandate;
public class ViewMandate {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
Mandate mandate = mangopay.getMandateApi().get("mdt_m_01HW2Z09A391QW5EPWTSEKDWTR");
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(mandate);
System.out.println(prettyJson);
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import Mandate
mandate_id = '214058486'
try:
view_mandate = Mandate.get(mandate_id)
pprint(vars(view_mandate))
except Mandate.DoesNotExist:
print('The Mandate {} does not exist.'.format(view_mandate.id))
using MangoPay.SDK;
using MangoPay.SDK.Entities.PUT;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var mandateId = "mdt_m_01J3D1C35QZHHAT7XJ4WXTHRTJ";
var viewMandate = await api.Mandates.GetAsync(mandateId);
string prettyPrint = JsonConvert.SerializeObject(viewMandate, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Scheme": "SEPA",
"BankAccountId": "bankacc_m_01J999AWHFHW2PQ1ADNQ46AYE9",
"BankReference": "QYDZMNP",
"Culture": "EN",
"DocumentURL": "https://api.sandbox.mangopay.com/webhook/eu/public/mandates/e8a73d/dfbdce2a12a442bfae973e56777b3ddb/document?version=2.01",
"ReturnURL": "http://example.com?MandateId=mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"RedirectURL": "https://api.sandbox.mangopay.com/mvc/eu/public/mandates/e8a73d/dfbdce2a12a442bfae973e56777b3ddb/confirmation?version=2.01",
"Id": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"CreationDate": 1727962392,
"Status": "SUBMITTED",
"UserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"ExecutionType": "WEB",
"MandateType": "DIRECT_DEBIT",
"Tag": "Created using the Mangopay API Postman collection",
"ResultCode": null,
"ResultMessage": null
}
Direct debits
View a Mandate
GET
/
v2.01
/
{ClientId}
/
mandates
/
{MandateId}
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$mandateId = '194612261';
$response = $api->Mandates->Get($mandateId);
print_r($response);
} catch(MGPResponseException $e) {
print_r($e);
} catch(MGPException $e) {
print_r($e);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
let myMandate = {
Id: '169718609',
}
const getMandate = async (mandateId) => {
return await mangopay.Mandates.get(mandateId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
getMandate(myMandate.Id)
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def viewMandate(mandateId)
begin
response = MangoPay::Mandate.fetch(mandateId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch mandate: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myMandate = {
Id:'194337135'
}
viewMandate(myMandate[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.Mandate;
public class ViewMandate {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
Mandate mandate = mangopay.getMandateApi().get("mdt_m_01HW2Z09A391QW5EPWTSEKDWTR");
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(mandate);
System.out.println(prettyJson);
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import Mandate
mandate_id = '214058486'
try:
view_mandate = Mandate.get(mandate_id)
pprint(vars(view_mandate))
except Mandate.DoesNotExist:
print('The Mandate {} does not exist.'.format(view_mandate.id))
using MangoPay.SDK;
using MangoPay.SDK.Entities.PUT;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var mandateId = "mdt_m_01J3D1C35QZHHAT7XJ4WXTHRTJ";
var viewMandate = await api.Mandates.GetAsync(mandateId);
string prettyPrint = JsonConvert.SerializeObject(viewMandate, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Scheme": "SEPA",
"BankAccountId": "bankacc_m_01J999AWHFHW2PQ1ADNQ46AYE9",
"BankReference": "QYDZMNP",
"Culture": "EN",
"DocumentURL": "https://api.sandbox.mangopay.com/webhook/eu/public/mandates/e8a73d/dfbdce2a12a442bfae973e56777b3ddb/document?version=2.01",
"ReturnURL": "http://example.com?MandateId=mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"RedirectURL": "https://api.sandbox.mangopay.com/mvc/eu/public/mandates/e8a73d/dfbdce2a12a442bfae973e56777b3ddb/confirmation?version=2.01",
"Id": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"CreationDate": 1727962392,
"Status": "SUBMITTED",
"UserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"ExecutionType": "WEB",
"MandateType": "DIRECT_DEBIT",
"Tag": "Created using the Mangopay API Postman collection",
"ResultCode": null,
"ResultMessage": null
}
Path parameters
string
required
The unique identifier of the mandate.
Responses
200
200
string
The scheme of the mandate, which is available once the mandate is submitted. The value can be one of the following:
- BACS – Covers payments in the UK, in GBP only.
- SEPA – Covers payments in the EU.
string
The unique identifier of the bank account.Warning: The Bank Account
Type must be IBAN for the SEPA scheme and GB for the Bacs scheme.string
The banking reference for the Mandate.
string
Returned values: One of the supported languages in the ISO 639-1 format: DE, EN, ES, FR, IT, NL, PLThe language in which the mandate confirmation page is to be displayed. This value only applies to mandates with the SEPA
Scheme.string
The URL at which the mandate document can be downloaded.
string
Max. length: 220 charactersThe URL to which the user is returned after the payment, whether the transaction is successful or not.
string
The URL to which to redirect the user to complete the payment.Caution: This variable URL is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it.
string
Max length: 128 characters (see data formats for details)The unique identifier of the object.
Unix timestamp
The date and time at which the object was created.
string
Returned values:
CREATED, SUBMITTED, ACTIVE, FAILED, EXPIREDThe status of the mandate:CREATED– The mandate has been generated but not yet confirmed.SUBMITTED– The mandate has been confirmed and sent to the user’s bank, and can be used to request a direct debit pay-in.ACTIVE– The mandate has been accepted by the user’s bank or successfully used to process a direct debit direct pay-in. Further pay-ins can be requested.FAILED– The mandate has been canceled or otherwise failed, and can no longer be used for payments.EXPIRED– No payment has been made against the mandate in the last 24 months. It can no longer be used for payments.
string
The unique identifier of the user.
string
Returned values:
WEBThe execution type of the mandate.string
The type of the mandate.
string
Max. length: 255 charactersCustom data that you can add to this object.
string
The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes.
string
The explanation of the result code.
{
"Scheme": "SEPA",
"BankAccountId": "bankacc_m_01J999AWHFHW2PQ1ADNQ46AYE9",
"BankReference": "QYDZMNP",
"Culture": "EN",
"DocumentURL": "https://api.sandbox.mangopay.com/webhook/eu/public/mandates/e8a73d/dfbdce2a12a442bfae973e56777b3ddb/document?version=2.01",
"ReturnURL": "http://example.com?MandateId=mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"RedirectURL": "https://api.sandbox.mangopay.com/mvc/eu/public/mandates/e8a73d/dfbdce2a12a442bfae973e56777b3ddb/confirmation?version=2.01",
"Id": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"CreationDate": 1727962392,
"Status": "SUBMITTED",
"UserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"ExecutionType": "WEB",
"MandateType": "DIRECT_DEBIT",
"Tag": "Created using the Mangopay API Postman collection",
"ResultCode": null,
"ResultMessage": null
}
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$mandateId = '194612261';
$response = $api->Mandates->Get($mandateId);
print_r($response);
} catch(MGPResponseException $e) {
print_r($e);
} catch(MGPException $e) {
print_r($e);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
let myMandate = {
Id: '169718609',
}
const getMandate = async (mandateId) => {
return await mangopay.Mandates.get(mandateId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
getMandate(myMandate.Id)
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def viewMandate(mandateId)
begin
response = MangoPay::Mandate.fetch(mandateId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch mandate: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myMandate = {
Id:'194337135'
}
viewMandate(myMandate[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.Mandate;
public class ViewMandate {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
Mandate mandate = mangopay.getMandateApi().get("mdt_m_01HW2Z09A391QW5EPWTSEKDWTR");
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(mandate);
System.out.println(prettyJson);
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import Mandate
mandate_id = '214058486'
try:
view_mandate = Mandate.get(mandate_id)
pprint(vars(view_mandate))
except Mandate.DoesNotExist:
print('The Mandate {} does not exist.'.format(view_mandate.id))
using MangoPay.SDK;
using MangoPay.SDK.Entities.PUT;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var mandateId = "mdt_m_01J3D1C35QZHHAT7XJ4WXTHRTJ";
var viewMandate = await api.Mandates.GetAsync(mandateId);
string prettyPrint = JsonConvert.SerializeObject(viewMandate, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
Was this page helpful?