Managing cards

This page will show you how to manage cards

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

Cards can also be managed manually from the cards section of our web app.

Creating a new card

To create a new card, you first need to create the user and get the account details

Once you have done this, you can create a new card like this:

curl {baseURL}/cards  
-H "Authorization:your-api-key"  
-H "Content-type: application/json"  
-X POST  
-d '{  
  "userId": "user-id",
  "accountId": "yordex-pay-account-id",
  "currency": "GBP",
  "virtual": false, 
  "cardProgram": "name"
  "shippingAddress": {
    "address1": "addressLine1",
      "address2": "addressLine2",
      "postalCode": "postalCode",
      "city": "city",
      "countryCode": "GB"
  } 
}'

The currency has to be the same as the account currency.

virtual indicates if you want to create a physical card (false) or a virtual card (true).

The cardProgram is an optional field and will default to the default card program set by your banking API provider.

The shippingAddress is where cards will be sent to. If the shippingAddress is not provided, a physical card will be shipped to the trading address set on your profile page. This field is not required for virtual cards.

The response looks like this:

{
  "id": ":id",
  "scheme": "VISA",
  "lastDigits": "0763",
  "expiryDate": "2022-04-30",
  "nameOnCard": "FIRST LAST",
  "balanceInCents": 10000,
  "currency": "GBP",
  "name": "MASTERCARD x0763",
  "status": "ACTIVATED",
  "virtual": true,
  "userId": ":userId",
  "multipleOrders": true
}

For security reasons this API does not return the full card details (16-digit number and CV2 code). How to get these is described in the displaying cards section.

Getting cards

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

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

The q parameter allows you to search by name on card or last 4 digits. Possible statuses are ACTIVATED, BLOCKED and CANCELLED. The type can be "physical" or "virtual".

Blocking or cancelling cards

You can block and unblock cards as many times as you like but cancelling is irreversible.

To block a card you can call this API:

curl {baseURL}/cards/:card-id/block  
-H "Content-type: application/json"  
-X POST

Unblocking and cancelling works the same way:

  • /cards/:card-id/unblock
  • /cards/:card-id/cancel

What’s Next