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

# List bills



## OpenAPI

````yaml /openapi.json get /api/v1/bills
openapi: 3.0.3
info:
  title: Grain API
  description: >-
    Church accounting and donor management API. Authenticate via OAuth 2.1 (Sign
    in with Grain). All requests require a Bearer token and X-Organization-Id
    header.
  version: 1.0.0
servers:
  - url: https://api.grainledger.com
    description: API Server
security:
  - GrainOAuth2: []
  - BearerAuth: []
tags:
  - name: Transactions
    description: Bank transactions and reconciliation
  - name: Bills
    description: Vendor bills from creation through payment
  - name: Donors
    description: Donor records and household relationships
  - name: Contributions
    description: Giving records with fund assignment and settlement
  - name: Pledges
    description: Pledge campaigns and fulfillment tracking
  - name: Households
    description: Household groupings and primary contacts
paths:
  /api/v1/bills:
    get:
      tags:
        - Bills
      summary: List bills
      parameters:
        - $ref: '#/components/parameters/OrganizationId'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/Limit'
        - name: search
          in: query
          schema:
            type: string
        - name: statusGroup
          in: query
          schema:
            type: string
            enum:
              - open
              - dueSoon
              - overdue
        - name: sortBy
          in: query
          schema:
            type: string
            enum:
              - dueDate
              - amount
              - billNumber
              - billDate
              - vendorName
              - fundName
              - status
              - createdAt
            default: dueDate
        - name: sortOrder
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
      responses:
        '200':
          description: Paginated bills
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillListResponse'
              examples:
                default:
                  $ref: '#/components/examples/BillListExample'
        '400':
          description: Bad request (missing header or invalid input)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized (missing or invalid Bearer token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden (no access to organization or action)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict (duplicate record)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    OrganizationId:
      name: X-Organization-Id
      in: header
      required: true
      schema:
        type: string
      description: Organization ID for multi-tenant data access
      example: cm123abc456def
    Page:
      name: page
      in: query
      schema:
        type: integer
        default: 1
        minimum: 1
      description: Page number (1-based)
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 20
        minimum: 1
        maximum: 1000
      description: Records per page
  schemas:
    BillListResponse:
      type: object
      properties:
        bills:
          type: array
          items:
            $ref: '#/components/schemas/Bill'
        pagination:
          $ref: '#/components/schemas/Pagination'
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          example: You do not have access to this organization.
    Bill:
      type: object
      properties:
        id:
          type: string
        billNumber:
          type: string
        billDate:
          type: string
          format: date-time
        dueDate:
          type: string
          format: date-time
        amount:
          type: number
        status:
          type: string
        vendorId:
          type: string
          nullable: true
        fundId:
          type: string
          nullable: true
    Pagination:
      type: object
      properties:
        page:
          type: integer
          example: 1
        limit:
          type: integer
          example: 20
        total:
          type: integer
          example: 142
        totalPages:
          type: integer
          example: 8
  examples:
    BillListExample:
      value:
        bills:
          - id: cm222bbb333ccc
            billNumber: INV-1042
            billDate: '2026-06-15T00:00:00.000Z'
            dueDate: '2026-07-15T00:00:00.000Z'
            amount: 850
            status: PENDING
        pagination:
          page: 1
          limit: 20
          total: 12
          totalPages: 1
  securitySchemes:
    GrainOAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.grainledger.com/oauth/authorize
          tokenUrl: https://api.grainledger.com/oauth/token
          scopes:
            openid: OpenID Connect
            email: Email address
            profile: Profile information
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth access token (JWT)

````