Skip to main content

Overview

The ApiRepudiations class provides methods for managing repudiations. A repudiation is created when a dispute is lost, resulting in funds being withdrawn from your account into a dedicated repudiation wallet.

Methods

Get

Retrieve a repudiation by ID.
public function Get(string $repudiationId): Repudiation
repudiationId
string
required
The repudiation identifier
Returns: Repudiation object Example:
$repudiation = $api->Repudiations->Get($repudiationId);
echo "Repudiation amount: " . $repudiation->DebitedFunds->Amount . "\n";
echo "Reason: " . $repudiation->DisputeReasonType . "\n";

GetRefunds

Retrieve refunds pertaining to a repudiation.
public function GetRefunds(string $repudiationId, ?Pagination &$pagination = null, ?FilterRefunds $filter = null, ?Sorting $sorting = null): array
repudiationId
string
required
Repudiation identifier
pagination
Pagination
Pagination parameters (passed by reference)
filter
FilterRefunds
Filter parameters
sorting
Sorting
Sorting parameters
Returns: Array of Refund objects Example:
$pagination = new MangoPay\Pagination(1, 10);
$refunds = $api->Repudiations->GetRefunds($repudiationId, $pagination);

foreach ($refunds as $refund) {
    echo "Refund {$refund->Id}: " . $refund->Status . "\n";
}

Repudiation Entity

The Repudiation object inherits from Transaction and contains:
Id
string
Unique identifier
AuthorId
string
User ID whose wallet was debited
DebitedFunds
Money
Amount withdrawn due to lost dispute
CreditedFunds
Money
Amount credited to repudiation wallet
Fees
Money
Fees charged for the repudiation
Status
string
Transaction status (SUCCEEDED, FAILED)
ResultCode
string
Result code
ResultMessage
string
Human-readable result message
DisputeId
string
ID of the dispute that led to this repudiation
InitialTransactionId
string
ID of the original transaction
DisputeReasonType
string
Reason for the dispute (FRAUD, DUPLICATE, etc.)
CreditedWalletId
string
ID of the repudiation wallet
CreationDate
int
Unix timestamp of creation
ExecutionDate
int
Unix timestamp of execution

Understanding Repudiations

Repudiations occur when:
  1. A user initiates a chargeback with their bank
  2. You contest the dispute with evidence
  3. The bank rules in favor of the cardholder
  4. Funds are automatically withdrawn from your wallet
  5. A repudiation transaction is created
The repudiation amount includes:
  • The disputed transaction amount
  • Any applicable fees

Handling Repudiations

// Get a repudiation
$repudiation = $api->Repudiations->Get($repudiationId);

if ($repudiation->Status === 'SUCCEEDED') {
    // Repudiation was processed
    $lostAmount = $repudiation->DebitedFunds->Amount;
    
    // Check related dispute
    $dispute = $api->Disputes->Get($repudiation->DisputeId);
    echo "Lost dispute type: " . $dispute->DisputeType . "\n";
    
    // Create settlement transfer to cover the repudiation
    $transfer = new MangoPay\SettlementTransfer();
    $transfer->AuthorId = $yourUserId;
    $transfer->DebitedFunds = new MangoPay\Money();
    $transfer->DebitedFunds->Amount = $lostAmount;
    $transfer->DebitedFunds->Currency = $repudiation->DebitedFunds->Currency;
    $transfer->Fees = new MangoPay\Money();
    $transfer->Fees->Amount = 0;
    $transfer->Fees->Currency = $repudiation->DebitedFunds->Currency;
    
    $settlementTransfer = $api->Disputes->CreateSettlementTransfer(
        $transfer,
        $repudiation->Id
    );
    
    echo "Settlement transfer created: " . $settlementTransfer->Id . "\n";
}

Settlement Process

After a repudiation:
  1. Repudiation Wallet: Funds are moved to a dedicated repudiation wallet
  2. Settlement Transfer: You must create a settlement transfer from one of your wallets to cover the repudiation
  3. Balance Restoration: Once settled, the repudiation is closed
Repudiations must be settled promptly. Mangopay may automatically debit your fees wallet or client wallet if a repudiation remains unsettled.

Example: Complete Repudiation Handling

// Monitor repudiations via webhook or polling
$filter = new MangoPay\FilterDisputes();
$filter->Status = 'CLOSED'; // Lost disputes
$disputes = $api->Disputes->GetAll(null, null, $filter);

foreach ($disputes as $dispute) {
    if ($dispute->ResultCode === 'LOST') {
        // Get the repudiation
        $repudiation = $api->Disputes->GetRepudiation($dispute->RepudiationId);
        
        // Create settlement transfer
        $transfer = new MangoPay\SettlementTransfer();
        $transfer->AuthorId = $platformOwnerId;
        $transfer->DebitedFunds = clone $repudiation->DebitedFunds;
        $transfer->Fees = new MangoPay\Money();
        $transfer->Fees->Amount = 0;
        $transfer->Fees->Currency = $repudiation->DebitedFunds->Currency;
        
        $api->Disputes->CreateSettlementTransfer(
            $transfer,
            $repudiation->Id
        );
        
        // Log the loss
        error_log("Settled repudiation {$repudiation->Id} for €" . 
                  ($repudiation->DebitedFunds->Amount / 100));
    }
}

See Also

Build docs developers (and LLMs) love