Skip to main content
GET
/
v2.01
/
{ClientId}
/
users
/
{UserId}
/
cards
<?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->GetCards($userId);

    print_r($response);
} catch(MGPResponseException $e) {
    print_r($e);
} catch(MGPException $e) {
    print_r($e);
}  
[
    {
        "ExpirationDate": "1229",
        "Alias": "497010XXXXXX8183",
        "CardType": "CB_VISA_MASTERCARD",
        "CardProvider": "VISA",
        "Country": "FRA",
        "Product": "I",
        "BankCode": "unknown",
        "Active": true,
        "Currency": "EUR",
        "Validity": "UNKNOWN",
        "UserId": "user_m_01HWWPNMR93ASQYJEH6XVDW44T",
        "Id": "card_m_01HXVD91R8QEDY7MYC8TX9R9M8",
        "Tag": null,
        "CreationDate": 1715685590,
        "Fingerprint": "48d63bbcfc2c47fcbc19df35e47b2f8d",
        "CardHolderName": "Alex Smith"
    },
    {
        "ExpirationDate": "0626",
        "Alias": "497010XXXXXX1119",
        "CardType": "CB_VISA_MASTERCARD",
        "CardProvider": "VISA",
        "Country": "FRA",
        "Product": "I",
        "BankCode": "unknown",
        "Active": true,
        "Currency": "EUR",
        "Validity": "UNKNOWN",
        "UserId": "user_m_01HWWPNMR93ASQYJEH6XVDW44T",
        "Id": "card_m_01HXVF4VAM59ZT3FT42T1ZH35Y",
        "Tag": null,
        "CreationDate": 1715687550,
        "Fingerprint": "36c74d2e60ba474eab6d6f6d46a642b0",
        "CardHolderName": "Jody Smith"
    }
]

Query parameters

Active
boolean
Whether the card is active or not.

Path parameters

UserId
string
required
The unique identifier of the user.

Responses

Array (Cards)
array
The list of the cards created by the platform.
[
    {
        "ExpirationDate": "1229",
        "Alias": "497010XXXXXX8183",
        "CardType": "CB_VISA_MASTERCARD",
        "CardProvider": "VISA",
        "Country": "FRA",
        "Product": "I",
        "BankCode": "unknown",
        "Active": true,
        "Currency": "EUR",
        "Validity": "UNKNOWN",
        "UserId": "user_m_01HWWPNMR93ASQYJEH6XVDW44T",
        "Id": "card_m_01HXVD91R8QEDY7MYC8TX9R9M8",
        "Tag": null,
        "CreationDate": 1715685590,
        "Fingerprint": "48d63bbcfc2c47fcbc19df35e47b2f8d",
        "CardHolderName": "Alex Smith"
    },
    {
        "ExpirationDate": "0626",
        "Alias": "497010XXXXXX1119",
        "CardType": "CB_VISA_MASTERCARD",
        "CardProvider": "VISA",
        "Country": "FRA",
        "Product": "I",
        "BankCode": "unknown",
        "Active": true,
        "Currency": "EUR",
        "Validity": "UNKNOWN",
        "UserId": "user_m_01HWWPNMR93ASQYJEH6XVDW44T",
        "Id": "card_m_01HXVF4VAM59ZT3FT42T1ZH35Y",
        "Tag": null,
        "CreationDate": 1715687550,
        "Fingerprint": "36c74d2e60ba474eab6d6f6d46a642b0",
        "CardHolderName": "Jody Smith"
    }
]
<?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->GetCards($userId);

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