Displaying cards

This page will show you how to display card details in your mobile app

This page explains how to display cards by API and has the following sections:

Getting cards

To get a list of cards you can call this API:

curl {baseURL}/cards?accountId=:account_id&q=john&status=ACTIVATED&userId=:user-id&type=physical
-H "Authorization:your-api-key"  
-X GET

The accountId filter is mandatory. This id is returned when getting all accounts

Optional filters are:

  • q : allows you to search by name on card or last 4 digits
  • status: possible statuses are ACTIVATED, BLOCKED and CANCELLED
  • userId : returned when getting all users
  • type : can be "physical" or "virtual"

The response looks as follows:

"content": [
  {
    "id": ":card_id",
    "scheme": "VISA",
    "lastDigits": "0763",
    "expiryDate": "2022-04-30",
    "nameOnCard": "Maya Angelou",
    "balanceInCents": 10000,
    "currency": "GBP",
    "name": "MASTERCARD x0763",
    "status": "ACTIVATED",
    "virtual": true,
    "userId": ":userId"
  }
}

Most fields are self explanatory and are also explained here. virtual indicates if you want to create a physical card (false) or a virtual card (true).

To get a single card you can call this API:

curl {baseURL}/cards/:card_id
-H "Authorization:your-api-key"  
-X GET

Getting cardholder details

You can use the :user_id that is returned when getting a card to get the cardholder details by getting user details.

Getting the long card number and CVC

❗️

PCI compliance

For PCI compliance reasons, you have to make sure to never store the long card number or CVC2.

To get the long card number and CVC2 you first call this API:

curl {baseURL}/cards/:cardId/paymentdetails?ipAddress=ip-address  
-H "Content-type: application/json"  
-X GET

The ip-address is the address of the browser or mobile app, so your user's IP address. It is not the IP address of your backend servers. You can get the IP address using a service like json.ip

The response will look like this:

{
  "url": "{baseURL}/cards/pan/:pan-id"
}

You can now get the long number by using that url to get the results:

curl {baseURL}/cards/pan/:pan-id
-H "Content-type: application/json"  
-X GET

The response will look like this:

{
  "card_name": "Frank Underwood",
  "card_pan": "4000000000000000",
  "card_exp_date": "2025-02-28",
  "card_cvc2": "123"
}

Getting the card PIN

❗️

PCI compliance

For PCI compliance reasons, you have to make sure to never store the PIN.

You can get the PIN for a card like this

curl {baseURL}/cards/:cardId/pin?ipAddress=ip-address  
-H "Content-type: application/json"  
-X GET

As before, the ip-address is the address of the browser or mobile app, so your user's IP address. It is not the IP address of your backend servers. You can get the IP address using a service like json.ip

The response will look like this:

{
  "url": "pin-url"
}

You can then use this response to get the PIN

curl https://app.yordex.com/get-response-from-url
-H "Content-type: application/json"  
-X POST '{
  "url": "pin-url"
}'

Please use the URL shown in this sample code. This is the only API call that does not use our {baseURL}.

The response will include the PIN

{
  "card_pin":"xxxx"
}