Add spend control directly to the new or existing cards

This page will show you how to set card rules

This page explains how to manage card spend controls:

📘

Be aware: Spend Controls can only be applied to certain Yordex card schemes

Speak with your Customer Success Manager to find out if your cards are eligable for controls.


Merchant category controls

Visa and MasterCard have their own lists of merchant categories (MCC).

On the Accounts page we showed you that for most transactions we receive an MCC code:

"mcc": "7801",
"mccDescription": "merchant category description",

It's possible to only block or only allow specific categories on a card. Note, block and allow controls cannot be combined and must be one or the other.

Creating a card with MCC controls:

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,
    "shippingAddress":
    {
        "address1": "addressLine1",
        "address2": "addressLine2",
        "postalCode": "postalCode",
        "city": "city",
        "countryCode": "GB"
    },
    "spendControls":
    {
        "mccSpendControls":
        {
            "allowed": "true/false",
            "mccs":
            [
                {
                    "code": "4121",
                    "name": "Taxicabs and Limousines"
                },
                {
                    "code": "4816",
                    "name": "Computer Network Services"
                }
            ]
        }
    }
}'

Applying a MCC controls to a card:

curl {baseURL}/cards/:cardId/spendcontrols
-H "Authorization:your-api-key"  
-H "Content-type: application/json"  
-X PUT  '{
  "mccSpendControls": {
    "allowed": "true/false",
    "mccs": [
      {
        "code": "4121",
        "name": "Taxicabs and Limousines"
      },
      {
       "code": "4816",
       "name": "Computer Network Services"
      }
    ]
  }
}'

If you use a allowed=true only MCCs included in the list will be accepted. Payments at any other MCC will be blocked. You can also specify allowed=false .

Successful requests will return a 204 response.

A full list of MCC codes can be found here.

🚧

PUT can delete previously specified MCCs

Updating spendcontrols is a PUT. That means that if you want to add one MCC to the list, you need to specify that MCC plus all previously added MCCs in the request. If you do not add previously added MCCs, they will be deleted from the list

A card can not have both allowed and not allowed lists.


Amount spend controls

Transaction limits can be applied to card to determine how much they're allowed to spend across a period of time/event. We currently support following types of Amount spend controls:

  • Possible values are PER_TRANSACTION, LIFETIME, DAILY, WEEKLY, MONTHLY, YEARLY

Creating a card with a VELOCITY limit

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,
    "shippingAddress":
    {
        "address1": "addressLine1",
        "address2": "addressLine2",
        "postalCode": "postalCode",
        "city": "city",
        "countryCode": "GB"
    },
    "spendControls":
    {
        "amountSpendControls":
        [
            {
                "amountInCents": 1234,
                "velocityType": "Velocity type (see above)"
            }
        ]
    }
}'

Note: this is a sample request, please use our card creation guide to determine the fields you require.

Applying a VELOCITY limit to an existing card

This will update any existing control applied to a card. You can use this request to increase/decrease the limit applied to your cards.

curl {baseURL}/cards/:cardId/spendcontrols
-H "Authorization:your-api-key"  
-H "Content-type: application/json"  
-X PUT  '{
    "amountSpendControls":[
        {
            "amountInCents":1234,
            "velocityType": "Velocity type (see above)"
        }
    ]
}'

Successful requests will return a 204 response.

Country spend controls

Country spend controls can be applied to cards to allow/block transactions in certain countries

Creating a card with a country spend control

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,
    "shippingAddress":
    {
        "address1": "addressLine1",
        "address2": "addressLine2",
        "postalCode": "postalCode",
        "city": "city",
        "countryCode": "GB"
    },
    "spendControls":
    {
        "countrySpendControls": {
          "allowed": true/false,
          "countryCodes": [
              "US",
              "GB"
          ]
      }
    }
}'

Note: this is a sample request, please use our card creation guide to determine the fields you require.

Applying a country spend control to an existing card

This will update any existing control applied to a card.

curl {baseURL}/cards/:cardId/spendcontrols
-H "Authorization:your-api-key"  
-H "Content-type: application/json"  
-X PUT  '{
    "countrySpendControls": {
        "allowed": true,
        "countryCodes": [
            "US",
            "GB"
        ]
    }
}'

Successful requests will return a 204 response.


Removing spend controls

To remove one or more controls from a card, submit a PUT request to update the controls with an empty request body.

curl {baseURL}/cards/:cardId/spendcontrols
-H "Authorization:your-api-key"  
-H "Content-type: application/json"  
-X PUT  '{}'

Successful requests will return a 204 response.