Overview
TheApiTransfers class provides methods to create transfers between wallets, retrieve transfer details, and manage transfer refunds. Transfers allow you to move funds from one wallet to another within your Mangopay platform.
Methods
Create
Create a new transfer between two wallets.The transfer object to create
Optional idempotency key to prevent duplicate requests
Transfer - The created transfer object
Example:
Get
Retrieve a transfer by its ID.The transfer identifier
Transfer - The transfer object
Example:
CreateRefund
Create a refund for a transfer.The transfer identifier to refund
The refund object to create
Optional idempotency key to prevent duplicate requests
Refund - The created refund object
Example:
GetRefunds
Retrieve all refunds for a specific transfer.The transfer identifier
Pagination object to control page size and number
Filter object to filter refunds by specific criteria
Sorting object to sort the results
Refund[] - Array of refund objects
Example:
Transfer Entity
TheTransfer class extends the Transaction class and represents a transfer between wallets.
Properties
Unique identifier for the transfer (read-only)
Custom data for the transfer
Unix timestamp of when the transfer was created (read-only)
The ID of the user who initiated the transfer
The ID of the user who receives the funds
The amount debited from the source walletContains:
Amount(int): The amount in the smallest currency unitCurrency(string): ISO 4217 currency code
The amount credited to the destination walletContains:
Amount(int): The amount in the smallest currency unitCurrency(string): ISO 4217 currency code
The fees taken by the platformContains:
Amount(int): The fee amount in the smallest currency unitCurrency(string): ISO 4217 currency code
The status of the transfer (read-only)Possible values:
CREATED- Transfer has been createdSUCCEEDED- Transfer completed successfullyFAILED- Transfer failed
The result code of the transfer (read-only)
The result message explaining the result code (read-only)
Unix timestamp of when the transfer was executed (read-only)
The type of transaction (always “TRANSFER” for transfers)
The nature of the transaction
The ID of the wallet from which funds are debited
The ID of the wallet to which funds are credited
The ID of the related deposit, if applicable
Strong Customer Authentication context for the transfer
Information about any pending user action required (e.g., SCA redirect)
Example Object
Read-Only Properties
The following properties are read-only and cannot be modified:IdCreationDateStatusResultCodeResultMessageExecutionDate
Money Object
TheMoney object is used throughout transfers to represent monetary values:
Amounts are always represented in the smallest currency unit. For example:
- €10.00 = 1000 cents
- $25.50 = 2550 cents
- £100.00 = 10000 pence
Transfer Flow
- Create Transfer: Use
Create()to initiate a transfer between two wallets - Check Status: Use
Get()to check the transfer status - Handle SCA: If
PendingUserActionis present, redirect the user for authentication - Refund (if needed): Use
CreateRefund()to refund a transfer - Track Refunds: Use
GetRefunds()to list all refunds for a transfer