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

# Lists referral invoice line items

> Returns the line items printed on the patient invoice, grouped as one
object per visit. Each line item includes service, date of service,
quantity, and unit price.

Personal-injury imaging returns one line per procedure. A DTI procedure
also includes the two add-on rows from the PDF (`76377` and `0866T`),
each at $2000, with `order_id` null.

Braincussion returns one line per evaluation: `TBI Test/Evaluation` at
$2800, or `TBI Test/Evaluation (follow-up)` at $2200.

`invoices` is empty when nothing would be printed yet, and for workers'
compensation and health plan referrals, which do not get this invoice.
The response is computed from current visit and order state. It does not
require the PDF to exist. Download the PDF with
`GET /api/v2/order_documents/invoices`.

This capability uses the same access as referral payments. It is
disabled until Scan enables payment read access for your account.




## OpenAPI

````yaml /openapi.yaml get /api/v2/referrals/{referral_id}/invoices
openapi: 3.1.0
info:
  title: Scan.com API
  version: v2
  description: >-
    The Scan.com Partner API creates imaging referrals, schedules visits, and
    returns radiology reports.
servers:
  - url: https://api.staging.scan.com
    description: Sandbox
  - url: https://api.scan.com
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Courier SSO
    description: >-
      Mint a one-time Courier portal SSO URL with the same Bearer token used for
      the rest of the API.
  - name: Webhooks
    description: >-
      Outbound HTTP POST notifications sent to your api_credentials.webhook_url
      when visit or notification status changes. Configure api_credentials on
      your LawFirm, Practice, CoordinationGroup, Insurance, Employer, or
      NurseCaseManagementGroup.
  - name: Order Documents
    description: >-
      Retrieve radiology report PDFs, DICOM imaging, and invoices for orders
      visible to the authenticated group.
  - name: Locations
    description: >-
      Search imaging centers near an address, or rank them for a referral after
      medical safety answers are on file. Partners submit a preferred center;
      Scan books the visit.
  - name: Testing
    description: Staging-only fixture bootstrap, status advancement, and test webhooks.
  - name: FHIR
    description: >-
      Opt-in FHIR R4 read shapes for DiagnosticReport and ImagingStudy. Not a
      FHIR server.
