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

# Check a test member's medication cost with a test insurer

> The Sandbox's pharmacy benefit check: the same operation as `/v1/fhir/r4/$process-message`, at the Sandbox's FHIR base, `/v1/sandbox/fhir/r4`, where Example Health Plan, a test insurer, answers the CARIN Consumer Real-Time Pharmacy Benefit Check (STU2 ballot, `2.0.0-ballot`) as a payer would, with synthetic data. Every organization may call it on every plan, and each request counts like any other. POST a FHIR `Bundle` of type `message` whose first entry is a MessageHeader with the event `rtpbc-request`: a member's request, with the member's Patient and Coverage, the prescription and its prescriber, and a pharmacy. A request is read by the same rules as Pharmacy Benefits' member's request. The member must be one of the test insurer's test members, named by member ID in `Coverage.subscriberId`, the Coverage's `rxid` class, or a Patient identifier whose system is `https://example-health-plan.test/member-id`; a request for anyone else is answered the error `no-test-member` and nothing else. Send test members only, never a real person. Each medication in the test insurer's formulary table always gets the same answer, by its RxNorm code or NDC: priced with a copay, covered at $0 with an alternative, not covered with an alternative, prior authorization required, or a quantity limit. Any other medication gets a default priced answer, and one test member's requests are always declined, `insurer-declined`. Both errors are coded from `https://haau3.com/fhir/CodeSystem/sandbox-error` in `ClaimResponse.error`. The answer is a `message` Bundle whose MessageHeader answers the request's, with one ClaimResponse naming the insurer by its Payer ID, `SANDBOX-EHP`, and the request's Patient as it was sent, a test member's labelled `HTEST`; a process note says which test member and formulary row answered. Amounts are fixed, whatever the quantity. Nothing a request carries is stored or logged, and every answer is sent with `Cache-Control: no-store`. The operation takes no query parameters. The test members and the formulary table are at https://docs.haau3.com/sandbox/example-health-plan.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/sandbox/fhir/r4/$process-message
openapi: 3.1.0
info:
  title: haau3 Platform API
  version: 1.0.0-preview.23
  description: >-
    The haau3 platform API is in preview: it may change as we build, usually to
    add features or improve performance. Endpoints require an API key, sent as
    `Authorization: Bearer <key>`. Requests without a valid key return 401.
    Create a key in the dashboard at https://platform.haau3.com; a new
    organization starts on the free Developer plan. From 2026-11-02 a request
    past one of its plan's limits (requests a minute on every plan, requests a
    month on Developer) returns 429 with `Retry-After`. Every error under
    `/v1/fhir` is a FHIR `OperationOutcome` and every other error an RFC 9457
    problem; https://docs.haau3.com/errors lists every status, whether to retry
    it, and what a method a path does not take answers.
servers:
  - url: https://api.haau3.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Scheduling
    description: 'Provider availability (SMART Scheduling Links): slots and publishers.'
  - name: FHIR base
    description: >-
      What the FHIR R4 base at `/v1/fhir/r4` answers for every service on it:
      the `CapabilityStatement` that lists them all, and batch Bundles that
      carry several requests to any of them in one round trip.
  - name: Terminology
    description: >-
      FHIR terminology operations over the code systems listed in
      TerminologyCapabilities. Some are resolved from their own source when you
      ask; others are held here at a named release, which that resource also
      names.
  - name: Provider directory
    description: >-
      CMS's National Provider Directory as FHIR R4: practitioners and their
      roles, organizations, payers and insurance networks, network membership,
      healthcare services, locations and endpoints. Every parameter the service
      serves is declared here, and any other is refused by name rather than
      ignored.
  - name: Questionnaires
    description: >-
      FHIR Questionnaire, served as its source publishes it. This service holds
      copies of a curated set and reaches any other questionnaire its source
      publishes by canonical URL, as well as forms published at their own
      address under places this service is set up to reach. Read one by id, and
      build the QuestionnaireResponse in your own application.
  - name: Medical Benefits
    description: >-
      FHIR InsurancePlan: what a Medicare Advantage or ACA Marketplace plan
      covers and what a member pays, read from the files CMS publishes. Every
      plan names the CMS release it was read from. Read a plan by its id, or
      search by identifier, name, state or county, and check whether the CMS
      National Provider Directory lists providers in a plan's network.
  - name: Pharmacy Benefits
    description: >-
      The CARIN Consumer Real-Time Pharmacy Benefit Check as FHIR messaging:
      what a medication would cost a member under their coverage, or its price
      at pharmacies near a ZIP code, in real time, from the sources this service
      connects to. A member's request receives patient data, so send it only
      under an executed agreement.
  - name: MedList
    description: >-
      One reconciled medication list from one patient's FHIR medication records,
      as US Core MedicationRequests with a Provenance for each. This operation
      receives patient data, so send it only under an executed agreement.
  - name: Structured Sig
    description: >-
      A prescription's free-text directions as a FHIR Dosage: the dose, unit,
      route, method and timing coded in SNOMED CT, NCIt and UCUM where the words
      support them, the directions kept verbatim, and a review flag on anything
      a person should check. It takes the directions and the medication's
      codings, never a patient.
  - name: Sandbox
    description: >-
      The FHIR base without production behind it, to build and test against: the
      same paths at `/v1/sandbox/fhir/r4`, answered with synthetic data that
      always gives the same answer. Its first service is the CARIN Consumer
      Real-Time Pharmacy Benefit Check, answered by Example Health Plan, a test
      insurer. It takes a test key (`haau3_sk_test_…`), made on the API keys
      page, and each request counts like any other. Send test members only,
      never a real person.
