# Store if verified

Source: https://developer.avalara.com/avatax-for-bevalc/age-verification-api/store-if-verified/

# Store if verified

The [StoreIfVerified](https://sandbox-rest.avatax.com/swagger/ui/index.html?urls.primaryName=Alcohol%20Shipping%20Verification#/Age%20Verification/storeIfVerified) endpoint conditionally performs an age verification check. If a record matching the request is found, the associated response is returned. If a record matching the request is not found, then an age verification check is performed, and the response is stored if the individual is determined to be of age.

## Endpoint

POST /api/v2/ageverification/store/identity/storeIfVerified

## Input fields for store if verified

The table below describes the required and optional fields for the store if verified request.

Field name

Description

Required?

`firstName`

The first name of the person whose age you want to verify.

Yes

`lastName`

The last name of the person whose age you want to verify.

Yes

`address`

The address of the person whose age you want to verify. One of the following sets of attributes are required for`address`:

-   `line1`,`city`,`region`
-   `line1`,`postalCode`

A`country` field can also be provided, but only`US` and`USA` are valid.

Yes

`DOB`

The ISO-8601 compliant date of birth of the person whose age you want to verify. Note that a date of birth can be specified in a transaction using the`PurchaserDOB` and`RecipientDOB` parameters.

No

## Parameters

The table below describes a parameter that can specified in the store if verified request URL on Sandbox only. For example:

`https://sandbox-rest.avatax.com/api/v2/ageverification/store/identify/storeIfVerified?simulatedFailureCode=not_found`

**Note:** The`simulatedFailureCode` parameter is only available in Sandbox. You will receive an error if you attempt to use this in Production. This optional parameter provides you with a method for testing whether your integration can consume these failure codes, without incurring costs associated with running this endpoint in production.

Parameter

Description

`simulatedFailureCode`

An array of failure codes to include in a simulated response for the endpoint. These codes specify why a`false` age verification was returned. Available failure codes include:

-   `not_found`
-   `dob_unverifiable`
-   `under_age`
-   `suspected_fraud`
-   `deceased`
-   `unknown_error`

## Request

This request searches the internal store for an existing age verification record. If the record does not exist, the request then runs an age verification check and stores the response if`isOfAge=true`.

```
curl    -X POST    -H 'Accept: application/json'    -H 'Authorization: Basic aHR0cHdhdQNoOmY='    -H 'Content-Type: application/json'    --data '{      "firstName": "John",      "lastName": "Doe",      "address": {        "line1": "255 S King St",        "city": "Seattle",        "region": "WA",        "country": "US",        "postalCode": "98104"      },      "DOB": "1994-10-01"    }'    'https://sandbox-rest.avatax.com/api/v2/ageverification/store/identity/storeIfVerified'
```

## Response

The response returns a record that already exists for this individual.

```
{  "isOfAge": false,  "failureCodes": [    "deceased",    "dob_unverifiable"  ],  "fromStore": true,  "createdUtc": "2022-10-07T18:40:53.534Z"}
```

[Previous](/avatax-for-bevalc/age-verification-api/find-an-age-verification-record)

[Next](/avatax-for-bevalc/requirements/understanding-bevalc-transactions)