Skip to main content
The ApiPayOuts class provides methods to create and manage payout transactions, which represent funds being withdrawn from a wallet to a bank account.

Methods

Create

Create a new payout.
public function Create($payOut, $idempotencyKey = null)
payOut
PayOut
required
The PayOut object to create
idempotencyKey
string
Optional idempotency key for safe retries
Returns: \MangoPay\PayOut - The created PayOut object Example:
$payOut = new \MangoPay\PayOut();
$payOut->AuthorId = $userId;
$payOut->DebitedWalletId = $walletId;
$payOut->DebitedFunds = new \MangoPay\Money();
$payOut->DebitedFunds->Currency = 'EUR';
$payOut->DebitedFunds->Amount = 1000;
$payOut->Fees = new \MangoPay\Money();
$payOut->Fees->Currency = 'EUR';
$payOut->Fees->Amount = 10;

// Set payment details
$payOut->PaymentType = 'BANK_WIRE';
$payOut->MeanOfPaymentDetails = new \MangoPay\PayOutPaymentDetailsBankWire();
$payOut->MeanOfPaymentDetails->BankAccountId = $bankAccountId;

$result = $api->PayOuts->Create($payOut);

Get

Get a payout object by ID.
public function Get($payOutId)
payOutId
string
required
The unique identifier of the payout
Returns: \MangoPay\PayOut - The PayOut object Example:
$payOut = $api->PayOuts->Get('payout_123456');

GetBankwire

Get a bank wire payout object.
public function GetBankwire($payOutId)
payOutId
string
required
The unique identifier of the payout
Returns: \MangoPay\PayOut - The PayOut object Example:
$payOut = $api->PayOuts->GetBankwire('payout_123456');

GetRefunds

Retrieve a list of refunds for a payout.
public function GetRefunds($payOutId, & $pagination = null, $filter = null, $sorting = null)
payOutId
string
required
The ID of the payout
pagination
\MangoPay\Pagination
Pagination object (passed by reference)
filter
\MangoPay\FilterRefunds
Filtering options
sorting
\MangoPay\Sorting
Sorting options
Returns: \MangoPay\Refund[] - Array of Refund objects Example:
$pagination = new \MangoPay\Pagination();
$refunds = $api->PayOuts->GetRefunds('payout_123456', $pagination);

CheckInstantPayoutEligibility

Check if a destination bank account is eligible for instant payout.
public function CheckInstantPayoutEligibility($payOutEligibility, $idempotencyKey = null)
payOutEligibility
\MangoPay\PayOutEligibilityRequest
required
The eligibility check request object
idempotencyKey
string
Optional idempotency key
Returns: \MangoPay\PayOutEligibilityResponse - The eligibility response Example:
$eligibilityCheck = new \MangoPay\PayOutEligibilityRequest();
$eligibilityCheck->AuthorId = $userId;
$eligibilityCheck->DebitedFunds = new \MangoPay\Money();
$eligibilityCheck->DebitedFunds->Currency = 'EUR';
$eligibilityCheck->DebitedFunds->Amount = 1000;
$eligibilityCheck->BankAccountId = $bankAccountId;

$result = $api->PayOuts->CheckInstantPayoutEligibility($eligibilityCheck);

PayOut Entity

The PayOut entity represents a payout transaction.

Properties

Id
string
The unique identifier of the payout
CreationDate
int
Unix timestamp of when the payout was created
Tag
string
Custom data for your use
AuthorId
string
required
The user ID of the payout author
CreditedUserId
string
The user ID being credited (usually same as AuthorId for payouts)
DebitedWalletId
string
required
The ID of the wallet being debited
DebitedFunds
\MangoPay\Money
required
The amount debited from the wallet
CreditedFunds
\MangoPay\Money
The amount credited to the bank account (DebitedFunds - Fees)
Fees
\MangoPay\Money
required
The fees taken from the transaction
Status
string
The status of the transaction: CREATED, SUCCEEDED, FAILED
ResultCode
string
The result code of the transaction
ResultMessage
string
The result message explaining the result code
ExecutionDate
int
Unix timestamp of when the transaction was executed
Type
string
The transaction type: PAYOUT
Nature
string
The transaction nature: REGULAR, REFUND, REPUDIATION
PaymentType
string
required
The payment type: BANK_WIRE, MERCHANT_EXPENSE, AMAZON_GIFTCARD
MeanOfPaymentDetails
object
required
Payment-specific details object (type depends on PaymentType)

Build docs developers (and LLMs) love