Skip to main content
GET
/
v2.01
/
{ClientId}
/
users
/
{UserId}
/
bankaccounts
/
{BankAccountId}
<?php 

require_once 'vendor/autoload.php';

use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;

$api = new MangoPayApi();

$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';

try {
    $userId = '146476890';
    $bankAccountId = '194612216';

    $response = $api->Users->GetBankAccount($userId, $bankAccountId);

    print_r($response);
} catch(MGPResponseException $e) {
    print_r($e);
} catch(MGPException $e) {
    print_r($e);
}  
{
    "OwnerAddress":{
        "AddressLine1":"The Oasis",
        "AddressLine2":"Rue des plantes",
        "City":"Paris",
        "Region":"Ile de France",
        "PostalCode":"75010",
        "Country":"FR"
    },
    "IBAN":"FR7630004000031234567890143",
    "BIC":"CRLYFRPP",
    "UserId":"user_m_01J18HZSACR1EMYNY1TBS8KTJD",
    "OwnerName":"Alex Smith",
    "Type":"IBAN",
    "Id":"bankacc_m_01J6A30MFXK50P8C8PCB73PM1B",
    "Tag":"Created using Mangopay API Postman Collection",
    "CreationDate":1654073079,
    "Active":true
}  
Caution – Replaced by Recipients featureThe Bank Account object and endpoints have been replaced by the Recipients feature, which all platforms should integrate instead.Legacy active Bank Accounts (Active is true) have been migrated to the new feature and their data is retrievable via the GET View a Recipient endpoint using the same BankAccountId. Read more about legacy bank account migration.

Path parameters

BankAccountId
string
required
The unique identifier of the bank account.

Responses

OwnerAddress
object
Information about the address of residence of the bank account owner.
IBAN
string
Max. length: 34 charactersThe IBAN (international bank account number) of the bank account. It follows the CCDDBBAN format in which:
  • CC represents the country code (ISO 3166-1 alpha 2)
  • DD represents two check digits used by banking systems to avoid simple errors
  • BBAN stands for the Basic Bank Account Number which is up to 30 alphanumeric characters that are country-specific.
    Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed.
BIC
string
The BIC (international identifier of the bank) for IBAN or OTHER-type bank accounts.The BIC can have one of the two following formats:
  • BIC8 – 8-character BIC (AAAABBCC)
  • BIC11 – 11-character BIC (AAAABBCCDDD)
In which:
  • AAAA represents the bank code: 4 characters defining the bank
  • BB represents the country code: 2 characters forming the country ISO code (ISO 3166 format)
  • CC represents the location code: 2 localization characters (alphabetical or numeric) to distinguish banks from the same country
  • DDD represents the branch code: 3 characters used to define the branch of the bank (sometimes replaced with XXX)
UserId
string
The unique identifier of the User (natural or legal) who owns the bank account.
OwnerName
string
Max. length: 255 charactersThe full name of the owner of the bank account. (Format: FirstName LastName)
Type
string
Returned values: IBAN, US, CA, GB, OTHERThe type of the bank account, indicating the country where the real-life account is registered
The values are:
  • IBAN – For accounts registered in countries that use IBAN 
  • US – For accounts registered in the United States 
  • CA – For accounts registered in Canada
  • GB – For accounts registered in the United Kingdom
  • OTHER – For accounts registered in countries that do not use IBAN (and are not US, CA, GB)
Id
string
Max length: 128 characters (see data formats for details)The unique identifier of the object.
Tag
string
Max. length: 255 charactersCustom data that you can add to this object.
For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance).
CreationDate
Unix timestamp
The date and time at which the object was created.
Active
boolean
Whether or not the Bank Account is active. Mangopay automatically sets this parameter to false if the bank account is closed or does not exist anymore.
OwnerAddress
object
Information about the address of residence of the bank account owner.
AccountNumber
string
Length: 8 digitsThe unique set of digits of the bank account.
SortCode
string
The 6-digit sort code, assigned to UK financial institutions, for GB-type bank accounts.
UserId
string
The unique identifier of the User (natural or legal) who owns the bank account.
OwnerName
string
Max. length: 255 charactersThe full name of the owner of the bank account. (Format: FirstName LastName)
Type
string
Returned values: IBAN, US, CA, GB, OTHERThe type of the bank account, indicating the country where the real-life account is registered
The values are:
  • IBAN – For accounts registered in countries that use IBAN 
  • US – For accounts registered in the United States 
  • CA – For accounts registered in Canada
  • GB – For accounts registered in the United Kingdom
  • OTHER – For accounts registered in countries that do not use IBAN (and are not US, CA, GB)
Id
string
Max length: 128 characters (see data formats for details)The unique identifier of the object.
Tag
string
Max. length: 255 charactersCustom data that you can add to this object.
For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance).
CreationDate
Unix timestamp
The date and time at which the object was created.
Active
boolean
Whether or not the Bank Account is active. Mangopay automatically sets this parameter to false if the bank account is closed or does not exist anymore.
{
    "OwnerAddress":{
        "AddressLine1":"The Oasis",
        "AddressLine2":"Rue des plantes",
        "City":"Paris",
        "Region":"Ile de France",
        "PostalCode":"75010",
        "Country":"FR"
    },
    "IBAN":"FR7630004000031234567890143",
    "BIC":"CRLYFRPP",
    "UserId":"user_m_01J18HZSACR1EMYNY1TBS8KTJD",
    "OwnerName":"Alex Smith",
    "Type":"IBAN",
    "Id":"bankacc_m_01J6A30MFXK50P8C8PCB73PM1B",
    "Tag":"Created using Mangopay API Postman Collection",
    "CreationDate":1654073079,
    "Active":true
}  
<?php 

require_once 'vendor/autoload.php';

use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;

$api = new MangoPayApi();

$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';

try {
    $userId = '146476890';
    $bankAccountId = '194612216';

    $response = $api->Users->GetBankAccount($userId, $bankAccountId);

    print_r($response);
} catch(MGPResponseException $e) {
    print_r($e);
} catch(MGPException $e) {
    print_r($e);
}  
I