# verifyRequirement(\[payload,])

On success, if the requirement belongs to a program/campaign objective, ChainVine will asynchronously check whether the user has completed enough requirements to mark an objective as completed.

```typescript
const campaignId = '02jd020jkd-302jdi2d-02ij0dj';

const requirementId = 'Hiodn2oD2dkmo2';

const verify = await userClient.verifyRequirement(
   {
      id: requirementId,
      campaign: {
         id: campaignId
      }
   }
)
```

## Params

<table><thead><tr><th width="180">Field</th><th width="141">Required</th><th width="133">Type</th><th>Description</th></tr></thead><tbody><tr><td>campaign.id</td><td>required</td><td>String</td><td>the id of the program/campaign the requirement belongs to<br>Note: this campaign/program must belong to your account</td></tr><tr><td>id</td><td>required</td><td>String</td><td>the referral program/campaign requirement id</td></tr></tbody></table>

## **Response**

***UserRequirementResponse***

<table><thead><tr><th width="180">Field</th><th width="141">Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>String</td><td>the referral program/campaign requirement id</td></tr><tr><td>completed</td><td>Boolean</td><td>a boolean representing if the user has completed the requirement or not</td></tr></tbody></table>

## Examples

{% tabs %}
{% tab title="Browser" %}
In this approach, we complete a requirement ad-hoc for a user, by passing in a referrer\_id if one has been captured by a referral link beforehand.

If the referrer id is passed into the request, and no referral has ever been made between this user and any referrer, then a Referral will be created.

```typescript
import { ChainvineClient, getReferrerId } from '@chainvine/sdk';

const userWalletAddress = '0x293kdo0ij0';

const campaignId = 'aSlug123';

// Generate your ChainvineClient instance
const client = new ChainvineClient(); //Make sure to whitelist your domain

const requirementId = 'Hiodn2oD2dkmo2';

const userClient = await client.syncUser(userWalletAddress);

const completion = await userClient.verifyRequirement({
    campaign: {
        id: campaignId
    },
    id: requirementId,
});

```

{% endtab %}

{% tab title="Server" %}
In this approach, we complete a requirement ad-hoc for a user, by passing in a referrer\_id if one has been captured by a referral link beforehand.

If the referrer id is passed into the request, and no referral has ever been made between this user and any referrer, then a Referral will be created.

```typescript
import { ChainvineClient } from '@chainvine/sdk';

const userWalletAddress = '0x293kdo0ij0';

const campaignId = '02jd020jkd-302jdi2d-02ij0dj';

// Generate your ChainvineClient instance
const client = new ChainvineClient({
    apiKey: '0dj03j000d'  // Your API Key
});

const requirementId = 'Hiodn2oD2dkmo2';

const userClient = await client.syncUser(userWalletAddress);

const completion = await userClient.verifyRequirement({
    campaign: {
        id: campaignId
    },
    id: requirementId,
});

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chainvine.xyz/developers/sdk/classes-and-functions/chainvineuser/verifyrequirement-payload.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
