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

# Get an unassigned company bill

> Retrieve a single bill waiting in the company's inbox, including the candidate organisations it might belong to. Once assigned, retrieve it from GET /bills/{billId} instead.

**Authentication.** An API key (`x-dolfin-api-key`) **or** a JWT Bearer token. When your credential grants access to more than one client, select one with the `x-dolfin-client-id` header.



## OpenAPI

````yaml get /v1/companies/{companyId}/bills/{billId}
openapi: 3.1.1
info:
  title: Dolfin API
  description: >-
    Dolfin API for AR & AP. Each operation documents its accepted credentials
    under **Authentication** — typically an `x-dolfin-api-key` header (with
    `x-dolfin-organisation-id`) or a JWT Bearer token.
  version: v1
servers:
  - url: https://api.dolfinai.co
    description: Production
security: []
tags:
  - name: Users
  - name: TaxRates
  - name: Suppliers
  - name: Supplier Credit Notes
  - name: Bills
  - name: Payables
  - name: RecurringInvoices
  - name: Receivables
  - name: Purchase Orders
  - name: Products
  - name: Payments
  - name: Invoices
  - name: Organisations
  - name: Clients
  - name: MCP
  - name: Matching
  - name: Invoice Reminders
  - name: Industries
  - name: Gmail
  - name: Delivery Notes
  - name: Customers
  - name: Currencies
  - name: Credit Notes
  - name: Companies
  - name: BankPayments
  - name: Bank details
  - name: Auth
  - name: ApprovalPolicies
  - name: Agent
paths:
  /v1/companies/{companyId}/bills/{billId}:
    get:
      tags:
        - Companies
      summary: Get an unassigned company bill
      description: >-
        Retrieve a single bill waiting in the company's inbox, including the
        candidate organisations it might belong to. Once assigned, retrieve it
        from GET /bills/{billId} instead.


        **Authentication.** An API key (`x-dolfin-api-key`) **or** a JWT Bearer
        token. When your credential grants access to more than one client,
        select one with the `x-dolfin-client-id` header.
      parameters:
        - name: companyId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: billId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: x-dolfin-client-id
          in: header
          description: >-
            Target client. Required when your credential grants access to more
            than one client; omit when it resolves a single client.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyInboxBillResponse'
        '400':
          description: Company.MissingClientId — client ID is required
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: >-
            Module.NotEntitled — the client's plan does not include the module
            this endpoint requires
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: >-
            CompanyInboxBill.NotFound — the company bill does not exist or
            belongs to a different client
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - ApiKey: []
        - Bearer: []
components:
  schemas:
    CompanyInboxBillResponse:
      type: object
      properties:
        id:
          type: string
          description: >-
            Identifier of the bill. It does not change when the bill is routed:
            the same id retrieves the bill from GET /bills/{billId} afterwards.
          format: uuid
        companyId:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/CompanyInboxBillStatus'
          description: >-
            Where the bill is in the inbox. AwaitingOrganisation means it needs
            routing; ExtractionFailed means the document could not be read;
            Discarded means someone rejected it.
        source:
          $ref: '#/components/schemas/BillSource'
          description: >-
            How the bill arrived — an API upload, or the company's
            bill-forwarding email address.
        routingOutcome:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CompanyRoutingOutcome'
              description: >-
                Why the bill was not routed automatically. Tells you what needs
                deciding: for example, that the delivery address matched several
                sites, that it was delivered to head office, or that no address
                could be read.
        suggestedOrganisationId:
          type:
            - 'null'
            - string
          description: >-
            The organisation the bill most likely belongs to, if one stood out.
            Present even when confidence was too low to route automatically.
          format: uuid
        suggestedOrganisationConfidence:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$
          type:
            - 'null'
            - number
            - string
          description: How confident the address match was, from 0 to 1.
          format: double
        candidates:
          type: array
          items:
            $ref: '#/components/schemas/CompanyInboxBillCandidateResponse'
          description: >-
            The candidate organisations, best match first, so a reviewer can
            pick rather than search.
        supplierName:
          type:
            - 'null'
            - string
        supplierEmail:
          type:
            - 'null'
            - string
        supplierAddress:
          type:
            - 'null'
            - string
        deliveryAddress:
          type:
            - 'null'
            - string
          description: The delivery address exactly as printed on the document.
        deliveryAddressDetail:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Address'
              description: >-
                The delivery address as components — what the bill is matched
                against when deciding which organisation it belongs to.
        invoiceNumber:
          type:
            - 'null'
            - string
        invoiceDate:
          type:
            - 'null'
            - string
          format: date-time
        dueDate:
          type:
            - 'null'
            - string
          format: date-time
        currency:
          type: string
          description: ISO 4217 currency code (e.g. GBP, USD, EUR)
        subTotal:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - number
            - string
          format: double
        taxAmount:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - number
            - string
          format: double
        totalAmount:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - number
            - string
          format: double
        confidence:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$
          type:
            - 'null'
            - number
            - string
          description: Extraction confidence reported by the document reader, from 0 to 1.
          format: float
        extractionError:
          type:
            - 'null'
            - string
          description: Why extraction failed, when it did.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
    CompanyInboxBillStatus:
      enum:
        - Extracting
        - ExtractionFailed
        - AwaitingOrganisation
        - Discarded
    BillSource:
      enum:
        - Upload
        - Email
        - Webhook
    CompanyRoutingOutcome:
      enum:
        - AutoAssigned
        - BelowThreshold
        - Ambiguous
        - HeadOffice
        - MultipleDeliveryAddresses
        - NoDeliveryAddress
        - NoOrganisations
        - AutoAssignDisabled
        - null
    CompanyInboxBillCandidateResponse:
      required:
        - basis
      type: object
      properties:
        organisationId:
          type: string
          format: uuid
        score:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$
          type:
            - number
            - string
          description: Match strength from 0 to 1.
          format: double
        basis:
          type: string
          description: >-
            Which signal produced the score: "postcode" for an exact postcode
            match, "address" for address text overlap, or "name" where the
            site's name appears in the delivery block.
    Address:
      type: object
      properties:
        line1:
          type:
            - 'null'
            - string
        line2:
          type:
            - 'null'
            - string
        city:
          type:
            - 'null'
            - string
        state:
          type:
            - 'null'
            - string
        postalCode:
          type:
            - 'null'
            - string
        country:
          type:
            - 'null'
            - string
          description: ISO 3166-1 alpha-2 country code (e.g. GB, US, DE)
        isEmpty:
          type: boolean
  securitySchemes:
    ApiKey:
      type: apiKey
      description: >-
        An API key issued to your client. It carries the client's scope;
        org-scoped calls also require the `x-dolfin-organisation-id` header.
        Keys are created and revoked by a client administrator.
      name: x-dolfin-api-key
      in: header
    Bearer:
      type: http
      description: >-
        A session JWT obtained via the OAuth flow (`POST /auth/codes` → `POST
        /auth/exchange`). Its claims carry the caller's organisation and/or
        client scope.
      scheme: bearer
      bearerFormat: JWT

````