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

# List bills



## OpenAPI

````yaml /openapi/accounting.json get /bills
openapi: 3.1.0
info:
  title: Sync2Books Accounting API
  version: 1.0.0
  description: >-
    Write categorized expenses, bills, invoices, and payments to your customers'
    accounting systems (QuickBooks Online, Xero, Sage, Dynamics 365 Business
    Central, Odoo) through one API.


    This is a **separate product** from the [Sync2Books Compliance API
    (eTIMS)](/etims-overview) — use this one to sync bookkeeping data to an
    accounting system; use that one for KRA tax compliance in Kenya. A company
    can use either, both, or neither.


    Writes are **asynchronous**: most create endpoints queue the record and
    return a `syncBatchId` you confirm via the [Sync](#tag/Sync) endpoints — see
    [The sync model](/concepts/sync-model).
servers:
  - url: https://api.sync2books.com
    description: Production
  - url: https://sandbox-api.sync2books.com
    description: Sandbox (coming soon)
security:
  - ApiKeyAuth: []
tags:
  - name: Companies
    description: Your customers — the entities you sync data for.
  - name: Expenses
    description: Categorized expenses, receipts, and payments.
  - name: Bills
    description: Accounts-payable documents (money you owe suppliers).
  - name: Invoices
    description: Accounts-receivable documents (money customers owe you).
  - name: Bill Payments
    description: Payments applied against one or more bills.
  - name: Attachments
    description: Receipts and supporting documents on a synced transaction.
  - name: Sync
    description: Track and retry the asynchronous batches every write creates.
paths:
  /bills:
    get:
      tags:
        - Bills
      summary: List bills
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            minimum: 1
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
        - name: search
          in: query
          schema:
            type: string
        - name: status
          in: query
          schema:
            $ref: '#/components/schemas/BillStatus'
        - name: supplierId
          in: query
          schema:
            type: string
        - name: currency
          in: query
          schema:
            type: string
        - name: minAmount
          in: query
          schema:
            type: number
        - name: maxAmount
          in: query
          schema:
            type: number
        - name: startDate
          in: query
          schema:
            type: string
            format: date
          description: Issue date range start.
        - name: endDate
          in: query
          schema:
            type: string
            format: date
        - name: dueStartDate
          in: query
          schema:
            type: string
            format: date
        - name: dueEndDate
          in: query
          schema:
            type: string
            format: date
        - name: purchaseOrderId
          in: query
          schema:
            type: string
        - name: purchaseOrderNumber
          in: query
          schema:
            type: string
        - name: syncStatus
          in: query
          schema:
            type: string
            enum:
              - pending
              - syncing
              - synced
              - failed
        - name: overdueOnly
          in: query
          schema:
            type: boolean
        - name: sortBy
          in: query
          schema:
            type: string
            enum:
              - issueDate
              - dueDate
              - totalAmount
              - createdAt
              - updatedAt
        - name: sortOrder
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillListResponse'
components:
  schemas:
    BillStatus:
      type: string
      enum:
        - Unknown
        - Open
        - PartiallyPaid
        - Paid
        - Void
        - Draft
    BillListResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Bill'
        total:
          type: integer
        page:
          type: integer
        limit:
          type: integer
        totalPages:
          type: integer
        hasNextPage:
          type: boolean
        hasPreviousPage:
          type: boolean
    Bill:
      allOf:
        - $ref: '#/components/schemas/CreateBillRequest'
        - type: object
          properties:
            id:
              type: string
            connectionId:
              type: string
            syncStatus:
              type: string
              enum:
                - pending
                - syncing
                - synced
                - failed
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
    CreateBillRequest:
      type: object
      required:
        - supplierRef
        - issueDate
        - currency
        - subTotal
        - taxAmount
        - totalAmount
        - lineItems
        - status
      properties:
        billCode:
          type: string
        reference:
          type: string
        supplierRef:
          $ref: '#/components/schemas/PartyRef'
        purchaseOrderRefs:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              purchaseOrderNumber:
                type: string
        issueDate:
          type: string
          format: date
        dueDate:
          type: string
          format: date
        currency:
          type: string
        currencyRate:
          type: number
          minimum: 0.0001
        subTotal:
          $ref: '#/components/schemas/Money'
        taxAmount:
          $ref: '#/components/schemas/Money'
        totalAmount:
          $ref: '#/components/schemas/Money'
        amountDue:
          $ref: '#/components/schemas/Money'
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/BillLineItem'
        note:
          type: string
        status:
          $ref: '#/components/schemas/BillStatus'
        withholdingTax:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              amount:
                type: number
    PartyRef:
      type: object
      required:
        - id
      properties:
        id:
          type: string
        name:
          type: string
    Money:
      type: number
      description: Decimal amount in the document's `currency`.
    BillLineItem:
      type: object
      required:
        - unitAmount
        - quantity
        - isDirectCost
      properties:
        lineNumber:
          type: integer
        description:
          type: string
        unitAmount:
          $ref: '#/components/schemas/Money'
        quantity:
          type: number
          minimum: 1
        unitOfMeasurement:
          type: string
        discountAmount:
          $ref: '#/components/schemas/Money'
        discountPercentage:
          type: number
          minimum: 0
          maximum: 100
        subTotal:
          $ref: '#/components/schemas/Money'
        taxAmount:
          $ref: '#/components/schemas/Money'
        totalAmount:
          $ref: '#/components/schemas/Money'
        accountRef:
          $ref: '#/components/schemas/Ref'
        taxRateRef:
          $ref: '#/components/schemas/Ref'
        itemRef:
          $ref: '#/components/schemas/Ref'
        trackingCategoryRefs:
          type: array
          items:
            $ref: '#/components/schemas/Ref'
        isDirectCost:
          type: boolean
    Ref:
      type: object
      required:
        - id
      properties:
        id:
          type: string
        name:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your application's API key (`sk_development_…` or `sk_production_…`). An
        optional `X-Signature` / `X-Timestamp` HMAC pair may additionally be
        sent for stronger security — see
        [Authentication](/concepts/authentication).

````

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