> ## 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

> Configure patient insurance and place lab test orders with commercial insurance billing.

Junction supports lab test orders billed to commercial insurance. Availability depends on the lab account, patient state, and tests selected for the order.

## Commercial insurance workflow

Complete these steps in order:

1. [Create a user](/api-reference/user/create-user), or use an existing user, and ensure the user has patient demographics. Creating a user establishes the Junction user ID but does not create the demographics required for insurance. Use [Update User Demographics](/api-reference/user/upsert-info) to add or update them.
2. [Check insurance availability](#check-insurance-availability) for the intended lab account and patient state.
3. [Create insurance for the user](/api-reference/user/create-insurance). Junction associates the insurance with that user's demographics.
4. [Create the order](/api-reference/lab-testing/create-order) for the same user with `billing_type` set to `commercial_insurance` and valid diagnosis codes in `icd_codes`.

<Note>
  Create the user's insurance before creating the order. `is_primary` defaults to `true`, and Junction uses the user's most recently created primary insurance record for commercial insurance ordering. When the insurance details change, create a new primary insurance record before placing another order.
</Note>

## Create user insurance

Use [`POST /v2/user/{user_id}/insurance`](/api-reference/user/create-insurance) to create an insurance record. The endpoint creates a new record; it does not update an existing one. The user must already have demographics, including an address, because Junction links the insurance to that patient record.

Insurance details can change over time. Keep the user's insurance current to reduce the risk of a denied claim.

```json theme={null}
{
  "payor_code": "UNITE",
  "member_id": "123456789",
  "group_id": "123",
  "relationship": "Self",
  "insured": {
    "first_name": "John",
    "last_name": "Doe",
    "dob": "1999-01-01",
    "gender": "Male",
    "address": {
      "first_line": "123 Main Street",
      "second_line": null,
      "zip_code": "85004",
      "state": "AZ",
      "city": "Phoenix"
    },
    "phone_number": "+16025550123",
    "email": "john@example.com"
  },
  "is_primary": true
}
```

`group_id`, `second_line`, and `guarantor` are optional. A `guarantor` is required when `relationship` is not `Self`.

### Insured, guarantor, and relationship

The `insured` object identifies the person covered by the insurance plan and is always required. The `relationship` value describes the patient's relationship to the policyholder and accepts `Self`, `Spouse`, or `Other`.

When `relationship` is not `Self`, provide the financially responsible party in `guarantor`. If you provide a guarantor when `relationship` is `Self`, Junction stores it, but some lab partners may not accept it.

### Payor code

Partner labs use different identifiers for insurance companies. Junction standardizes these identifiers so you can use one Junction `payor_code` across supported labs.

Use [Search Payor Code](/api-reference/lab-testing/insurance/search-payor-get) to find the insurance company and use the returned `payor_code` when creating insurance. You can search by insurance company name or by a supported external provider's payor code, such as Change Healthcare or Availity.

<Note>
  [Contact Junction Customer Support](/home/getting-support#getting-support) for assistance if the payor information you need is missing.
</Note>

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

## Check insurance availability

Not every lab account, state, or test supports commercial insurance. Review the [billing types configured for the lab account](/lab/overview/lab-accounts#billing-types), then call [Area Info](/api-reference/lab-testing/area-info) for the patient's zip code and confirm that the intended lab includes `commercial_insurance` in `supported_bill_types`.

If you intend to use a specific lab account, pass its `lab_account_id` to Area Info and provide the same [`lab_account_id`](/api-reference/lab-testing/create-order#body-lab-account-id-one-of-0) when creating the order. This ensures the availability check uses that account's billing configuration.

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

## Create the order

Create the order for the same `user_id` used to create the insurance. Include all fields required for a standard order, then set:

```json theme={null}
{
  "billing_type": "commercial_insurance",
  "icd_codes": ["<diagnosis_code>"]
}
```

### Billing type

Orders use `client_bill` by default. Set `billing_type` to `commercial_insurance` to use the user's latest primary insurance record.

### Diagnosis codes

Commercial insurance orders require at least one valid diagnosis code. Use [Search ICD Code](/api-reference/lab-testing/insurance/search-diagnosis) to find supported codes.

## Common errors

Junction rejects a commercial insurance order when:

* The selected lab account does not support `commercial_insurance`.
* The patient's state does not support commercial insurance for the selected lab account.
* The selected test or one of its markers is not available for commercial insurance in the patient's state.
* `icd_codes` is missing or contains an invalid diagnosis code.
* The user does not have patient demographics or a primary insurance record.

## Medicare and Medicaid location inference

<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>

The closed beta can infer the appropriate Medicare or Medicaid plan from the patient's address when you [create user insurance on the beta channel](/api-reference/user/create-insurance-beta):

* Use `MEDFED` for Medicare.
* Use `MAIDFED` for Medicaid.

For example, submitting `MEDFED` for a patient who lives in Arizona creates the insurance record with the applicable Arizona Medicare plan payor code.

This beta applies only to Medicare and Medicaid location inference. It does not apply to commercial insurance ordering as a whole.


## Related topics

- [Lab Accounts](/lab/overview/lab-accounts.md)
- [Create user insurance](/api-reference/user/create-insurance-beta.md)
- [Get latest insurance](/api-reference/user/get-latest-insurance.md)
- [Ordering Idempotency](/lab/overview/idempotency.md)
- [Get search payor](/api-reference/lab-testing/insurance/search-payor-get.md)
