{
"AuthorId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"CreditedWalletId": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"DebitedFunds": {
"Currency": "EUR",
"Amount": 1200
},
"Fees": {
"Currency": "EUR",
"Amount": 12
},
"Tag": "Created using the Mangopay API Postman collection",
"MandateId": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"StatementDescriptor": "Example123"
}
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;
use MangoPay\Money;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$userId = 'user_m_01HYDWQNXC3M655SJXVGNDP91J';
$walletId = 'wlt_m_01HYDWR4NMAF0GRM2GZ25479EG';
$mandateId = 'mdt_m_01HYDWRQNDFC7R7P37DWH8C9SP';
$directDirectDebitPayIn = new \MangoPay\PayIn();
$directDirectDebitPayIn->AuthorId = $userId;
$directDirectDebitPayIn->CreditedWalletId = $walletId;
$directDirectDebitPayIn->DebitedFunds = new Money();
$directDirectDebitPayIn->DebitedFunds->Amount = 1000;
$directDirectDebitPayIn->DebitedFunds->Currency = 'EUR';
$directDirectDebitPayIn->Fees = new Money();
$directDirectDebitPayIn->Fees->Amount = 0;
$directDirectDebitPayIn->Fees->Currency = 'EUR';
$directDirectDebitPayIn->PaymentDetails = new \MangoPay\PayInPaymentDetailsDirectDebit();
$directDirectDebitPayIn->PaymentDetails->MandateId = $mandateId;
$directDirectDebitPayIn->ExecutionDetails = new \MangoPay\PayInExecutionDetailsDirect();
$directDirectDebitPayIn->Tag = 'Created using the Mangopay PHP SDK';
$createPayIn = $api->PayIns->Create($directDirectDebitPayIn);
print_r($createPayIn);
} 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 myPayIn = {
PaymentType: 'DIRECT_DEBIT',
ExecutionType: 'DIRECT',
AuthorId: '168935886',
Tag: 'Created with Mangopay Node.js SDK',
CreditedUserId: '168935886',
DebitedFunds: {
Currency: 'EUR',
Amount: 1000,
},
Fees: {
Currency: 'EUR',
Amount: 100,
},
CreditedWalletId: '168935920',
MandateId: '193168736',
StatementDescriptor: 'Mangopay',
}
const createDirectDirectDebitPayIn = async (payin) => {
return await mangopay.PayIns.create(payin)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createDirectDirectDebitPayIn(myPayIn)
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 createDirectDirectDebitPayIn(payInObject)
begin
response = MangoPay::PayIn::DirectDebit::Direct.create(payInObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create pay-in: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myPayIn = {
AuthorId:'195074410',
Tag: 'Created with Mangopay Ruby SDK',
CreditedUserId:'195074410',
DebitedFunds: {
Currency: 'EUR',
Amount: 1000,
},
Fees: {
Currency: 'EUR',
Amount: 100,
},
CreditedWalletId: '195074411',
MandateId: '195074413',
StatementDescriptor: 'Mangopay',
}
createDirectDirectDebitPayIn(myPayIn)
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.Money;
import com.mangopay.core.enumerations.CurrencyIso;
import com.mangopay.entities.PayIn;
import com.mangopay.entities.subentities.PayInExecutionDetailsDirect;
import com.mangopay.entities.subentities.PayInPaymentDetailsDirectDebit;
public class CreateDirectDirectDebitPayIn {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var userId = "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT";
var walletId = "wlt_m_01HTF5S9MG0XXBZ8A0550MED3Z";
var mandateId = "mdt_m_01HW30HV697QX2SQN7E500FQBJ";
PayIn payIn = new PayIn();
Money debitedFunds = new Money();
debitedFunds.setAmount(1000);
debitedFunds.setCurrency(CurrencyIso.EUR);
Money fees = new Money();
fees.setAmount(0);
fees.setCurrency(CurrencyIso.EUR);
PayInPaymentDetailsDirectDebit paymentDetails = new PayInPaymentDetailsDirectDebit();
paymentDetails.setMandateId(mandateId);
paymentDetails.setStatementDescriptor("Apr2024");
PayInExecutionDetailsDirect executionDetails = new PayInExecutionDetailsDirect();
payIn.setAuthorId(userId);
payIn.setCreditedWalletId(walletId);
payIn.setDebitedFunds(debitedFunds);
payIn.setFees(fees);
payIn.setPaymentDetails(paymentDetails);
payIn.setExecutionDetails(executionDetails);
PayIn createPayIn = mangopay.getPayInApi().create(payIn);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(createPayIn);
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 NaturalUser, DirectDebitDirectPayIn, Money
natural_user = NaturalUser.get('213753890')
direct_debit_direct_payin = DirectDebitDirectPayIn(
author_id = natural_user.id,
credited_wallet_id = '213754077',
debited_funds = Money(amount='1000', currency='EUR'),
fees = Money(amount='100', currency='EUR'),
tag = 'Created using the Mangopay Python SDK',
mandate_id = '214224837',
statement_descriptor = 'Jan2024'
)
create_direct_debit_direct_payin = direct_debit_direct_payin.save()
pprint(create_direct_debit_direct_payin)
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 userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN";
var walletId = "wlt_m_01J30991BXBB7VF28PBS82EWD3";
var returnUrl = "https://www.mangopay.com/docs/please-ignore/";
var mandateId = "mdt_m_01J3D1C35QZHHAT7XJ4WXTHRTJ";
var payIn = new PayInMandateDirectPostDTO(
userId,
new Money { Amount = 100, Currency = CurrencyIso.EUR },
new Money { Amount = 0, Currency = CurrencyIso.EUR },
walletId, returnUrl, mandateId);
var createDirectDirectDebitPayIn = await api.PayIns.CreateMandateDirectDebitAsync(payIn);
string prettyPrint = JsonConvert.SerializeObject(createDirectDirectDebitPayIn, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Id": "payin_m_01J9C36G3DYBNZEHVZ5HC7WB5D",
"CreationDate": 1728056606,
"AuthorId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"CreditedUserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"Status":"CREATED",
"ExecutionDate": null,
"ChargeDate": null,
"Type": "PAYIN",
"Nature": "REGULAR",
"CreditedWalletId": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"DebitedWalletId": null,
"CreditedFunds": {
"Currency": "EUR",
"Amount": 1188
},
"DebitedFunds": {
"Currency": "EUR",
"Amount": 1200
},
"Fees": {
"Currency": "EUR",
"Amount": 12
},
"ResultCode": null,
"ResultMessage": null,
"PaymentType": "DIRECT_DEBIT",
"ExecutionType": "DIRECT",
"Tag": "Created using Mangopay API Postman Collection",
"MandateId": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"StatementDescriptor": "Example123"
}
{
"Id": "payin_m_01J9C36G3DYBNZEHVZ5HC7WB5D",
"CreationDate": 1728056606,
"AuthorId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"CreditedUserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"Status":"FAILED",
"ExecutionDate": null,
"ChargeDate": null,
"Type": "PAYIN",
"Nature": "REGULAR",
"CreditedWalletId": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"DebitedWalletId": null,
"CreditedFunds": {
"Currency": "EUR",
"Amount": 1188
},
"DebitedFunds": {
"Currency": "EUR",
"Amount": 1200
},
"Fees": {
"Currency": "EUR",
"Amount": 12
},
"ResultCode":"001833",
"ResultMessage":"The Status of this Mandate does not allow for payments",
"PaymentType": "DIRECT_DEBIT",
"ExecutionType": "DIRECT",
"Tag": "Created using Mangopay API Postman Collection",
"MandateId": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"StatementDescriptor": "Example123"
}
Direct debits
Create a Direct Debit PayIn
POST
/
v2.01
/
{ClientId}
/
payins
/
directdebit
/
direct
{
"AuthorId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"CreditedWalletId": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"DebitedFunds": {
"Currency": "EUR",
"Amount": 1200
},
"Fees": {
"Currency": "EUR",
"Amount": 12
},
"Tag": "Created using the Mangopay API Postman collection",
"MandateId": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"StatementDescriptor": "Example123"
}
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;
use MangoPay\Money;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$userId = 'user_m_01HYDWQNXC3M655SJXVGNDP91J';
$walletId = 'wlt_m_01HYDWR4NMAF0GRM2GZ25479EG';
$mandateId = 'mdt_m_01HYDWRQNDFC7R7P37DWH8C9SP';
$directDirectDebitPayIn = new \MangoPay\PayIn();
$directDirectDebitPayIn->AuthorId = $userId;
$directDirectDebitPayIn->CreditedWalletId = $walletId;
$directDirectDebitPayIn->DebitedFunds = new Money();
$directDirectDebitPayIn->DebitedFunds->Amount = 1000;
$directDirectDebitPayIn->DebitedFunds->Currency = 'EUR';
$directDirectDebitPayIn->Fees = new Money();
$directDirectDebitPayIn->Fees->Amount = 0;
$directDirectDebitPayIn->Fees->Currency = 'EUR';
$directDirectDebitPayIn->PaymentDetails = new \MangoPay\PayInPaymentDetailsDirectDebit();
$directDirectDebitPayIn->PaymentDetails->MandateId = $mandateId;
$directDirectDebitPayIn->ExecutionDetails = new \MangoPay\PayInExecutionDetailsDirect();
$directDirectDebitPayIn->Tag = 'Created using the Mangopay PHP SDK';
$createPayIn = $api->PayIns->Create($directDirectDebitPayIn);
print_r($createPayIn);
} 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 myPayIn = {
PaymentType: 'DIRECT_DEBIT',
ExecutionType: 'DIRECT',
AuthorId: '168935886',
Tag: 'Created with Mangopay Node.js SDK',
CreditedUserId: '168935886',
DebitedFunds: {
Currency: 'EUR',
Amount: 1000,
},
Fees: {
Currency: 'EUR',
Amount: 100,
},
CreditedWalletId: '168935920',
MandateId: '193168736',
StatementDescriptor: 'Mangopay',
}
const createDirectDirectDebitPayIn = async (payin) => {
return await mangopay.PayIns.create(payin)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createDirectDirectDebitPayIn(myPayIn)
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 createDirectDirectDebitPayIn(payInObject)
begin
response = MangoPay::PayIn::DirectDebit::Direct.create(payInObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create pay-in: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myPayIn = {
AuthorId:'195074410',
Tag: 'Created with Mangopay Ruby SDK',
CreditedUserId:'195074410',
DebitedFunds: {
Currency: 'EUR',
Amount: 1000,
},
Fees: {
Currency: 'EUR',
Amount: 100,
},
CreditedWalletId: '195074411',
MandateId: '195074413',
StatementDescriptor: 'Mangopay',
}
createDirectDirectDebitPayIn(myPayIn)
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.Money;
import com.mangopay.core.enumerations.CurrencyIso;
import com.mangopay.entities.PayIn;
import com.mangopay.entities.subentities.PayInExecutionDetailsDirect;
import com.mangopay.entities.subentities.PayInPaymentDetailsDirectDebit;
public class CreateDirectDirectDebitPayIn {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var userId = "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT";
var walletId = "wlt_m_01HTF5S9MG0XXBZ8A0550MED3Z";
var mandateId = "mdt_m_01HW30HV697QX2SQN7E500FQBJ";
PayIn payIn = new PayIn();
Money debitedFunds = new Money();
debitedFunds.setAmount(1000);
debitedFunds.setCurrency(CurrencyIso.EUR);
Money fees = new Money();
fees.setAmount(0);
fees.setCurrency(CurrencyIso.EUR);
PayInPaymentDetailsDirectDebit paymentDetails = new PayInPaymentDetailsDirectDebit();
paymentDetails.setMandateId(mandateId);
paymentDetails.setStatementDescriptor("Apr2024");
PayInExecutionDetailsDirect executionDetails = new PayInExecutionDetailsDirect();
payIn.setAuthorId(userId);
payIn.setCreditedWalletId(walletId);
payIn.setDebitedFunds(debitedFunds);
payIn.setFees(fees);
payIn.setPaymentDetails(paymentDetails);
payIn.setExecutionDetails(executionDetails);
PayIn createPayIn = mangopay.getPayInApi().create(payIn);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(createPayIn);
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 NaturalUser, DirectDebitDirectPayIn, Money
natural_user = NaturalUser.get('213753890')
direct_debit_direct_payin = DirectDebitDirectPayIn(
author_id = natural_user.id,
credited_wallet_id = '213754077',
debited_funds = Money(amount='1000', currency='EUR'),
fees = Money(amount='100', currency='EUR'),
tag = 'Created using the Mangopay Python SDK',
mandate_id = '214224837',
statement_descriptor = 'Jan2024'
)
create_direct_debit_direct_payin = direct_debit_direct_payin.save()
pprint(create_direct_debit_direct_payin)
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 userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN";
var walletId = "wlt_m_01J30991BXBB7VF28PBS82EWD3";
var returnUrl = "https://www.mangopay.com/docs/please-ignore/";
var mandateId = "mdt_m_01J3D1C35QZHHAT7XJ4WXTHRTJ";
var payIn = new PayInMandateDirectPostDTO(
userId,
new Money { Amount = 100, Currency = CurrencyIso.EUR },
new Money { Amount = 0, Currency = CurrencyIso.EUR },
walletId, returnUrl, mandateId);
var createDirectDirectDebitPayIn = await api.PayIns.CreateMandateDirectDebitAsync(payIn);
string prettyPrint = JsonConvert.SerializeObject(createDirectDirectDebitPayIn, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Id": "payin_m_01J9C36G3DYBNZEHVZ5HC7WB5D",
"CreationDate": 1728056606,
"AuthorId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"CreditedUserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"Status":"CREATED",
"ExecutionDate": null,
"ChargeDate": null,
"Type": "PAYIN",
"Nature": "REGULAR",
"CreditedWalletId": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"DebitedWalletId": null,
"CreditedFunds": {
"Currency": "EUR",
"Amount": 1188
},
"DebitedFunds": {
"Currency": "EUR",
"Amount": 1200
},
"Fees": {
"Currency": "EUR",
"Amount": 12
},
"ResultCode": null,
"ResultMessage": null,
"PaymentType": "DIRECT_DEBIT",
"ExecutionType": "DIRECT",
"Tag": "Created using Mangopay API Postman Collection",
"MandateId": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"StatementDescriptor": "Example123"
}
{
"Id": "payin_m_01J9C36G3DYBNZEHVZ5HC7WB5D",
"CreationDate": 1728056606,
"AuthorId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"CreditedUserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"Status":"FAILED",
"ExecutionDate": null,
"ChargeDate": null,
"Type": "PAYIN",
"Nature": "REGULAR",
"CreditedWalletId": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"DebitedWalletId": null,
"CreditedFunds": {
"Currency": "EUR",
"Amount": 1188
},
"DebitedFunds": {
"Currency": "EUR",
"Amount": 1200
},
"Fees": {
"Currency": "EUR",
"Amount": 12
},
"ResultCode":"001833",
"ResultMessage":"The Status of this Mandate does not allow for payments",
"PaymentType": "DIRECT_DEBIT",
"ExecutionType": "DIRECT",
"Tag": "Created using Mangopay API Postman Collection",
"MandateId": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"StatementDescriptor": "Example123"
}
Body parameters
string
required
The unique identifier of the user at the source of the transaction.
string
Default value: The unique identifier of the owner of the credited wallet.The unique identifier of the user whose wallet is credited.
string
required
The unique identifier of the credited wallet.
object
required
Information about the debited funds.
Show properties
Show properties
string
required
Allowed values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the debited funds.
integer
required
An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as
1260 whereas JPY 12 would be represented as just 12).object
required
Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet).
Show properties
Show properties
string
required
Allowed values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the fees.
integer
required
An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as
1260 whereas JPY 12 would be represented as just 12).string
Max. length: 255 charactersCustom data that you can add to this object.
For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform.
For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform.
string
required
The unique identifier of the mandate.
string
Max. length: SEPA: 100 characters, BACS: truncated after 10 characters; only alphanumeric and spacesCustom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details.Note: On BACS Direct Debit pay-ins, the length is truncated at 10 alphanumeric characters or spaces, but the technical limit is 100.
string
The unique reference generated for the profiling session, used by the fraud prevention solution to produce recommendations for the transaction using the profiling data.Note: Parameter not returned by the API. Profiling feature available on request – contact Mangopay via the Dashboard for more information.
Responses
200
200
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
The unique identifier of the user at the source of the transaction.
string
Default value: The unique identifier of the owner of the credited wallet.The unique identifier of the user whose wallet is credited.
string
Returned values:
CREATED, SUCCEEDED, FAILEDThe status of the transaction.Unix timestamp
The date and time at which the status changed to
SUCCEEDED, indicating that the transaction occurred. The statuses CREATED and FAILED return an ExecutionDate of null.Unix timestamp
The date used to notify the user of the future charge, set at midnight (00:00) on the given day. The user’s account is usually debited the following day, but it depends on their bank. For more information on direct debit processing times, see the direct debit guide.
string
Returned values:
PAYIN, TRANSFER, CONVERSION, PAYOUTThe type of the transaction.string
Returned values:
REGULAR, REPUDIATION, REFUND, SETTLEMENTThe nature of the transaction, providing more information about the context in which the transaction occurred:REGULAR– Relative to most of the transactions (pay-ins, payouts, and transfers) in a usual workflow.REPUDIATION– Automatic withdrawal of funds from the platform’s repudiation wallet as part of the dispute process (when the user has requested a chargeback).REFUND– Reimbursement of a transaction to the user (pay-in refund), to a wallet (transfer refund), or of a payout (payout refund, only initiated by Mangopay).SETTLEMENT– Transfer made to the repudiation wallet by the platform to settle a lost dispute.
string
The unique identifier of the credited wallet.
string
The unique identifier of the debited wallet.In the case of a pay-in, this value is always
null since there is no debited wallet.object
Information about the credited funds (
CreditedFunds = DebitedFunds - Fees).Show properties
Show properties
string
Returned values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the credited funds.
integer
An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as
1260 whereas JPY 12 would be represented as just 12).object
Information about the debited funds.
Show properties
Show properties
string
Returned values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the debited funds.
integer
An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as
1260 whereas JPY 12 would be represented as just 12).object
Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet).
Show properties
Show properties
string
Returned values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the fees.
integer
An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as
1260 whereas JPY 12 would be represented as just 12).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.
string
Returned values:
CARD, DIRECT_DEBIT, PREAUTHORIZED, BANK_WIREThe type of pay-in.string
Returned values:
WEB, DIRECT, EXTERNAL_INSTRUCTIONThe type of execution for the pay-in.string
Max. length: 255 charactersCustom data that you can add to this object.
string
The unique identifier of the mandate.
string
Max. length: 10 characters; only alphanumeric and spacesCustom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details.
200 - Failed due to invalid mandate status
200 - Failed due to invalid mandate status
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
The unique identifier of the user at the source of the transaction.
string
Default value: The unique identifier of the owner of the credited wallet.The unique identifier of the user whose wallet is credited.
string
Returned values:
CREATED, SUCCEEDED, FAILEDThe status of the transaction.Unix timestamp
The date and time at which the status changed to
SUCCEEDED, indicating that the transaction occurred. The statuses CREATED and FAILED return an ExecutionDate of null.Unix timestamp
The date used to notify the user of the future charge, set at midnight (00:00) on the given day. The user’s account is usually debited the following day, but it depends on their bank. For more information on direct debit processing times, see the direct debit guide.
string
Returned values:
PAYIN, TRANSFER, CONVERSION, PAYOUTThe type of the transaction.string
Returned values:
REGULAR, REPUDIATION, REFUND, SETTLEMENTThe nature of the transaction, providing more information about the context in which the transaction occurred:REGULAR– Relative to most of the transactions (pay-ins, payouts, and transfers) in a usual workflow.REPUDIATION– Automatic withdrawal of funds from the platform’s repudiation wallet as part of the dispute process (when the user has requested a chargeback).REFUND– Reimbursement of a transaction to the user (pay-in refund), to a wallet (transfer refund), or of a payout (payout refund, only initiated by Mangopay).SETTLEMENT– Transfer made to the repudiation wallet by the platform to settle a lost dispute.
string
The unique identifier of the credited wallet.
string
The unique identifier of the debited wallet.In the case of a pay-in, this value is always
null since there is no debited wallet.object
Information about the credited funds (
CreditedFunds = DebitedFunds - Fees).Show properties
Show properties
string
Returned values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the credited funds.
integer
An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as
1260 whereas JPY 12 would be represented as just 12).object
Information about the debited funds.
Show properties
Show properties
string
Returned values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the debited funds.
integer
An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as
1260 whereas JPY 12 would be represented as just 12).object
Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet).
Show properties
Show properties
string
Returned values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the fees.
integer
An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as
1260 whereas JPY 12 would be represented as just 12).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.
string
Returned values:
CARD, DIRECT_DEBIT, PREAUTHORIZED, BANK_WIREThe type of pay-in.string
Returned values:
WEB, DIRECT, EXTERNAL_INSTRUCTIONThe type of execution for the pay-in.string
Max. length: 255 charactersCustom data that you can add to this object.
For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform.
For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform.
string
The unique identifier of the mandate.
string
Max. length: SEPA: 100 characters, BACS: truncated after 10 characters; only alphanumeric and spacesCustom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details.Note: On BACS Direct Debit pay-ins, the length is truncated at 10 alphanumeric characters or spaces, but the technical limit is 100.
400 - Payment method not activated
400 - Payment method not activated
{
"Message":"Error this mean of payment for this asked currency has been disabled",
"Type":"disabled_mean_of_payment_for_currency",
"Id":"2c4253ca-dd49-4092-8997-65b20b467b45#1663145348",
"Date":1663145349.0,
"errors":{
"error":"The method payment DIRECT_DEBIT_GOCARDLESS with the ccy EUR is not active for the partner Sandboxtest"
}
}
{
"Id": "payin_m_01J9C36G3DYBNZEHVZ5HC7WB5D",
"CreationDate": 1728056606,
"AuthorId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"CreditedUserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"Status":"CREATED",
"ExecutionDate": null,
"ChargeDate": null,
"Type": "PAYIN",
"Nature": "REGULAR",
"CreditedWalletId": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"DebitedWalletId": null,
"CreditedFunds": {
"Currency": "EUR",
"Amount": 1188
},
"DebitedFunds": {
"Currency": "EUR",
"Amount": 1200
},
"Fees": {
"Currency": "EUR",
"Amount": 12
},
"ResultCode": null,
"ResultMessage": null,
"PaymentType": "DIRECT_DEBIT",
"ExecutionType": "DIRECT",
"Tag": "Created using Mangopay API Postman Collection",
"MandateId": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"StatementDescriptor": "Example123"
}
{
"Id": "payin_m_01J9C36G3DYBNZEHVZ5HC7WB5D",
"CreationDate": 1728056606,
"AuthorId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"CreditedUserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"Status":"FAILED",
"ExecutionDate": null,
"ChargeDate": null,
"Type": "PAYIN",
"Nature": "REGULAR",
"CreditedWalletId": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"DebitedWalletId": null,
"CreditedFunds": {
"Currency": "EUR",
"Amount": 1188
},
"DebitedFunds": {
"Currency": "EUR",
"Amount": 1200
},
"Fees": {
"Currency": "EUR",
"Amount": 12
},
"ResultCode":"001833",
"ResultMessage":"The Status of this Mandate does not allow for payments",
"PaymentType": "DIRECT_DEBIT",
"ExecutionType": "DIRECT",
"Tag": "Created using Mangopay API Postman Collection",
"MandateId": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"StatementDescriptor": "Example123"
}
{
"AuthorId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
"CreditedWalletId": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"DebitedFunds": {
"Currency": "EUR",
"Amount": 1200
},
"Fees": {
"Currency": "EUR",
"Amount": 12
},
"Tag": "Created using the Mangopay API Postman collection",
"MandateId": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
"StatementDescriptor": "Example123"
}
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;
use MangoPay\Money;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$userId = 'user_m_01HYDWQNXC3M655SJXVGNDP91J';
$walletId = 'wlt_m_01HYDWR4NMAF0GRM2GZ25479EG';
$mandateId = 'mdt_m_01HYDWRQNDFC7R7P37DWH8C9SP';
$directDirectDebitPayIn = new \MangoPay\PayIn();
$directDirectDebitPayIn->AuthorId = $userId;
$directDirectDebitPayIn->CreditedWalletId = $walletId;
$directDirectDebitPayIn->DebitedFunds = new Money();
$directDirectDebitPayIn->DebitedFunds->Amount = 1000;
$directDirectDebitPayIn->DebitedFunds->Currency = 'EUR';
$directDirectDebitPayIn->Fees = new Money();
$directDirectDebitPayIn->Fees->Amount = 0;
$directDirectDebitPayIn->Fees->Currency = 'EUR';
$directDirectDebitPayIn->PaymentDetails = new \MangoPay\PayInPaymentDetailsDirectDebit();
$directDirectDebitPayIn->PaymentDetails->MandateId = $mandateId;
$directDirectDebitPayIn->ExecutionDetails = new \MangoPay\PayInExecutionDetailsDirect();
$directDirectDebitPayIn->Tag = 'Created using the Mangopay PHP SDK';
$createPayIn = $api->PayIns->Create($directDirectDebitPayIn);
print_r($createPayIn);
} 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 myPayIn = {
PaymentType: 'DIRECT_DEBIT',
ExecutionType: 'DIRECT',
AuthorId: '168935886',
Tag: 'Created with Mangopay Node.js SDK',
CreditedUserId: '168935886',
DebitedFunds: {
Currency: 'EUR',
Amount: 1000,
},
Fees: {
Currency: 'EUR',
Amount: 100,
},
CreditedWalletId: '168935920',
MandateId: '193168736',
StatementDescriptor: 'Mangopay',
}
const createDirectDirectDebitPayIn = async (payin) => {
return await mangopay.PayIns.create(payin)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createDirectDirectDebitPayIn(myPayIn)
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 createDirectDirectDebitPayIn(payInObject)
begin
response = MangoPay::PayIn::DirectDebit::Direct.create(payInObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create pay-in: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myPayIn = {
AuthorId:'195074410',
Tag: 'Created with Mangopay Ruby SDK',
CreditedUserId:'195074410',
DebitedFunds: {
Currency: 'EUR',
Amount: 1000,
},
Fees: {
Currency: 'EUR',
Amount: 100,
},
CreditedWalletId: '195074411',
MandateId: '195074413',
StatementDescriptor: 'Mangopay',
}
createDirectDirectDebitPayIn(myPayIn)
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.Money;
import com.mangopay.core.enumerations.CurrencyIso;
import com.mangopay.entities.PayIn;
import com.mangopay.entities.subentities.PayInExecutionDetailsDirect;
import com.mangopay.entities.subentities.PayInPaymentDetailsDirectDebit;
public class CreateDirectDirectDebitPayIn {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var userId = "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT";
var walletId = "wlt_m_01HTF5S9MG0XXBZ8A0550MED3Z";
var mandateId = "mdt_m_01HW30HV697QX2SQN7E500FQBJ";
PayIn payIn = new PayIn();
Money debitedFunds = new Money();
debitedFunds.setAmount(1000);
debitedFunds.setCurrency(CurrencyIso.EUR);
Money fees = new Money();
fees.setAmount(0);
fees.setCurrency(CurrencyIso.EUR);
PayInPaymentDetailsDirectDebit paymentDetails = new PayInPaymentDetailsDirectDebit();
paymentDetails.setMandateId(mandateId);
paymentDetails.setStatementDescriptor("Apr2024");
PayInExecutionDetailsDirect executionDetails = new PayInExecutionDetailsDirect();
payIn.setAuthorId(userId);
payIn.setCreditedWalletId(walletId);
payIn.setDebitedFunds(debitedFunds);
payIn.setFees(fees);
payIn.setPaymentDetails(paymentDetails);
payIn.setExecutionDetails(executionDetails);
PayIn createPayIn = mangopay.getPayInApi().create(payIn);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(createPayIn);
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 NaturalUser, DirectDebitDirectPayIn, Money
natural_user = NaturalUser.get('213753890')
direct_debit_direct_payin = DirectDebitDirectPayIn(
author_id = natural_user.id,
credited_wallet_id = '213754077',
debited_funds = Money(amount='1000', currency='EUR'),
fees = Money(amount='100', currency='EUR'),
tag = 'Created using the Mangopay Python SDK',
mandate_id = '214224837',
statement_descriptor = 'Jan2024'
)
create_direct_debit_direct_payin = direct_debit_direct_payin.save()
pprint(create_direct_debit_direct_payin)
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 userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN";
var walletId = "wlt_m_01J30991BXBB7VF28PBS82EWD3";
var returnUrl = "https://www.mangopay.com/docs/please-ignore/";
var mandateId = "mdt_m_01J3D1C35QZHHAT7XJ4WXTHRTJ";
var payIn = new PayInMandateDirectPostDTO(
userId,
new Money { Amount = 100, Currency = CurrencyIso.EUR },
new Money { Amount = 0, Currency = CurrencyIso.EUR },
walletId, returnUrl, mandateId);
var createDirectDirectDebitPayIn = await api.PayIns.CreateMandateDirectDebitAsync(payIn);
string prettyPrint = JsonConvert.SerializeObject(createDirectDirectDebitPayIn, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
Was this page helpful?