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

# Quote

> Submits a list of product `code`s plus a `patientId` and returns the authoritative, best-deal-optimized price — after running an eligibility check for the patient. Always quote before ordering: catalog `price` is only indicative.

An ineligible order still returns `200`, with `eligible: false` and every failing reason so you can fix them.

Every `code` you send is returned in `lineItems` — priced individually or covered by a bundle. If any code cannot be priced the whole quote fails with `422`, naming it in `errorCodes`; a partial quote is never returned. 🚧 Working in progress — unpriceable codes are currently dropped and the quote still returns `200`.

Returns the authoritative, best-deal price and an eligibility result for a set of product `code`s and
a patient. Always quote before ordering. An ineligible order returns `200` with `eligible: false` and
the failing reasons — see [Orders](https://developers.vibrant-wellness.com/concepts/orders.md#eligibility-failures).

## Every code is priced, or none is

Each `code` you send comes back in `lineItems` — priced on its own line, or listed in a bundle's
`coveredCodes`. If any code cannot be priced, the whole quote fails with `422` and names it in
`errorCodes`. You never receive a partial quote whose `total` quietly under-reports.

> [!NOTE]
>
> 🚧 **Working in progress** — a code that cannot be priced is currently dropped from `lineItems`
> and the quote still returns `200` with a lower `total`. Check that every code you sent came back
> before showing the price to a patient.

> [!NOTE]
>
> **Best-deal scope (v1):** the quote guarantees the cheapest official-bundle combination (ordering
> `GUT_ZOOMER` + `VITD_25OH` together is priced as the bundle). Other promotions — x-choose-y,
> seasonal, conditional discounts — are not yet folded in, and `total` excludes shipping, tax, and
> markup.


## OpenAPI

````yaml POST /quote
openapi: 3.1.0
info:
  title: Vibrant Wellness Portal API
  version: 2026-07-01-draft
  description: >-
    Order lab tests and retrieve results programmatically. Authenticate once
    with OAuth2 client credentials, browse the catalog, quote and
    eligibility-check an order, create patients, place orders, and pull results
    with their report status and issues.


    This reference documents the target external contract (v1).
  contact:
    name: Vibrant Wellness Developer Support
    email: portal-api@vibrant-wellness.com
    url: https://developers.vibrant-wellness.com
  license:
    name: Proprietary
servers:
  - url: https://api.vibrant-america.com/v1
    description: Production
  - url: https://api-sandbox.vibrant-america.com/v1
    description: Staging (sandbox)
security:
  - oauth2: []
tags:
  - name: Catalog
    description: Browse orderable tests and panels.
  - name: Pricing
    description: Get an authoritative price and eligibility check before ordering.
  - name: Patients
    description: Create patients.
  - name: Orders
    description: Place lab orders.
  - name: Reports
    description: Retrieve results, report status, and issues.
paths:
  /quote:
    post:
      tags:
        - Pricing
      summary: Get a price quote
      description: >-
        Submits a list of product `code`s plus a `patientId` and returns the
        authoritative, best-deal-optimized price — after running an eligibility
        check for the patient. Always quote before ordering: catalog `price` is
        only indicative.


        An ineligible order still returns `200`, with `eligible: false` and
        every failing reason so you can fix them.


        Every `code` you send is returned in `lineItems` — priced individually
        or covered by a bundle. If any code cannot be priced the whole quote
        fails with `422`, naming it in `errorCodes`; a partial quote is never
        returned. 🚧 Working in progress — unpriceable codes are currently
        dropped and the quote still returns `200`.
      operationId: createQuote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuoteRequest'
            example:
              patientId: 477769
              testCodes:
                - GUT_ZOOMER
                - VITD_25OH
      responses:
        '200':
          description: Eligible quote, or an ineligible result with failing reasons.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/QuoteResult'
                  - $ref: '#/components/schemas/QuoteIneligible'
              examples:
                eligible:
                  summary: Eligible
                  value:
                    quoteId: qte_01HZ7M3K2N8R9Q
                    currency: usd
                    eligible: true
                    lineItems:
                      - itemType: bundle
                        name: Gut Zoomer + Vitamin D Bundle
                        price: 800
                        coveredCodes:
                          - GUT_ZOOMER
                          - VITD_25OH
                    bestDealPrice: 800
                    total: 800
                ineligible:
                  summary: Ineligible
                  value:
                    eligible: false
                    failures:
                      - code: IncompletePatientInfo
                        reason: >-
                          patient 123456 is missing required information:
                          address
              example:
                quoteId: Q-1784681889178172779
                currency: usd
                eligible: true
                isDbs: false
                lineItems:
                  - code: GUT_ZOOMER
                    itemType: test
                    name: Gut Zoomer 5.0
                    price: 550
                bestDealPrice: 550
                total: 550
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: One or more codes could not be priced. No partial quote is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderProblem'
              example:
                status: rejected
                reason: no_orderable_items
                errorCodes:
                  - APOE_SALIVA
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/DependencyUnavailable'
components:
  schemas:
    QuoteRequest:
      type: object
      required:
        - patientId
        - testCodes
      properties:
        patientId:
          type: integer
          example: 477769
          description: Id of the patient to quote for.
        testCodes:
          type: array
          items:
            type: string
          example:
            - GUT_ZOOMER
            - VITD_25OH
          description: Product `code`s to quote (from the catalog).
    QuoteResult:
      type: object
      description: Eligible quote.
      properties:
        quoteId:
          type: string
          description: Price reference for this quote.
        currency:
          type: string
        eligible:
          type: boolean
          enum:
            - true
        isDbs:
          type: boolean
          description: Whether this is a dried blood spot (DBS) quote.
          example: false
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/QuoteLineItem'
        bestDealPrice:
          type: number
          description: Best-deal-optimized subtotal (official-bundle cheapest combo; v1).
        total:
          type: number
          description: >-
            Order total. v1: equals bestDealPrice — shipping, tax, and markup
            excluded (roadmap).
    QuoteIneligible:
      type: object
      description: Order cannot be placed as submitted.
      properties:
        eligible:
          type: boolean
          enum:
            - false
        failures:
          type: array
          items:
            $ref: '#/components/schemas/EligibilityFailure'
    OrderProblem:
      type: object
      description: Order understood but not placed. Nothing charged.
      properties:
        status:
          type: string
          enum:
            - ineligible
            - rejected
        failures:
          type: array
          items:
            $ref: '#/components/schemas/EligibilityFailure'
          description: One entry per failed eligibility rule (status = ineligible).
        reason:
          type: string
          description: >-
            Build-failure reason, e.g. `unrecognized_test_codes` or
            `provider_scope_mismatch` (status = rejected).
        errorCodes:
          type: array
          items:
            type: string
          description: Unrecognized test codes, when applicable (status = rejected).
    QuoteLineItem:
      type: object
      properties:
        code:
          type: string
          description: Product code (present for individually-priced items).
        itemType:
          type: string
          enum:
            - test
            - bundle
          description: Whether this line is a single test or a bundle.
        name:
          type: string
        price:
          type: number
        coveredCodes:
          type: array
          items:
            type: string
          description: For a bundle, the codes folded into it.
      example:
        code: GUT_ZOOMER
        itemType: test
        name: Gut Zoomer 5.0
        price: 550
    EligibilityFailure:
      type: object
      properties:
        code:
          type: string
          description: >-
            Machine-readable reason. Non-exhaustive — tolerate unknown future
            codes and fall back to `reason`.
          enum:
            - PatientNotFound
            - CustomerNotFound
            - PatientNotInClinic
            - IncompletePatientInfo
            - ProzFollowupNoPreviousOrder
            - SkincareFollowupNoPreviousOrder
            - GeneticTestAlreadyOrdered
            - PFSAMaleOnly
          example: IncompletePatientInfo
        reason:
          type: string
          example: 'patient 123456 is missing required information: address'
    Error:
      type: object
      description: >-
        🚧 Working in progress — this envelope is the contract; not yet returned
        by every endpoint.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Stable machine-readable error code.
            message:
              type: string
              description: Human-readable explanation.
            requestId:
              type: string
              description: >-
                Identifier for this request. Include it when contacting support.
                Also returned on every response as the X-Request-Id header.
              example: req_01JQ8ZC5X9K2MN
            details:
              type: array
              items:
                type: object
                additionalProperties: true
              description: Optional structured context.
          required:
            - code
            - message
            - requestId
  responses:
    BadRequest:
      description: The request was invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request
              message: One or more testCodes were not recognized.
              requestId: req_01JQ8ZC5X9K2MN
              details:
                - unknownCodes:
                    - FOO_BAR
    Unauthorized:
      description: Not authenticated. See Authentication.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Not authenticated.
              requestId: req_01JQ8ZC5X9K2MN
    InternalError:
      description: >-
        Something went wrong on our side. Safe to retry (idempotent endpoints:
        reuse the same placerId).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: internal_error
              message: Unexpected error.
              requestId: req_01JQ8ZC5X9K2MN
    DependencyUnavailable:
      description: A downstream dependency was unreachable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: dependency_unavailable
              message: Eligibility service unavailable; no quote produced.
              requestId: req_01JQ8ZC5X9K2MN
  securitySchemes:
    oauth2:
      type: oauth2
      description: >-
        OAuth2 client credentials. Generate a client ID and client secret in the
        Portal, exchange them for an access token, then send `Authorization:
        Bearer <access_token>`. Request the `result` and `report` scopes to read
        results.
      flows:
        clientCredentials:
          tokenUrl: https://api.vibrant-america.com/v1/oauth2/token
          scopes:
            result: Read finalized lab results
            report: Read report status and issues

````

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