> ## Documentation Index
> Fetch the complete documentation index at: https://primer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# validate

Perform a validation process on the provided `additionalData` for a given `vaultedPaymentMethodId`.

```typescript TYPESCRIPT theme={"dark"}
    async validate(vaultedPaymentMethodId: string, additionalData: VaultedPaymentMethodAdditionalData): Promise<ValidationError[]>
```

## Parameters

**Parameters**

**vaultedPaymentMethodId** `String` *required*

The `id` of `VaultedPaymentMethod` previously retrieved with [fetchVaultedPaymentMethods](https://primer.io/docs/sdk/react-native/v2.x.x/primer-headless-checkout/vault-manager/fetchVaultedPaymentMethods.md).

**additionalData** `VaultedPaymentMethodAdditionalData` *required*

**Properties**

**cvv** `string` *required*

CVV value associated with the vaulted card.

## Returns

The `validate` method performs validation operation for the given `vaultedPaymentMethodId` and `additionalData`.
Returns a Promise of `ValidationError[]`.

In case of successful operation, this method will return:

&#x20;

**Returns**

**ValidationError\[]**

**ValidationError**

**Properties**

**errorId** `string`

A unique error identifier.

**description** `string`

A error description.

**diagnosticsId** `string`

A unique diagnostics id for the given error.

If the returned list is empty after performing a validation process, it indicates that the data has passed the validation successfully.
On the other hand, if the validation process encounters any issues or errors, the result object will contain a list of `ValidationError` objects.
These objects represent specific validation errors or issues associated with the payment method data.

## Example

The `VaultManager` needs to be configured before `validate` can be called.
Refer to the following example for [configuring](https://primer.io/docs/sdk/react-native/v2.x.x/primer-headless-checkout/vault-manager/configure.md) the `VaultManager`.

```typescript TYPESCRIPT theme={"dark"}
async function validateAdditonalData() {
  try {
    //Ensure the Vault Manager has been configured
    const validationErrors = await vaultManager.validate(
      "yourVaultedPaymentMethodId",
      yourAdditionalData
    );
  } catch (error) {
    console.error("Error validating additonal data:", error);
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.