paths:
  /v1/sandbox/fhir/r4/$process-message:
    post:
      tags:
        - Sandbox
      summary: Check a test member's medication cost with a test insurer
      description: >-
        The Sandbox's pharmacy benefit check: the same operation as
        `/v1/fhir/r4/$process-message`, at the Sandbox's FHIR base,
        `/v1/sandbox/fhir/r4`, where Example Health Plan, a test insurer,
        answers the CARIN Consumer Real-Time Pharmacy Benefit Check (STU2
        ballot, `2.0.0-ballot`) as a payer would, with synthetic data. Every
        organization may call it on every plan, and each request counts like any
        other. POST a FHIR `Bundle` of type `message` whose first entry is a
        MessageHeader with the event `rtpbc-request`: a member's request, with
        the member's Patient and Coverage, the prescription and its prescriber,
        and a pharmacy. A request is read by the same rules as Pharmacy
        Benefits' member's request. The member must be one of the test insurer's
        test members, named by member ID in `Coverage.subscriberId`, the
        Coverage's `rxid` class, or a Patient identifier whose system is
        `https://example-health-plan.test/member-id`; a request for anyone else
        is answered the error `no-test-member` and nothing else. Send test
        members only, never a real person. Each medication in the test insurer's
        formulary table always gets the same answer, by its RxNorm code or NDC:
        priced with a copay, covered at $0 with an alternative, not covered with
        an alternative, prior authorization required, or a quantity limit. Any
        other medication gets a default priced answer, and one test member's
        requests are always declined, `insurer-declined`. Both errors are coded
        from `https://haau3.com/fhir/CodeSystem/sandbox-error` in
        `ClaimResponse.error`. The answer is a `message` Bundle whose
        MessageHeader answers the request's, with one ClaimResponse naming the
        insurer by its Payer ID, `SANDBOX-EHP`, and the request's Patient as it
        was sent, a test member's labelled `HTEST`; a process note says which
        test member and formulary row answered. Amounts are fixed, whatever the
        quantity. Nothing a request carries is stored or logged, and every
        answer is sent with `Cache-Control: no-store`. The operation takes no
        query parameters. The test members and the formulary table are at
        https://docs.haau3.com/sandbox/example-health-plan.
      operationId: sandboxProcessMessage
      parameters:
        - $ref: '#/components/parameters/XRequestId'
      requestBody:
        required: true
        content:
          application/fhir+json:
            schema:
              $ref: '#/components/schemas/Bundle'
            examples:
              A test member's pharmacy benefit check:
                summary: A test member's pharmacy benefit check
                value:
                  resourceType: Bundle
                  id: sandbox-mei-lin-priced
                  meta:
                    profile:
                      - >-
                        http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-request-bundle|2.0.0-ballot
                    security:
                      - code: HTEST
                        system: http://terminology.hl7.org/CodeSystem/v3-ActReason
                        display: test health data
                  entry:
                    - fullUrl: https://app.example.test/fhir/MessageHeader/phi-request
                      resource:
                        resourceType: MessageHeader
                        id: phi-request
                        meta:
                          profile:
                            - >-
                              http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-request-messageheader|2.0.0-ballot
                          security:
                            - code: HTEST
                              system: >-
                                http://terminology.hl7.org/CodeSystem/v3-ActReason
                              display: test health data
                        source:
                          name: Example app
                          endpoint: https://app.example.test
                        focus:
                          - reference: Claim/phi-claim
                        eventCoding:
                          code: rtpbc-request
                          system: >-
                            http://hl7.org/fhir/us/carin-rtpbc/CodeSystem/rtpbc-event-type
                          display: RTPBC Request
                        definition: >-
                          http://hl7.org/fhir/us/carin-rtpbc/MessageDefinition/rtpbc-request
                    - fullUrl: https://app.example.test/fhir/Claim/phi-claim
                      resource:
                        resourceType: Claim
                        id: phi-claim
                        meta:
                          profile:
                            - >-
                              http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-request-claim|2.0.0-ballot
                          security:
                            - code: HTEST
                              system: >-
                                http://terminology.hl7.org/CodeSystem/v3-ActReason
                              display: test health data
                        identifier:
                          - value: sandbox-mei-lin-priced
                        patient:
                          reference: Patient/phi-patient
                        provider:
                          reference: Organization/phi-pharmacy
                        prescription:
                          reference: MedicationRequest/phi-prescription
                        careTeam:
                          - provider:
                              reference: Practitioner/phi-prescriber
                            sequence: 1
                        insurance:
                          - coverage:
                              reference: Coverage/phi-coverage
                            sequence: 1
                            focal: true
                        item:
                          - careTeamSequence:
                              - 1
                            productOrService:
                              coding:
                                - system: http://www.nlm.nih.gov/research/umls/rxnorm
                                  code: '311354'
                                  display: lisinopril 5 MG Oral Tablet
                            quantity:
                              value: 30
                              unit: '{Each}'
                              system: http://unitsofmeasure.org
                              code: '{Each}'
                            sequence: 1
                        status: active
                        type:
                          coding:
                            - code: pharmacy
                              system: http://terminology.hl7.org/CodeSystem/claim-type
                              display: Pharmacy
                        use: predetermination
                        created: '2026-10-20T14:00:00Z'
                        priority:
                          coding:
                            - code: normal
                              system: >-
                                http://terminology.hl7.org/CodeSystem/processpriority
                              display: Normal
                    - fullUrl: https://app.example.test/fhir/Patient/phi-patient
                      resource:
                        resourceType: Patient
                        id: phi-patient
                        meta:
                          profile:
                            - >-
                              http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-patient|2.0.0-ballot
                          security:
                            - code: HTEST
                              system: >-
                                http://terminology.hl7.org/CodeSystem/v3-ActReason
                              display: test health data
                        identifier:
                          - system: https://app.example.test/patients
                            value: example-0001
                          - system: https://example-health-plan.test/member-id
                            value: EX0000001
                        name:
                          - given:
                              - Mei
                            family: Lin
                        gender: female
                        birthDate: '1958-03-14'
                    - fullUrl: https://app.example.test/fhir/Coverage/phi-coverage
                      resource:
                        resourceType: Coverage
                        id: phi-coverage
                        meta:
                          profile:
                            - >-
                              http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-coverage|2.0.0-ballot
                          security:
                            - code: HTEST
                              system: >-
                                http://terminology.hl7.org/CodeSystem/v3-ActReason
                              display: test health data
                        beneficiary:
                          reference: Patient/phi-patient
                        payor:
                          - identifier:
                              type:
                                coding:
                                  - system: >-
                                      http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType
                                    code: payerid
                              system: https://payers.example.test
                              value: SANDBOX-EHP
                            display: Example Health Plan
                        class:
                          - type:
                              coding:
                                - code: rxbin
                                  system: >-
                                    http://terminology.hl7.org/CodeSystem/coverage-class
                            value: '000000'
                          - type:
                              coding:
                                - code: rxpcn
                                  system: >-
                                    http://terminology.hl7.org/CodeSystem/coverage-class
                            value: EXAMPLE
                          - type:
                              coding:
                                - code: rxgroup
                                  system: >-
                                    http://terminology.hl7.org/CodeSystem/coverage-class
                            value: EXGROUP01
                          - type:
                              coding:
                                - code: rxid
                                  system: >-
                                    http://terminology.hl7.org/CodeSystem/coverage-class
                            value: EX0000001
                        status: active
                        subscriberId: EX0000001
                        relationship:
                          coding:
                            - code: self
                              system: >-
                                http://terminology.hl7.org/CodeSystem/subscriber-relationship
                    - fullUrl: >-
                        https://app.example.test/fhir/MedicationRequest/phi-prescription
                      resource:
                        resourceType: MedicationRequest
                        id: phi-prescription
                        meta:
                          profile:
                            - >-
                              http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-medicationrequest|2.0.0-ballot
                          security:
                            - code: HTEST
                              system: >-
                                http://terminology.hl7.org/CodeSystem/v3-ActReason
                              display: test health data
                        medicationCodeableConcept:
                          coding:
                            - system: http://www.nlm.nih.gov/research/umls/rxnorm
                              code: '311354'
                              display: lisinopril 5 MG Oral Tablet
                        subject:
                          reference: Patient/phi-patient
                        requester:
                          reference: Practitioner/phi-prescriber
                        dispenseRequest:
                          quantity:
                            value: 30
                            unit: '{Each}'
                            system: http://unitsofmeasure.org
                            code: '{Each}'
                          expectedSupplyDuration:
                            value: 30
                            unit: days
                            system: http://unitsofmeasure.org
                            code: d
                          performer:
                            reference: Organization/phi-pharmacy
                        substitution:
                          allowedBoolean: true
                        status: draft
                        intent: proposal
                        authoredOn: '2026-10-20'
                    - fullUrl: >-
                        https://app.example.test/fhir/Practitioner/phi-prescriber
                      resource:
                        resourceType: Practitioner
                        id: phi-prescriber
                        meta:
                          profile:
                            - >-
                              http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner|8.0.1
                          security:
                            - code: HTEST
                              system: >-
                                http://terminology.hl7.org/CodeSystem/v3-ActReason
                              display: test health data
                        identifier:
                          - system: http://hl7.org/fhir/sid/us-npi
                            value: '2900000011'
                        name:
                          - given:
                              - Ada
                            suffix:
                              - MD
                            family: Okafor
                    - fullUrl: https://app.example.test/fhir/Organization/phi-pharmacy
                      resource:
                        resourceType: Organization
                        id: phi-pharmacy
                        meta:
                          profile:
                            - >-
                              http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-pharmacy-organization|2.0.0-ballot
                          security:
                            - code: HTEST
                              system: >-
                                http://terminology.hl7.org/CodeSystem/v3-ActReason
                              display: test health data
                        identifier:
                          - system: http://hl7.org/fhir/sid/us-npi
                            value: '2900000003'
                        type:
                          - coding:
                              - code: R
                                system: >-
                                  http://terminology.hl7.org/CodeSystem/NCPDPPharmacyType
                                display: Retail
                        telecom:
                          - system: phone
                            value: 305-555-0100
                        address:
                          - line:
                              - 100 Example Street
                            city: Miami
                            state: FL
                            postalCode: '33131'
                            country: US
                        active: true
                        name: Example Pharmacy
                  type: message
                  timestamp: '2026-10-20T14:00:00Z'
      responses:
        '200':
          description: >-
            The answer: a FHIR `Bundle` of type `message` with a MessageHeader,
            one ClaimResponse and the request's Patient, returned as the
            response body itself. The ClaimResponse carries the formulary
            table's answer in `item` and any alternative in `addItem`, or
            `no-test-member` or `insurer-declined` in `error`.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/Bundle'
              examples:
                Priced with a copay:
                  summary: Priced with a copay
                  value:
                    resourceType: Bundle
                    meta:
                      profile:
                        - >-
                          http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-response-bundle|2.0.0-ballot
                    type: message
                    timestamp: '2026-10-27T12:00:00Z'
                    entry:
                      - fullUrl: urn:uuid:5a4db0c5-0001-4000-8000-000000000001
                        resource:
                          resourceType: MessageHeader
                          id: 5a4db0c5-0001-4000-8000-000000000001
                          meta:
                            profile:
                              - >-
                                http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-response-messageheader|2.0.0-ballot
                          eventCoding:
                            system: >-
                              http://hl7.org/fhir/us/carin-rtpbc/CodeSystem/rtpbc-event-type
                            code: rtpbc-response
                            display: RTPBC Response
                          source:
                            name: haau3 Sandbox
                            endpoint: https://api.haau3.com/v1/sandbox/fhir/r4
                          response:
                            identifier: phi-request
                            code: ok
                          focus:
                            - reference: urn:uuid:5a4db0c5-0001-4000-8000-000000000002
                          definition: >-
                            http://hl7.org/fhir/us/carin-rtpbc/MessageDefinition/rtpbc-response
                      - fullUrl: urn:uuid:5a4db0c5-0001-4000-8000-000000000002
                        resource:
                          resourceType: ClaimResponse
                          id: 5a4db0c5-0001-4000-8000-000000000002
                          meta:
                            profile:
                              - >-
                                http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-response-claimresponse|2.0.0-ballot
                          identifier:
                            - value: 5a4db0c5-0001-4000-8000-000000000002
                          status: active
                          type:
                            coding:
                              - system: >-
                                  http://terminology.hl7.org/CodeSystem/claim-type
                                code: pharmacy
                                display: Pharmacy
                          use: predetermination
                          patient:
                            reference: https://app.example.test/fhir/Patient/phi-patient
                          created: '2026-10-27T12:00:00Z'
                          insurer:
                            identifier:
                              type:
                                coding:
                                  - system: >-
                                      http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType
                                    code: payerid
                              system: https://payers.example.test
                              value: SANDBOX-EHP
                            display: Example Health Plan
                          request:
                            identifier:
                              value: sandbox-mei-lin-priced
                          outcome: complete
                          disposition: >-
                            Processed. A synthetic answer from Example Health
                            Plan, haau3's test insurer.
                          item:
                            - extension:
                                - url: >-
                                    http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-benefitRestriction
                                  valueCoding:
                                    system: >-
                                      http://hl7.org/fhir/us/carin-rtpbc/CodeSystem/rtpbc-benefit-restriction-temporary
                                    code: covered
                                    display: Covered
                              itemSequence: 1
                              adjudication:
                                - category:
                                    coding:
                                      - system: >-
                                          http://hl7.org/fhir/us/carin-rtpbc/CodeSystem/rtpbc-patient-pay-type-temporary
                                        code: copay
                                        display: Copay
                                  amount:
                                    value: 10
                                    currency: USD
                                - category:
                                    coding:
                                      - system: >-
                                          http://hl7.org/fhir/us/carin-rtpbc/CodeSystem/rtpbc-patient-pay-type-temporary
                                        code: total
                                        display: Total patient responsibility
                                  amount:
                                    value: 10
                                    currency: USD
                          processNote:
                            - number: 1
                              text: >-
                                Synthetic answer from Example Health Plan,
                                haau3's test insurer, for test member Mei Lin:
                                formulary row "Priced with a copay". Not a real
                                price or benefit.
                      - fullUrl: https://app.example.test/fhir/Patient/phi-patient
                        resource:
                          resourceType: Patient
                          id: phi-patient
                          meta:
                            profile:
                              - >-
                                http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-patient|2.0.0-ballot
                            security:
                              - code: HTEST
                                system: >-
                                  http://terminology.hl7.org/CodeSystem/v3-ActReason
                                display: test health data
                          identifier:
                            - system: https://app.example.test/patients
                              value: example-0001
                            - system: https://example-health-plan.test/member-id
                              value: EX0000001
                          name:
                            - given:
                                - Mei
                              family: Lin
                          gender: female
                          birthDate: '1958-03-14'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Correlation-Id:
              $ref: '#/components/headers/XCorrelationId'
        '400':
          description: >-
            The request was refused, by the same rules as Pharmacy Benefits'
            member's request: a query parameter (the operation takes none), a
            body that is not a `message` Bundle, an event other than
            `rtpbc-request` (the request without patient details is coded
            `not-supported`: this test insurer answers a member's request only),
            a list over its cap (coded `too-long`), an element the CARIN
            profiles require that is missing, a reference that names no entry in
            the Bundle, a product with no NDC or RxNorm code, or a request with
            no Coverage or no payer identifier. The OperationOutcome names the
            element by its FHIRPath, never a value sent.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Correlation-Id:
              $ref: '#/components/headers/XCorrelationId'
        '401':
          $ref: '#/components/responses/FhirUnauthorized'
        '403':
          $ref: '#/components/responses/FhirForbiddenLiveKey'
        '406':
          $ref: '#/components/responses/FhirNotAcceptable'
        '413':
          description: The request body is over 1 MiB.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Correlation-Id:
              $ref: '#/components/headers/XCorrelationId'
        '415':
          $ref: '#/components/responses/FhirUnsupportedMediaType'
        '429':
          $ref: '#/components/responses/FhirTooManyRequests'
        '500':
          $ref: '#/components/responses/FhirServerError'
        '503':
          $ref: '#/components/responses/FhirUnavailable'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >
            curl -X POST
            "https://api.haau3.com/v1/sandbox/fhir/r4/\$process-message" \
              -H "Authorization: Bearer $HAAU3_API_KEY" \
              -H "Content-Type: application/fhir+json" \
              -d '{
                "resourceType": "Bundle",
                "id": "sandbox-mei-lin-priced",
                "meta": {
                  "profile": [
                    "http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-request-bundle|2.0.0-ballot"
                  ],
                  "security": [
                    {
                      "code": "HTEST",
                      "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
                      "display": "test health data"
                    }
                  ]
                },
                "entry": [
                  {
                    "fullUrl": "https://app.example.test/fhir/MessageHeader/phi-request",
                    "resource": {
                      "resourceType": "MessageHeader",
                      "id": "phi-request",
                      "meta": {
                        "profile": [
                          "http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-request-messageheader|2.0.0-ballot"
                        ],
                        "security": [
                          {
                            "code": "HTEST",
                            "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
                            "display": "test health data"
                          }
                        ]
                      },
                      "source": { "name": "Example app", "endpoint": "https://app.example.test" },
                      "focus": [{ "reference": "Claim/phi-claim" }],
                      "eventCoding": {
                        "code": "rtpbc-request",
                        "system": "http://hl7.org/fhir/us/carin-rtpbc/CodeSystem/rtpbc-event-type",
                        "display": "RTPBC Request"
                      },
                      "definition": "http://hl7.org/fhir/us/carin-rtpbc/MessageDefinition/rtpbc-request"
                    }
                  },
                  {
                    "fullUrl": "https://app.example.test/fhir/Claim/phi-claim",
                    "resource": {
                      "resourceType": "Claim",
                      "id": "phi-claim",
                      "meta": {
                        "profile": [
                          "http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-request-claim|2.0.0-ballot"
                        ],
                        "security": [
                          {
                            "code": "HTEST",
                            "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
                            "display": "test health data"
                          }
                        ]
                      },
                      "identifier": [{ "value": "sandbox-mei-lin-priced" }],
                      "patient": { "reference": "Patient/phi-patient" },
                      "provider": { "reference": "Organization/phi-pharmacy" },
                      "prescription": { "reference": "MedicationRequest/phi-prescription" },
                      "careTeam": [{ "provider": { "reference": "Practitioner/phi-prescriber" }, "sequence": 1 }],
                      "insurance": [
                        {
                          "coverage": { "reference": "Coverage/phi-coverage" },
                          "sequence": 1,
                          "focal": true
                        }
                      ],
                      "item": [
                        {
                          "careTeamSequence": [1],
                          "productOrService": {
                            "coding": [
                              {
                                "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
                                "code": "311354",
                                "display": "lisinopril 5 MG Oral Tablet"
                              }
                            ]
                          },
                          "quantity": {
                            "value": 30,
                            "unit": "{Each}",
                            "system": "http://unitsofmeasure.org",
                            "code": "{Each}"
                          },
                          "sequence": 1
                        }
                      ],
                      "status": "active",
                      "type": {
                        "coding": [
                          {
                            "code": "pharmacy",
                            "system": "http://terminology.hl7.org/CodeSystem/claim-type",
                            "display": "Pharmacy"
                          }
                        ]
                      },
                      "use": "predetermination",
                      "created": "2026-10-20T14:00:00Z",
                      "priority": {
                        "coding": [
                          {
                            "code": "normal",
                            "system": "http://terminology.hl7.org/CodeSystem/processpriority",
                            "display": "Normal"
                          }
                        ]
                      }
                    }
                  },
                  {
                    "fullUrl": "https://app.example.test/fhir/Patient/phi-patient",
                    "resource": {
                      "resourceType": "Patient",
                      "id": "phi-patient",
                      "meta": {
                        "profile": [
                          "http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-patient|2.0.0-ballot"
                        ],
                        "security": [
                          {
                            "code": "HTEST",
                            "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
                            "display": "test health data"
                          }
                        ]
                      },
                      "identifier": [
                        { "system": "https://app.example.test/patients", "value": "example-0001" },
                        {
                          "system": "https://example-health-plan.test/member-id",
                          "value": "EX0000001"
                        }
                      ],
                      "name": [{ "given": ["Mei"], "family": "Lin" }],
                      "gender": "female",
                      "birthDate": "1958-03-14"
                    }
                  },
                  {
                    "fullUrl": "https://app.example.test/fhir/Coverage/phi-coverage",
                    "resource": {
                      "resourceType": "Coverage",
                      "id": "phi-coverage",
                      "meta": {
                        "profile": [
                          "http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-coverage|2.0.0-ballot"
                        ],
                        "security": [
                          {
                            "code": "HTEST",
                            "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
                            "display": "test health data"
                          }
                        ]
                      },
                      "beneficiary": { "reference": "Patient/phi-patient" },
                      "payor": [
                        {
                          "identifier": {
                            "type": {
                              "coding": [
                                {
                                  "system": "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType",
                                  "code": "payerid"
                                }
                              ]
                            },
                            "system": "https://payers.example.test",
                            "value": "SANDBOX-EHP"
                          },
                          "display": "Example Health Plan"
                        }
                      ],
                      "class": [
                        {
                          "type": {
                            "coding": [
                              {
                                "code": "rxbin",
                                "system": "http://terminology.hl7.org/CodeSystem/coverage-class"
                              }
                            ]
                          },
                          "value": "000000"
                        },
                        {
                          "type": {
                            "coding": [
                              {
                                "code": "rxpcn",
                                "system": "http://terminology.hl7.org/CodeSystem/coverage-class"
                              }
                            ]
                          },
                          "value": "EXAMPLE"
                        },
                        {
                          "type": {
                            "coding": [
                              {
                                "code": "rxgroup",
                                "system": "http://terminology.hl7.org/CodeSystem/coverage-class"
                              }
                            ]
                          },
                          "value": "EXGROUP01"
                        },
                        {
                          "type": {
                            "coding": [
                              {
                                "code": "rxid",
                                "system": "http://terminology.hl7.org/CodeSystem/coverage-class"
                              }
                            ]
                          },
                          "value": "EX0000001"
                        }
                      ],
                      "status": "active",
                      "subscriberId": "EX0000001",
                      "relationship": {
                        "coding": [
                          {
                            "code": "self",
                            "system": "http://terminology.hl7.org/CodeSystem/subscriber-relationship"
                          }
                        ]
                      }
                    }
                  },
                  {
                    "fullUrl": "https://app.example.test/fhir/MedicationRequest/phi-prescription",
                    "resource": {
                      "resourceType": "MedicationRequest",
                      "id": "phi-prescription",
                      "meta": {
                        "profile": [
                          "http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-medicationrequest|2.0.0-ballot"
                        ],
                        "security": [
                          {
                            "code": "HTEST",
                            "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
                            "display": "test health data"
                          }
                        ]
                      },
                      "medicationCodeableConcept": {
                        "coding": [
                          {
                            "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
                            "code": "311354",
                            "display": "lisinopril 5 MG Oral Tablet"
                          }
                        ]
                      },
                      "subject": { "reference": "Patient/phi-patient" },
                      "requester": { "reference": "Practitioner/phi-prescriber" },
                      "dispenseRequest": {
                        "quantity": {
                          "value": 30,
                          "unit": "{Each}",
                          "system": "http://unitsofmeasure.org",
                          "code": "{Each}"
                        },
                        "expectedSupplyDuration": {
                          "value": 30,
                          "unit": "days",
                          "system": "http://unitsofmeasure.org",
                          "code": "d"
                        },
                        "performer": { "reference": "Organization/phi-pharmacy" }
                      },
                      "substitution": { "allowedBoolean": true },
                      "status": "draft",
                      "intent": "proposal",
                      "authoredOn": "2026-10-20"
                    }
                  },
                  {
                    "fullUrl": "https://app.example.test/fhir/Practitioner/phi-prescriber",
                    "resource": {
                      "resourceType": "Practitioner",
                      "id": "phi-prescriber",
                      "meta": {
                        "profile": ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner|8.0.1"],
                        "security": [
                          {
                            "code": "HTEST",
                            "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
                            "display": "test health data"
                          }
                        ]
                      },
                      "identifier": [{ "system": "http://hl7.org/fhir/sid/us-npi", "value": "2900000011" }],
                      "name": [{ "given": ["Ada"], "suffix": ["MD"], "family": "Okafor" }]
                    }
                  },
                  {
                    "fullUrl": "https://app.example.test/fhir/Organization/phi-pharmacy",
                    "resource": {
                      "resourceType": "Organization",
                      "id": "phi-pharmacy",
                      "meta": {
                        "profile": [
                          "http://hl7.org/fhir/us/carin-rtpbc/StructureDefinition/rtpbc-pharmacy-organization|2.0.0-ballot"
                        ],
                        "security": [
                          {
                            "code": "HTEST",
                            "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
                            "display": "test health data"
                          }
                        ]
                      },
                      "identifier": [{ "system": "http://hl7.org/fhir/sid/us-npi", "value": "2900000003" }],
                      "type": [
                        {
                          "coding": [
                            {
                              "code": "R",
                              "system": "http://terminology.hl7.org/CodeSystem/NCPDPPharmacyType",
                              "display": "Retail"
                            }
                          ]
                        }
                      ],
                      "telecom": [{ "system": "phone", "value": "305-555-0100" }],
                      "address": [
                        {
                          "line": ["100 Example Street"],
                          "city": "Miami",
                          "state": "FL",
                          "postalCode": "33131",
                          "country": "US"
                        }
                      ],
                      "active": true,
                      "name": "Example Pharmacy"
                    }
                  }
                ],
                "type": "message",
                "timestamp": "2026-10-20T14:00:00Z"
              }'
        - lang: typescript
          label: TypeScript
          source: >
            import { readFile } from "node:fs/promises";

            import { Haau3, type fhir4 } from "@haau3/sdk";


            const haau3 = new Haau3(); // reads HAAU3_API_KEY

            // request.json holds a test member's pharmacy benefit check, as a
            Bundle.

            const body: fhir4.Bundle = JSON.parse(await readFile("request.json",
            "utf8"));

            const bundle = await haau3.sandboxProcessMessage(body);

            console.log(bundle.entry?.length ?? 0);
        - lang: python
          label: Python
          source: >
            import json


            from haau3 import Haau3, fhir


            client = Haau3()  # reads HAAU3_API_KEY

            # request.json holds a test member's pharmacy benefit check, as a
            Bundle.

            with open("request.json") as file:
                body: fhir.Bundle = json.load(file)
            bundle = client.sandbox_process_message(body)

            print(len(bundle.get("entry", [])))
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/haau3/haau3-go\"\n\t\"github.com/haau3/haau3-go/fhir\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tclient, err := haau3.NewClient() // reads HAAU3_API_KEY\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdata, err := os.ReadFile(\"request.json\") // a test member's pharmacy benefit check\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tvar body fhir.Bundle\n\tif err := json.Unmarshal(data, &body); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tbundle, err := client.SandboxProcessMessage(ctx, &body)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(len(bundle.Entry))\n}\n"
components:
  parameters:
    XRequestId:
      name: X-Request-Id
      in: header
      required: false
      schema:
        type: string
        format: uuid
      description: >-
        An id of your own for this request, as a UUID. It comes back in the
        `X-Correlation-Id` header and is kept with haau3's record of the
        request. Any value that is not a UUID is ignored. See
        https://docs.haau3.com/errors#request-ids.
  schemas:
    Bundle:
      type: object
      description: A FHIR R4 [Bundle](https://hl7.org/fhir/R4/bundle.html).
      properties:
        resourceType:
          type: string
          const: Bundle
        type:
          type: string
        entry:
          type: array
          items:
            type: object
            additionalProperties: true
      required:
        - resourceType
      additionalProperties: true
    OperationOutcome:
      type: object
      description: >-
        A FHIR R4
        [OperationOutcome](https://hl7.org/fhir/R4/operationoutcome.html).
      properties:
        resourceType:
          type: string
          const: OperationOutcome
        issue:
          type: array
          items:
            type: object
            properties:
              severity:
                type: string
                enum:
                  - fatal
                  - error
                  - warning
                  - information
              code:
                type: string
              details:
                type: object
                properties:
                  text:
                    type: string
                additionalProperties: true
              diagnostics:
                type: string
              expression:
                type: array
                items:
                  type: string
            required:
              - severity
              - code
            additionalProperties: true
      required:
        - resourceType
        - issue
  headers:
    XRequestId:
      description: >-
        The id haau3 gave this request, a UUID, on every response. Quote it in a
        question about the response. A problem carries the same id as its
        `instance`.
      schema:
        type: string
        format: uuid
    XCorrelationId:
      description: The `X-Request-Id` you sent, when it was a UUID.
      schema:
        type: string
        format: uuid
  responses:
    FhirUnauthorized:
      description: Missing or invalid API key.
      content:
        application/fhir+json:
          schema:
            $ref: '#/components/schemas/OperationOutcome'
      headers:
        WWW-Authenticate:
          description: >-
            The scheme to authenticate with: `Bearer realm="api.haau3.com"`,
            with `error="invalid_token"` when a key was sent and not recognised.
          schema:
            type: string
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Correlation-Id:
          $ref: '#/components/headers/XCorrelationId'
    FhirForbiddenLiveKey:
      description: >-
        A live key (`haau3_sk_live_…`) does not work in the Sandbox, so one sent
        here is refused before the request runs: coded `forbidden`, with
        `live-key-in-sandbox` from `https://haau3.com/fhir/CodeSystem/api-error`
        in `issue.details.coding`. Send a test key.
      headers:
        WWW-Authenticate:
          description: >-
            Sent when the API key works only in the other mode: `Bearer
            realm="api.haau3.com", error="insufficient_scope"`.
          schema:
            type: string
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Correlation-Id:
          $ref: '#/components/headers/XCorrelationId'
      content:
        application/fhir+json:
          schema:
            $ref: '#/components/schemas/OperationOutcome'
          examples:
            A live key in the Sandbox:
              summary: A live key in the Sandbox
              value:
                resourceType: OperationOutcome
                issue:
                  - severity: error
                    code: forbidden
                    details:
                      coding:
                        - system: https://haau3.com/fhir/CodeSystem/api-error
                          code: live-key-in-sandbox
                          display: Live key in the Sandbox
                      text: >-
                        This is a live key, which does not work in the Sandbox.
                        Send this request with a test key; create one in the
                        dashboard. See
                        https://docs.haau3.com/authentication#test-and-live-keys
    FhirNotAcceptable:
      description: >-
        The request asked for a format other than JSON (`Accept` or `_format`),
        or for a FHIR release this endpoint does not serve (the `fhirVersion`
        media-type parameter).
      content:
        application/fhir+json:
          schema:
            $ref: '#/components/schemas/OperationOutcome'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Correlation-Id:
          $ref: '#/components/headers/XCorrelationId'
    FhirUnsupportedMediaType:
      description: >-
        The request body was not sent as JSON: send `Content-Type:
        application/fhir+json`.
      content:
        application/fhir+json:
          schema:
            $ref: '#/components/schemas/OperationOutcome'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Correlation-Id:
          $ref: '#/components/headers/XCorrelationId'
    FhirTooManyRequests:
      description: >-
        A limit of the organization's plan was reached: its requests a minute,
        or the Developer plan's requests a month. Send the request again after
        `Retry-After`, which for the monthly limit runs to the 1st of the next
        month (UTC).
      content:
        application/fhir+json:
          schema:
            $ref: '#/components/schemas/OperationOutcome'
      headers:
        Retry-After:
          description: How many seconds to wait before sending the request again.
          schema:
            type: integer
            minimum: 0
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Correlation-Id:
          $ref: '#/components/headers/XCorrelationId'
    FhirServerError:
      description: The server failed to process this request.
      content:
        application/fhir+json:
          schema:
            $ref: '#/components/schemas/OperationOutcome'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Correlation-Id:
          $ref: '#/components/headers/XCorrelationId'
    FhirUnavailable:
      description: >-
        The API key could not be checked just now. Send the request again after
        `Retry-After`.
      content:
        application/fhir+json:
          schema:
            $ref: '#/components/schemas/OperationOutcome'
      headers:
        Retry-After:
          description: How many seconds to wait before sending the request again.
          schema:
            type: integer
            minimum: 0
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Correlation-Id:
          $ref: '#/components/headers/XCorrelationId'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your platform API key, sent as `Authorization: Bearer <key>`: a live key
        (`haau3_sk_live_…`) for every service, or a test key (`haau3_sk_test_…`)
        for the Sandbox, the one place a test key works and a live key does not.

````

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