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

# Insurance Ordering

> Set up and place lab test orders with commercial insurance billing, including Medicare and Medicaid inference support.

<Card horizontal icon="person-digging" color="#57164A">
  This feature is in **closed beta**.

  Interested in this feature? Get in touch with your Customer Success Manager.
</Card>

Junction supports ordering with commercial insurance billing. To set this up, there are a set of steps required. This document explains the complete flow for ordering via commercial insurance.

## Setting Insurance Data

<Note>
  **Medicare and Medicaid location inference closed beta**

  If the patient is covered by Medicare or Medicaid, we have closed beta support for inferring the plan to use based on the patient's address. This endpoint supports `payor_code` values of `MEDFED` (Medicare) and
  `MAIDFED` (Medicaid) to do this.

  For example, supplying a `payor_code` of `MEDFED` for a patient that lives in Arizona will create insurance data using Arizona's Medicare plan payor code.

  Medicare and Medicaid location inference is in closed beta. Get in touch with your Customer Success Manager for more information or check out the [API docs](/api-reference/user/create-insurance) on the beta channel.
</Note>

To place an order for a `user` in Junction with commercial insurance, you must first provide Junction with insurance data.

This can be done via the [`POST /{user_id}/insurance`](/api-reference/user/create-insurance) endpoint, with the following payload:

<Note>
  Note that you can only set insurance data for users that already have patient information set, either via an order or via the [`PATCH /v2/user/{user_id}/info`](/api-reference/user/upsert-info).
</Note>

It is expected that insurance data will become outdated or change with time. It is the customer's responsibility to update this data with Junction in order to minimize the risk of a denied claim.

```json theme={null}
"insurance": {
    "payor_code": "string",
    "member_id": "string",
    "group_id": "string", // optional
    "relationship": "Self, Spouse, Other",
    "insured": {
        "first_name": "string",
        "last_name": "string",
        "dob": "YYYY-MM-DD",
        "gender": "string",
        "address": {
            "first_line": "string", 
            "second_line": "string", // optional
            "zip_code": "string",
            "state": "string",
            "city": "string",
        },
        "phone_number": "string",
        "email": "string"
    },
    "guarantor": {
        "first_name": "string",
        "last_name": "string",
        "dob": "YYYY-MM-DD",
        "gender": "string",
        "address": {
            "first_line": "string", 
            "second_line": "string", // optional
            "zip_code": "string",
            "state": "string",
            "city": "string",
        },
        "phone_number": "string",
        "email": "string",
    } // optional if relationship is Self
}
```

### Insured, Guarantor and Relationship

First, let's understand the `relationship`, `insured` and `guarantor` fields.

`insured` refers to the insured person, and must always be provided. The `relationship` field is the relationship between the patient and the holder of the insurance.
For example, if the insured person and the insurance holder are the same, then the relationship is `Self`.

The `guarantor` is an optional field, that must be provided when the relationship is **NOT** `Self`. The guarantor is the financially responsible party. If provided when the relationship is `Self`, we will store it, but it may not be propagated to all lab partners, as not all partners accept a guarantor in this situation.

### Payor Code

The `payor_code` is a lab-specific identifier for an insurance company. Junction has abstracted this away into our own Junction payor codes, allowing customers to supply one lab-agnostic payor code for all labs.

To obtain this code, use the [Search Payor Code](/api-reference/lab-testing/insurance/search-payor-get) endpoint, using the insurance company name, and select the `code` from your insurance company.

It is also possible to use this endpoint to search using external providers' payor codes (e.g., Change Healthcare or Availity).

```json theme={null}
[
  {
    "code": "AARPA",
    "name": "AARP",
    "aliases": [
      "AARP"
    ],
    "org_address": {
      "first_line": "PO BOX 740819",
      "second_line": null,
      "country": "US",
      "zip": "30374",
      "city": "ATLANTA",
      "state": "GA"
    }
  },
]
```

## Ordering

Once the above steps are complete, you can place an order as usual, with two differences.

In order to trigger the commercial insurance flow, you must supply the following extra fields in the [POST /order](/api-reference/lab-testing/create-order) payload:

```json theme={null}
{
	"icd_codes": ["ICD.10"], 
	"billing_type": "commercial_insurance" 
}
```

### Billing type

By default, Junction orders are Client Bill. In order to trigger the insurance flow, you must supply the `billing_type` field, with `commercial_insurance`.

### Diagnosis Codes

Insurance orders require diagnosis codes to be supplied. You can search for diagnosis codes in our [Search ICD Code](/api-reference/lab-testing/insurance/search-diagnosis) endpoint.

## Insurance Availability

Not all labs and not all states are cleared for insurance ordering. You can verify if a zip code is served for insurance via the [`GET /v3/order/area/info`](/api-reference/lab-testing/area-info) endpoint.

If a particular lab supports insurance, then you should see `commercial_insurance` in the supported bill types.

```json theme={null}
{
  "zip_code": "85007",
  "central_labs": {
    "labcorp": {
      "patient_service_centers": {
        "within_radius": 15,
        "radius": "25"
      },
      "supported_bill_types": [
        "commercial_insurance"
      ]
    },
    ...
  }
}
```

## Error Cases

1. Order with `commercial_insurance` billing for a lab that does not support it.
2. Order with `commercial_insurance` billing for a state that does not support it.
3. Order with `commercial_insurance` billing and no ICD codes or invalid ICD codes provided.
4. Order with `commercial_insurance` billing and the user has no insurance data.
