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

# Order Pricing

> Stay on top of the latest marker and panel prices, and generate cost estimations for your order sets.

## Pricing APIs

Pricing data are included only on request. You can opt in via `include_pricing=true` in the request URL query.

| Catalog endpoints | Response |
| - | - |
| [Get Available Biomarkers](https://docs.junction.com/api-reference/lab-testing/biomarkers.md) `GET /v3/lab_tests/markers?include_pricing=true` | `pricing.data` is keyed by Junction marker ID. |
| [Get Available Tests](https://docs.junction.com/api-reference/lab-testing/tests-paginated.md) `GET /v3/lab_test?include_pricing=true` | `pricing.data` is keyed by lab test ID. Each entry contains the panel's `pricing` and, when applicable, a `marker_breakdown`. |

You can also generate cost estimation for order sets given a wider set of ordering parameters, including but not limited to billing type, priority (STAT) and US State.

| Endpoint | Response |
| - | - |
| [Estimate order set pricing](https://docs.junction.com/api-reference/lab-testing/estimate-order-set-pricing.md) `POST /v3/lab_test/estimate_order_set_pricing` | `data` contains one estimate for each submitted order set, in request order, with aggregate and component pricing. |

By default, all Pricing APIs assume the use of Junction platform [lab accounts](https://docs.junction.com/lab/overview/lab-accounts.md) and so the Junction lab compendium pricing would apply. To estimate order sets when
using alternative [lab accounts](https://docs.junction.com/lab/overview/lab-accounts.md), you must explicitly pass the respective `lab_account_id` to the API endpoints.

> [!NOTE]
>
> All pricing objects are **estimates** provided as is, and do not constitute a quote. The final charge can vary based on service conditions and order details.

## Sandbox pricing

The Sandbox environment uses fictional prices. The Dashboard displays these prices in the fictional currency `JUN`, while the API reports the currency as `USD`.

The decimal amount is identical in both: for example, a price displayed as `10.00 JUN` in the Dashboard is reported as `10.00 USD` by the API, encoded as `1000` in minor units.

> [!NOTE]
>
> Use the Dashboard production view or your production API Key to check the production pricing. Get in touch with your customer success manager for any further enquiries.

## Interpreting the pricing objects

A specified pricing object consists of a **base price**, and 0 or more additive modifiers.

The simplest pricing consists of only the base price:

```json theme={null}
{
  "base_amount_minor": 1000,
  "modifiers": []
}
```

This means the subject is always \$10.00 (1000 US cents). All amounts are encoded in the smallest denomination of the currency.

When the subject has multiple conditional prices, the pricing object will include one or more *additive* modifiers:

```json theme={null}
{
  "base_amount_minor": 1000,
  "modifiers": [
    {
      "delta_amount_minor": 250,
      "conditions": {
        "us_state": {
          "any_of": ["CA", "NY"]
        }
      }
    },
    {
      "delta_amount_minor": {
        "minimum": 500,
        "maximum": 900
      },
      "conditions": {
        "reflex": {}
      }
    }
  ]
}
```

### Calculating a price

**1. Start with `base_amount_minor`.**

**2. Select every modifier for which **all** conditions match.**

Conditions are additive and conjunctive.

For example, a modifier containing both `us_state` and `reflex` applies only when the state matches **and** reflex testing occurs.

When multiple independent modifiers match, add all of them.

> [!WARNING]
>
> You must ignore modifiers with unrecognized conditions, since Junction may add new conditions as we see fit.
>
> You can allowlist either by inspecting the keys in the modifier object, or by comparing
> the `keys` field if your language's serialization stack does not support said inspection.

> [!NOTE]
>
> Junction guarantees that there is never an overlap in US State groups across all modifiers (`conditions.us_state.any_of`).
>
> It is safe for you to simply match eligible modifiers by doing an inclusion check on
> `conditions.us_state.any_of` and the rest of the relevant conditions.

**3. Add each matching `delta_amount_minor` to the base amount.**

### Prices in integer and closed ranges

A modifier delta can be an integer (a flat price) or a closed range (the minimum and maximum possible prices). In the example above:

* The price in California or New York without reflex testing is \$12.50.
* The price in California or New York with reflex testing is between \$17.50 and \$21.50.
* The price in another state with reflex testing is between \$15.00 and \$19.00.

### Unspecified pricing

When Junction cannot provide a numeric price, the pricing object contains an `unspecified` field, instead of `base_amount_minor` and `modifiers`:

```json theme={null}
{
  "unspecified": "price_unavailable"
}
```

Do not interpret an unspecified price as zero. Display an appropriate fallback or refer to your Junction contract instead.


## Related topics

- [Lab Testing API changelog](https://docs.junction.com/changelog/lab-testing/api.md)
- [Estimate Order Set Pricing](https://docs.junction.com/api-reference/lab-testing/estimate-order-set-pricing.md)
- [Get Markers For Order Set](https://docs.junction.com/api-reference/lab-testing/order-set-marker.md)
- [Lab Test Versioning](https://docs.junction.com/lab/workflow/lab-test-versioning.md)
- [Creating a Lab Test](https://docs.junction.com/lab/workflow/create-test.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.