paths:
  /api/v2/referrals/{referral_id}/invoices:
    get:
      tags:
        - Referrals
      summary: Lists referral invoice line items
      description: |
        Returns the line items printed on the patient invoice, grouped as one
        object per visit. Each line item includes service, date of service,
        quantity, and unit price.

        Personal-injury imaging returns one line per procedure. A DTI procedure
        also includes the two add-on rows from the PDF (`76377` and `0866T`),
        each at $2000, with `order_id` null.

        Braincussion returns one line per evaluation: `TBI Test/Evaluation` at
        $2800, or `TBI Test/Evaluation (follow-up)` at $2200.

        `invoices` is empty when nothing would be printed yet, and for workers'
        compensation and health plan referrals, which do not get this invoice.
        The response is computed from current visit and order state. It does not
        require the PDF to exist. Download the PDF with
        `GET /api/v2/order_documents/invoices`.

        This capability uses the same access as referral payments. It is
        disabled until Scan enables payment read access for your account.
      operationId: listReferralInvoices
      parameters:
        - name: referral_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Visit invoices for the referral
          content:
            application/json:
              examples:
                imaging:
                  summary: Personal-injury imaging invoice with a DTI add-on
                  value:
                    referral_id: 11111111-1111-1111-1111-111111111111
                    invoices:
                      - visit_id: 22222222-2222-2222-2222-222222222222
                        date_of_service: '2026-03-15'
                        line_items:
                          - order_id: 33333333-3333-3333-3333-333333333333
                            service: 70551 MRI Brain W/O-CONTRAST
                            date_of_service: '2026-03-15'
                            quantity: 1
                            unit_price: 2400
                          - order_id: null
                            service: 76377 - 3D rendering and post processing
                            date_of_service: '2026-03-15'
                            quantity: 1
                            unit_price: 2000
                          - order_id: null
                            service: 0866T - Volumetric analysis with NeuroQuant
                            date_of_service: '2026-03-15'
                            quantity: 1
                            unit_price: 2000
                        total: 6400
              schema:
                type: object
                required:
                  - referral_id
                  - invoices
                properties:
                  referral_id:
                    type: string
                    format: uuid
                  invoices:
                    type: array
                    items:
                      $ref: '#/components/schemas/InvoiceVisit'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    InvoiceVisit:
      type: object
      description: Invoice rows for one visit on the referral
      required:
        - visit_id
        - line_items
        - total
      properties:
        visit_id:
          type: string
          format: uuid
        date_of_service:
          type: string
          format: date
          nullable: true
          description: Scheduled date of service for the visit
          example: '2026-03-15'
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineItem'
        total:
          type: number
          description: Sum of the visit's line-item unit prices, in dollars
          example: 6400
    InvoiceLineItem:
      type: object
      description: One row from the patient invoice
      required:
        - service
        - quantity
        - unit_price
      properties:
        order_id:
          type: string
          format: uuid
          nullable: true
          description: >
            Procedure this line bills. Null for DTI add-on rows and Braincussion
            evaluation rows, which are not separate orders.
        service:
          type: string
          description: >
            SERVICE column from the patient invoice. Imaging rows use the
            procedure label, for example `70551 MRI Brain W/O-CONTRAST`. DTI
            orders add `76377 - 3D rendering and post processing` and `0866T -
            Volumetric analysis with NeuroQuant`. Braincussion rows are `TBI
            Test/Evaluation` or `TBI Test/Evaluation (follow-up)`.
          example: 70551 MRI Brain W/O-CONTRAST
        date_of_service:
          type: string
          format: date
          nullable: true
          description: Scheduled date of service. Null when the visit has no start time.
          example: '2026-03-15'
        quantity:
          type: integer
          example: 1
        unit_price:
          type: number
          description: Unit price in dollars
          example: 2400
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        type:
          type: string
          example: validation_error
        code:
          type: string
          example: unprocessable_entity
        request_id:
          type: string
        documentation_url:
          type: string
        errors:
          type: array
          items:
            type: string
      required:
        - error
        - message
        - type
        - code
  responses:
    Unauthorized:
      description: Missing, expired, or wrong-environment token
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            unauthorized:
              value:
                error: Unauthorized
                message: Unauthorized
                type: authentication_error
                code: unauthorized
                request_id: abc-123
                documentation_url: https://docs.scan.com/guides/errors#unauthorized
            expired:
              value:
                error: API token expired
                message: API token expired
                type: authentication_error
                code: api_token_expired
                request_id: abc-123
                documentation_url: https://docs.scan.com/guides/errors#api_token_expired
    Forbidden:
      description: Endpoint is not enabled for this account
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: This endpoint is not enabled for your account
            message: This endpoint is not enabled for your account
            type: permission_error
            code: endpoint_not_enabled
            request_id: abc-123
            documentation_url: https://docs.scan.com/guides/errors#endpoint_not_enabled
    NotFound:
      description: Resource not found or not accessible to this account
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Referral not found
            message: Referral not found
            type: not_found_error
            code: not_found
            request_id: abc-123
            documentation_url: https://docs.scan.com/guides/errors#not_found
    TooManyRequests:
      description: Sandbox request allowance exhausted
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Sandbox request limit reached
            message: Sandbox request limit reached
            type: rate_limit_error
            code: sandbox_request_limit_reached
            request_id: abc-123
            documentation_url: https://docs.scan.com/guides/errors#sandbox_request_limit_reached
    InternalServerError:
      description: Unexpected internal error
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Internal server error
            message: Internal server error
            type: api_error
            code: internal_error
            request_id: abc-123
            documentation_url: https://docs.scan.com/guides/errors#internal_error
  headers:
    RequestId:
      description: Correlate this response with Scan support.
      schema:
        type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        `Authorization: Bearer <api_token>`. Reuse the same token on later
        requests

        until it expires or is revoked. Do not request a new token for each
        call.

        The token does not expire after 24 hours. Sandbox tokens come from Get

        API keys and allow 2,000 successful requests or 7 days, or 90 days with

        an access code. Failed 4xx/5xx responses do not consume the allowance.

        Production tokens are issued from the group's API access tab and last

        until the expiry set there, or until revoked when no expiry is set.

````

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