Skip to main content
GET
/
v2.01
/
{ClientId}
/
cards
/
{CardId}
<?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 {
    $cardId = '193935874';

    $response = $api->Cards->Get($cardId);

    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"
}

Path parameters

CardId
string
required
The unique identifier of the Card object, which is returned after updating the Card Registration object with the RegistrationData.

Responses

ExpirationDate
string
Format: “MMYY”The expiration date of the card.
Alias
string
The card number, partially obfuscated.
CardProvider
string
Allowed values: CB, VISA, MASTERCARD, AMEX, MAESTRO, BCMC, JCB, DISCOVERThe provider of the card.
Country
string
Format: ISO-3166-1 alpha-3 three-letter country code (e.g., “FRA”)The country of the card (which is the same as the country of the issuer).
Product
string
The product type of the card. You can find the list of products in the Card products article (coming soon).
BankCode
string
The name of the card issuing bank.
Validity
string
Returned values: UNKNOWN, VALID, INVALIDWhether the card is valid or not.
  • UNKNOWN – No payment or card validation has been processed, so the validity of the card remains unknown.
  • VALID – The first payment or card validation using the card was processed successfully within 24 hours of the initial card registration.
  • INVALID – The first payment or card validation using the card was attempted and failed, or the status of the corresponding card registration was CREATED for more than 24 hours.
    Once a card is set to INVALID, it cannot be set back to VALID. A new card registration will be necessary to make a payment.
UserId
string
The unique identifier of the user the card belongs to.
Id
string
The unique identifier of the Card object.
Tag
string
Custom data added to this object.
In the case of the Card object, the tag value is inherited from the Card Registration object and is not editable.
CreationDate
Unix timestamp
The date and time at which the object was created.
Fingerprint
string
The unique representation of the card number. This string can be used to track the card behavior while keeping the card information confidential.
{
    "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"
}
<?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 {
    $cardId = '193935874';

    $response = $api->Cards->Get($cardId);

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