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

# Validate a bill

> Checks a bill's internal consistency: line items reconcile to the subtotal, subtotal + tax equals the total, required header fields are present, and bank details are well-formed. Returns 200 { valid: true } when the bill is consistent, or a 400 ValidationProblem listing every issue — each with a machine-readable code on the `codes` sidecar — so the caller can decide which to act on. Read-only: it never alters the bill.



## OpenAPI

````yaml get /bills/{id}/validate
openapi: 3.1.1
info:
  title: Dolfin API
  description: >-
    Dolfin API for AR & AP. Authenticate using the `x-dolfin-api-key` header
    with the API key distributed to your organisation.
  version: v1
servers:
  - url: https://api.dolfinai.co
    description: Production
security:
  - {}
tags:
  - name: Webhooks
  - name: Users
  - name: TaxRates
  - name: Suppliers
  - name: Supplier Credit Notes
  - name: Bills
  - name: SpendCategories
  - name: Payables
  - name: RecurringInvoices
  - name: Receivables
  - name: Purchase Orders
  - name: Products
  - name: Payments
  - name: Invoices
  - name: Organisations
  - name: Members
  - name: MCP
  - name: Matching
  - name: Invoice Reminders
  - name: Industries
  - name: Gmail
  - name: Delivery Notes
  - name: Customers
  - name: Currencies
  - name: Credit Notes
  - name: Clients
  - name: ClientInvites
  - name: BankPayments
  - name: Bank details
  - name: Auth
  - name: ApprovalPolicies
  - name: ApiKeys
  - name: Agent
paths:
  /bills/{id}/validate:
    get:
      tags:
        - Bills
      summary: Validate a bill
      description: >-
        Checks a bill's internal consistency: line items reconcile to the
        subtotal, subtotal + tax equals the total, required header fields are
        present, and bank details are well-formed. Returns 200 { valid: true }
        when the bill is consistent, or a 400 ValidationProblem listing every
        issue — each with a machine-readable code on the `codes` sidecar — so
        the caller can decide which to act on. Read-only: it never alters the
        bill.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillValidationResponse'
        '400':
          description: >-
            Bill.ValidationFailed — bill failed one or more consistency checks;
            see the errors map and codes sidecar
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: >-
            Bill.NotFound — bill does not exist or belongs to a different
            organisation
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    BillValidationResponse:
      type: object
      properties:
        valid:
          type: boolean
          description: >-
            True when the bill passed every validation check. When validation
            fails the endpoint returns 400 with the issues instead, so this is
            always true in a 200 response.
    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

````