Skip to main content

Recollect Security Code

Securely recapture CVC codes for saved cards with a simple, efficient tool.

To boost authorization rates while adhering to PCI compliance, some Payment Service Providers (PSPs) recommend or mandate that Customer-Initiated Transactions (CITs) with saved cards include the card security code (CSC, also known as CVV or CVC), which cannot be stored in long-term persisted tokens. This guide equips merchants and platforms with the tools to securely recollect the CVC/CVV from customers, enhancing transaction security and meeting PSP requirements. Recollection may be triggered by factors like heightened fraud detection, updated risk policies, card network rules, or regional regulatory changes, ensuring compliance and improved payment success.

Recollect Security Code Diagram
Recollecting the Card Security Code is a business decision that may be merchant-driven or enforced by a PSP. Merchants should align with their PSP on when and why CVC recollection is required.

Getting Started​

To get started, you will need to create a Basis Theory Account and a TEST Tenant.

Be sure to use your work email (e.g., john.doe@yourcompany.com)

Public Application​

You will need a Public Application to authenticate requests. Click here to create one using the Basis Theory Customer Portal.

This will create an application with the following Access Controls:

  • Permissions: token:update
Save the key from the created Public Application as it will be used later in this guide.

Configure Elements SDK​

Basis Theory Elements are available for the following technologies. Click below for detailed instructions on how to install and configure them.

Javascript
React
iOS
Android
React Native

Add the CVC Element​

Once installed and configured, add the CardVerificationCode Element to your application. This will enable your users to type in their Card Security Code in your form, while ensuring your systems never come in contact with the data.

<div id="cardVerificationCode" style="width: 100%;"></div>
import BasisTheory from '@basis-theory/web-elements';

let bt;
let cvvElement;

async function init() {
bt = BasisTheory('<PUBLIC_API_KEY>');

cvvElement = bt.createElement('cvv', {
cardBrand: 'visa',
});
await cvvElement.mount('#cardVerificationCode');
}

init();

Update the Token​

Now we will invoke the Update Token endpoint from the SDK, passing the CardVerificationCode Element in the payload. This will securely update the card token by transferring the value from the frontend Element to the Basis Theory API, where the data will be strongly encrypted and temporarily stored in a compliant environment.

Given you had previously saved a Token:

Token sample
{
"id": "1cd9c8bf-99fd-4784-ba69-68b15b301019",
"tenant_id": "74eca6ab-f94d-49bc-9f3c-6144eb3415ac",
"type": "card",
"card": {
"bin": "42424242",
"brand": "visa",
"last4": "4242",
"expiration_month": 12,
"expiration_year": 2025,
"funding": "credit",
"authentication": "sca_required"
},
"fingerprint": "BKJYqf2tcvhTHSXN7EvBJLviN3PBYRgwoJgce8VAfnSr",
"_extras": {
"deduplicated": false
},
...
}

Add a submit function along with a button to trigger it:

<div id="cardVerificationCode" style="width: 100%;"></div>
<button id="submit">Submit</button>
import BasisTheory from '@basis-theory/web-elements';

let cvvElement;

async function init () {
...
document.getElementById("submit").addEventListener("click", submit);
}

async function submit () {
try {
await bt.tokens.update('1cd9c8bf-99fd-4784-ba69-68b15b301019', {
data: {
cvc: cvvElement,
}
});
// TODO process the card payment
} catch (error) {
console.error(error);
}
}

init();

The updated Token stores the cvc for 24 hours, allowing you to process the new CIT.

Authentication

Once the Token has been created, merchants may need to authenticate the cardholder to comply with PSD2’s Strong Customer Authentication (SCA) requirements and reduce fraud. The specific authentication steps depend on the card’s region, issuer requirements, and the merchant’s risk strategy.

3D Secure

3D Secure (3DS) is the protocol used to meet SCA mandates in the EEA, the UK and other regulated markets, and to seek liability shift to the issuer. The card.authentication field on the token tells you whether the card's issuing country mandates authentication. It covers the issuer side only; whether your acquirer is in a regulated market is something you track per merchant account.

if (token.card.authentication === 'sca_required') {
// trigger the 3DS authentication flow
}

Triggering 3DS explains how to combine this flag with your acquirer's jurisdiction, which exemptions you can request, and when to authenticate when nothing mandates it. The 3DS guides cover the implementation.

Next Steps​

Now that you've implemented this workflow in your application, the next step is to process payments using the refreshed token.

Click here to visit our Charge a Card guide.