GET
/
v2.01
/
{ClientId}
/
users
/
{UserId}
/
bankaccounts
<?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';

    $response = $api->Users->GetBankAccounts($userId);

    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 Frog",
            "PostalCode":"75010",
            "Country":"FR"
        },
        "IBAN":"FR7630004000031234567890143",
        "BIC":"CRLYFRPP",
        "UserId":"142036728",
        "OwnerName":"John Doe",
        "Type":"IBAN",
        "Id":"142036878",
        "Tag":"Postman create a bank account",
        "CreationDate":1654073079,
        "Active":true
    },
    {
        "OwnerAddress":{
            "AddressLine1":"77 Street",
            "AddressLine2":"Rue des plantes",
            "City":"Paris",
            "Region":"Ile de France",
            "PostalCode":"75009",
            "Country":"FR"
        },
        "AccountNumber":"11696419",
        "ABA":"071000288",
        "DepositAccountType":"CHECKING",
        "UserId":"142036728",
        "OwnerName":"John Doe",
        "Type":"US",
        "Id":"150294885",
        "Tag":null,
        "CreationDate":1661864955,
        "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.
NoteThe returned parameters may vary depending on the encountered bank account types.

Query parameters

page
integer
Start value: 1Default value: 1Indicates the index of the page for the pagination.
per_page
integer
Min. value: 1; max. value: 100Default value: 10Indicates the number of items returned for each page of the pagination.
Sort
string
Allowed values: CreationDate:ASC, CreationDate:DESCIndicates the direction in which to sort the list.
Active
boolean
required
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.

Path parameters

UserId
string
required
The unique identifier of the User (natural or legal) who owns the bank account.

Responses

[
    {
        "OwnerAddress":{
            "AddressLine1":"The Oasis",
            "AddressLine2":"Rue des plantes",
            "City":"Paris",
            "Region":"Ile de Frog",
            "PostalCode":"75010",
            "Country":"FR"
        },
        "IBAN":"FR7630004000031234567890143",
        "BIC":"CRLYFRPP",
        "UserId":"142036728",
        "OwnerName":"John Doe",
        "Type":"IBAN",
        "Id":"142036878",
        "Tag":"Postman create a bank account",
        "CreationDate":1654073079,
        "Active":true
    },
    {
        "OwnerAddress":{
            "AddressLine1":"77 Street",
            "AddressLine2":"Rue des plantes",
            "City":"Paris",
            "Region":"Ile de France",
            "PostalCode":"75009",
            "Country":"FR"
        },
        "AccountNumber":"11696419",
        "ABA":"071000288",
        "DepositAccountType":"CHECKING",
        "UserId":"142036728",
        "OwnerName":"John Doe",
        "Type":"US",
        "Id":"150294885",
        "Tag":null,
        "CreationDate":1661864955,
        "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';

    $response = $api->Users->GetBankAccounts($userId);

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