# Creating a Verification Request

The `verifyContactsPrescription` mutation is the core of the Visibly integration. Calling this mutation initiates the automated verification workflow and returns a unique `jobId`, which you will use to track the request to completion.

## 1. Common Requirements

The structure of your request variables depends on how the user provides their prescription information in your frontend. Regardless of the flow, all requests must include the **Patient** and **Product** details.

- Patient Details: `patient` (Name, DOB, address).
- Product Details: `products` (The specific lenses being ordered, including the productIds and various parameters for those specific lenses).


## 2. User Flows

Choose one of the following three methods to provide prescription verification data:

#### Flow A: User Uploads their Rx

Use this when the user uploads a photo or PDF of their physical prescription.

- Path: `fileId`
- Requirements: The `fileId` generated in Step 02.


#### Flow B: User Selects a Doctor from Database

Use this when the user finds their doctor in Visibly's doctor database.

- Path: `doctor.doctorId`
- Requirement: The specific `doctorId` from the Visibly database, found in Step 02.


#### Flow C: User Provides Info Manually

Use this if the user cannot find their doctor in Visibly's doctor database.

- Path: `doctor`
- Required Sub-fields:
  - `doctorName`
  - `practiceName`
  - `phoneNumber`


## 3. Metadata and Tracking (Tags)

Custom tags can be included via the `tags` variable array. These are key-value pairs used to attach metadata to a request (e.g., `order_id` or `internal_customer_id`).

**Benefit**: These tags are preserved in webhook payloads and query results, allowing you to easily reconcile requests with your internal systems.

## 4. Example Calls

#### Flow A: User Uploads Their Rx

Variables:


```json
{
    "patient":{
        "firstName": "Jane",
        "lastName": "Test",
        "dateOfBirth": "2000-01-01",
        "address": "207 E Ohio Street",
        "address2":"233",
        "city": "Chicago",
        "state": "IL",
        "zipCode":"60611",
        "email": "support@govisibly.com",
        "phoneNumber":"866-314-6941"
    },
    "fileId": "abcdefg",
    "products":{
        "right": {
            "baseCurve": "8.4",
            "diameter": "14.0",
            "productId": "29986",
            "sphere": "-3.75",
            "quantity": 1,
            "packageSize": 6
        },
        "left": {
            "baseCurve": "8.4",
            "diameter": "14.0",
            "productId": "29986",
            "sphere": "-3.75",
            "quantity": 1,
            "packageSize": 6
        }
    },
    "tags": [
    {
      "name": "orderId",
      "value": "123456"
    },
    {
      "name": "customerId",
      "value": "abcdefg"
    },
    {
      "name": "prescriptionId",
      "value": "01010101"
    }
  ]
}
```

#### Flow B: User Selects a Doctor from Database

Variables:


```json
{
    "patient":{
        "firstName": "Jane",
        "lastName": "Test",
        "dateOfBirth": "2000-01-01",
        "address": "207 E Ohio Street",
        "address2":"233",
        "city": "Chicago",
        "state": "IL",
        "zipCode":"60611",
        "email": "support@govisibly.com",
        "phoneNumber":"866-314-6941"
    },
    "doctor": {
        "doctorId":"abcdefg"
    },
    "products":{
        "right": {
            "baseCurve": "8.4",
            "diameter": "14.0",
            "productId": "29986",
            "sphere": "-3.75",
            "quantity": 1,
            "packageSize": 6
        },
        "left": {
            "baseCurve": "8.4",
            "diameter": "14.0",
            "productId": "29986",
            "sphere": "-3.75",
            "quantity": 1,
            "packageSize": 6
        }
    },
    "tags": [
    {
      "name": "orderId",
      "value": "123456"
    },
    {
      "name": "customerId",
      "value": "abcdefg"
    }
  ]
}
```

#### Flow C: User Provides Info Manually

Variables:


```json
{
    "patient":{
        "firstName": "Jane",
        "lastName": "Test",
        "dateOfBirth": "2000-01-01",
        "address": "207 E Ohio Street",
        "address2":"233",
        "city": "Chicago",
        "state": "IL",
        "zipCode":"60611",
        "email": "support@govisibly.com",
        "phoneNumber":"866-314-6941"
    },
    "doctor": {
        "doctorName": "Dr. Dwigt Rortugal",
        "practiceName": "Optimized EyeCare",
        "phoneNumber": "(866) 324-4880",
    },
    "products":{
        "right": {
            "baseCurve": "8.4",
            "diameter": "14.0",
            "productId": "29986",
            "sphere": "-3.75",
            "quantity": 1,
            "packageSize": 6
        },
        "left": {
            "baseCurve": "8.4",
            "diameter": "14.0",
            "productId": "29986",
            "sphere": "-3.75",
            "quantity": 1,
            "packageSize": 6
        }
    },
    "tags": [
    {
      "name": "orderId",
      "value": "123456"
    },
    {
      "name": "customerId",
      "value": "abcdefg"
    }
  ]
}
```

## Implementation Checklist:

- You can successfully submit a request for each of the three user flows (File, Database Doctor, and Manual Doctor).
- You receive and successfully capture a valid jobId in the response.


[Click here to see the verifyContactsPrescription GraphQL reference](/reference/visibly-api/mutations/verifyContactsPrescription)