> ## 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

<Expandable title="Parameters" defaultOpen>
  <ResponseField name="vaultedPaymentMethodId" type="String" required>
    The `id` of `VaultedPaymentMethod` previously retrieved with [fetchVaultedPaymentMethods](/docs/sdk/react-native/v2.x.x/primer-headless-checkout/vault-manager/fetchVaultedPaymentMethods).
  </ResponseField>

  <ResponseField name="additionalData" type="VaultedPaymentMethodAdditionalData" required>
    <Expandable title="Properties" defaultOpen>
      <ResponseField name="cvv" type="string" required>
        CVV value associated with the vaulted card.
      </ResponseField>
    </Expandable>
  </ResponseField>
</Expandable>

## 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:

{" "}

<Expandable title="Returns" defaultOpen>
  <ResponseField name="ValidationError[]">
    <Expandable>
      <ResponseField name="ValidationError">
        <Expandable title="Properties">
          <ResponseField name="errorId" type="string">
            A unique error identifier.
          </ResponseField>

          <ResponseField name="description" type="string">
            A error description.
          </ResponseField>

          <ResponseField name="diagnosticsId" type="string">
            A unique diagnostics id for the given error.
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>
</Expandable>

<br />

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](/docs/sdk/react-native/v2.x.x/primer-headless-checkout/vault-manager/configure) 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);
  }
}
```
