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

# Confirm Blood Draw

> Record that blood has been drawn and trigger the lab order pipeline

Use this guide to confirm that a blood draw has taken place. Confirmation records the physical kit barcode and triggers the lab order pipeline, which processes results and eventually moves the appointment to `done` status.

<Warning>
  Confirmation is **irreversible**. Once you confirm a blood draw, no further modifications —
  including adding panels — can be made to the appointment. Make sure all panels are attached and
  all details are correct before proceeding.
</Warning>

<Steps>
  <Step title="Ensure panels are added">
    Before confirming, verify that all necessary test panels have been added to the appointment. You cannot add panels after confirmation.

    Review the [Schedule an Appointment](/guides/schedule-appointment) guide for instructions on attaching panels.

    Confirm the following before continuing:

    * All required panels are attached to the appointment.
    * The `profile_id` and `location_id` on the appointment are correct.
    * The patient has completed the blood draw and the kit barcode is available.
  </Step>

  <Step title="Confirm the blood draw">
    Send a `POST` request to `/api/v1/appointments/{id}/confirm` with the numeric barcode from the physical blood draw kit.

    <Warning>
      The `barcode` must be the numeric string printed on the physical blood draw kit provided to the patient. Do not substitute a different identifier — an incorrect barcode will cause the lab order to fail.
    </Warning>

    <CodeGroup>
      ```bash cURL theme={null}
      curl --request POST \
        --url https://anivahealth.com/api/v1/appointments/c9d4e827-3b6f-4a1c-8d2e-5f0b9c7e3a12/confirm \
        --header 'Content-Type: application/json' \
        --header 'x-api-key: YOUR_API_KEY' \
        --data '{
          "barcode": "1234567890"
        }'
      ```

      ```javascript JavaScript theme={null}
      const response = await fetch(
        'https://anivahealth.com/api/v1/appointments/c9d4e827-3b6f-4a1c-8d2e-5f0b9c7e3a12/confirm',
        {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
            'x-api-key': 'YOUR_API_KEY',
          },
          body: JSON.stringify({
            barcode: '1234567890',
          }),
        }
      );

      const result = await response.json();
      ```
    </CodeGroup>

    A successful request returns `200 OK`:

    ```json theme={null}
    {
      "success": true
    }
    ```
  </Step>

  <Step title="Verify appointment status">
    After confirmation, retrieve the appointment to verify its status has changed to `blood_drawn`.

    <CodeGroup>
      ```bash cURL theme={null}
      curl --request GET \
        --url https://anivahealth.com/api/v1/appointments/c9d4e827-3b6f-4a1c-8d2e-5f0b9c7e3a12 \
        --header 'x-api-key: YOUR_API_KEY'
      ```

      ```javascript JavaScript theme={null}
      const response = await fetch(
        'https://anivahealth.com/api/v1/appointments/c9d4e827-3b6f-4a1c-8d2e-5f0b9c7e3a12',
        {
          headers: {
            'x-api-key': 'YOUR_API_KEY',
          },
        }
      );

      const appointment = await response.json();
      console.log(appointment.status); // "blood_drawn"
      ```
    </CodeGroup>

    Once the appointment shows `status: "blood_drawn"`, the lab order pipeline has been triggered. The appointment status itself stays at `blood_drawn` from here on; finer-grained downstream progression is exposed via dedicated endpoints: follow each entry in the inline `shipments` array to [Get Shipment](/api/shipments/get-shipment) for courier in-transit / delivered events, and use [Get Results](/api/appointments/get-results) for lab result completion (`status: "in_progress"` → `"completed"`).
  </Step>
</Steps>

## What happens next

After confirmation, Aniva's lab order pipeline takes over:

1. The kit barcode is matched to the physical sample at the lab.
2. The panels attached to the appointment determine which tests are run.
3. When results are ready they're associated with the patient profile and surface in
   [Get Results](/api/appointments/get-results) — the response's top-level `status` field flips
   from `in_progress` to `completed` once every submission has arrived.

No further action is required from your integration after confirmation.

## Error handling

| Status            | Cause                                                                 | Resolution                                                                  |
| ----------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `400 Bad Request` | The `barcode` is missing or contains non-numeric characters.          | Check that you are passing the exact numeric barcode from the physical kit. |
| `403 Forbidden`   | Your API key does not have access to this operation.                  | Contact Aniva to confirm your API key permissions.                          |
| `404 Not Found`   | The appointment ID does not exist or does not belong to your account. | Verify the appointment ID is correct.                                       |
