const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
const listMandates = async () => {
return await mangopay.Mandates.getAll()
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
listMandates()
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 listMandates()
begin
response = MangoPay::Mandate.fetch()
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch Mandates: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
listMandates()
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.Mandate;
import java.util.List;
public class ListMandates {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
List<Mandate> mandates = mangopay.getMandateApi().getAll(null, null, null);
for (Mandate mandate : mandates) {
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
mandates = Mandate.all()
for mandate in mandates:
pprint(vars(mandate))
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 viewMandate = await api.Mandates.GetAllAsync(new Pagination(1, 100));
string prettyPrint = JsonConvert.SerializeObject(viewMandate, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
[
{
"Id": "mdt_m_01J98YZT8AJBGWX47AA077XMKZ",
"CreationDate": 1663244376,
"Status": "FAILED",
"UserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"ExecutionType": "WEB",
"MandateType": "DIRECT_DEBIT",
"Tag": "Created using the Mangopay API Postman collection",
"ResultCode": "001807",
"ResultMessage": "User has let the mandate session expire without confirming"
},
{
"Id": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"CreationDate": 1669040333,
"Status": "ACTIVE",
"UserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"ExecutionType": "WEB",
"MandateType": "DIRECT_DEBIT",
"Tag": "Created using the Mangopay API Postman collection",
"ResultCode": "000000",
"ResultMessage": "Success"
}
]
Direct debits
List all Mandates
GET
/
v2.01
/
{ClientId}
/
mandates
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
const listMandates = async () => {
return await mangopay.Mandates.getAll()
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
listMandates()
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 listMandates()
begin
response = MangoPay::Mandate.fetch()
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch Mandates: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
listMandates()
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.Mandate;
import java.util.List;
public class ListMandates {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
List<Mandate> mandates = mangopay.getMandateApi().getAll(null, null, null);
for (Mandate mandate : mandates) {
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
mandates = Mandate.all()
for mandate in mandates:
pprint(vars(mandate))
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 viewMandate = await api.Mandates.GetAllAsync(new Pagination(1, 100));
string prettyPrint = JsonConvert.SerializeObject(viewMandate, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
[
{
"Id": "mdt_m_01J98YZT8AJBGWX47AA077XMKZ",
"CreationDate": 1663244376,
"Status": "FAILED",
"UserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"ExecutionType": "WEB",
"MandateType": "DIRECT_DEBIT",
"Tag": "Created using the Mangopay API Postman collection",
"ResultCode": "001807",
"ResultMessage": "User has let the mandate session expire without confirming"
},
{
"Id": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"CreationDate": 1669040333,
"Status": "ACTIVE",
"UserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"ExecutionType": "WEB",
"MandateType": "DIRECT_DEBIT",
"Tag": "Created using the Mangopay API Postman collection",
"ResultCode": "000000",
"ResultMessage": "Success"
}
]
Query parameters
Unix timestamp
The date before which the object was created (based on the object’s
CreationDate parameter). You can filter on a specific time range by using both the AfterDate and BeforeDate query parameters.Unix timestamp
The date after which the object was created (based on the object’s
CreationDate parameter). You can filter on a specific time range by using both the AfterDate and BeforeDate query parameters.Path parameters
string
required
The unique identifier of the mandate.
Responses
200
200
array
The list of mandates created by the platform.
Show properties
Show properties
object
The mandate created by the platform.
Show properties
Show properties
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 (natural or legal) who owns the bank account.
string
Returned values:
WEBThe execution 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.
[
{
"Id": "mdt_m_01J98YZT8AJBGWX47AA077XMKZ",
"CreationDate": 1663244376,
"Status": "FAILED",
"UserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"ExecutionType": "WEB",
"MandateType": "DIRECT_DEBIT",
"Tag": "Created using the Mangopay API Postman collection",
"ResultCode": "001807",
"ResultMessage": "User has let the mandate session expire without confirming"
},
{
"Id": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"CreationDate": 1669040333,
"Status": "ACTIVE",
"UserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"ExecutionType": "WEB",
"MandateType": "DIRECT_DEBIT",
"Tag": "Created using the Mangopay API Postman collection",
"ResultCode": "000000",
"ResultMessage": "Success"
}
]
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
const listMandates = async () => {
return await mangopay.Mandates.getAll()
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
listMandates()
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 listMandates()
begin
response = MangoPay::Mandate.fetch()
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch Mandates: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
listMandates()
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.Mandate;
import java.util.List;
public class ListMandates {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
List<Mandate> mandates = mangopay.getMandateApi().getAll(null, null, null);
for (Mandate mandate : mandates) {
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
mandates = Mandate.all()
for mandate in mandates:
pprint(vars(mandate))
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 viewMandate = await api.Mandates.GetAllAsync(new Pagination(1, 100));
string prettyPrint = JsonConvert.SerializeObject(viewMandate, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
Was this page helpful?
⌘I