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

# Query invoices & credit memos



## OpenAPI

````yaml /billing.openapi.json post /api/data-query
openapi: 3.1.0
info:
  title: Billing
  description: |+

  version: 1.0.0
  summary: ''
servers:
  - url: https://sbx.api.easybilling.cloud/billing
    description: SBX
  - url: https://api.easybilling.cloud/billing
    description: Production-AWS
security:
  - token: []
tags:
  - name: account
  - name: payment method
  - name: contract action
  - name: usage event
  - name: billing document
  - name: invoice pdf
  - name: prepaid credits
  - name: customer portal
paths:
  /api/data-query:
    post:
      tags:
        - billing document
      summary: Query invoices & credit memos
      parameters:
        - name: size
          in: query
          description: ''
          required: false
          schema:
            type: integer
            minimum: 20
            maximum: 500
            default: 20
        - name: page
          in: query
          description: ''
          required: false
          schema:
            type: integer
        - name: trace-id
          in: header
          description: ''
          required: false
          example: '{{$string.uuid}}'
          schema:
            type: string
            default: '{{$string.uuid}}'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                startDate:
                  type: string
                  format: date
                endDate:
                  type: string
                  format: date
                queryObject:
                  type: string
                  enum:
                    - invoice
                    - credit-memo
                filters:
                  type: array
                  items:
                    type: object
                    properties:
                      fieldName:
                        type: string
                        enum:
                          - number
                          - accountNumber
                          - status
                      fieldValues:
                        type: array
                        items:
                          type: object
                          properties: {}
              required:
                - queryObject
            examples:
              get invoices by account number:
                value:
                  queryObject: invoice
                  filters:
                    - fieldName: accountNumber
                      fieldValues:
                        - ACC-0000000123
                summary: get invoices by account number
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  content:
                    type: array
                    items:
                      $ref: '#/components/schemas/DataQueryResponseContent'
                  number:
                    type: integer
                    title: Page number
                  size:
                    type: integer
                    title: Number of items per page
                  totalElements:
                    type: integer
                    title: Total number of items
                  totalPages:
                    type: integer
                    title: Total number of pages
                  last:
                    type: boolean
                  first:
                    type: boolean
                  numberOfElements:
                    type: integer
                  empty:
                    type: boolean
                  sort:
                    type: object
                    properties:
                      empty:
                        type: boolean
                      sorted:
                        type: boolean
                      unsorted:
                        type: boolean
                    required:
                      - empty
                      - sorted
                      - unsorted
                  pageable:
                    type: object
                    properties:
                      pageNumber:
                        type: integer
                      pageSize:
                        type: integer
                      offset:
                        type: integer
                      paged:
                        type: boolean
                      unpaged:
                        type: boolean
                      sort:
                        type: object
                        properties:
                          empty:
                            type: boolean
                          sorted:
                            type: boolean
                          unsorted:
                            type: boolean
                        required:
                          - empty
                          - sorted
                          - unsorted
                    required:
                      - pageNumber
                      - pageSize
                      - sort
                      - offset
                      - paged
                      - unpaged
                required:
                  - content
                  - number
                  - size
                  - totalElements
                  - totalPages
                  - last
                  - first
                  - pageable
                  - sort
                  - numberOfElements
                  - empty
              examples:
                Invoice list:
                  summary: invoice list
                  value:
                    content:
                      - id: 97b690f8-87ef-4cfd-ad40-22585d1defe3
                        accountId: 67773b78-11c2-435d-bddd-4c4eebc4bb3e
                        contractId: 55aac344-1f7f-4846-b9d4-7c53cecf3345
                        number: INV-000000198
                        date: '2026-05-01'
                        dueDate: '2026-05-01'
                        subTotal: 200
                        discountAmount: 0
                        amountAfterDiscount: 200
                        taxAmount: 0
                        totalAmount: 200
                        balance: 200
                        currency: USD
                        status: paid
                        description: auto-testing-hybrid-drawdown2
                        createdAt: '2026-04-14T11:48:15Z'
                        updatedAt: '2026-04-30T16:04:01Z'
                        createdBy: system
                        updatedBy: 39b21041-ddb5-4cda-98f5-bb28f3c70cf0
                    pageable:
                      pageNumber: 0
                      pageSize: 20
                      sort:
                        sorted: true
                        empty: false
                        unsorted: false
                      offset: 0
                      paged: true
                      unpaged: false
                    last: true
                    totalElements: 1
                    totalPages: 1
                    first: true
                    size: 20
                    number: 0
                    sort:
                      sorted: true
                      empty: false
                      unsorted: false
                    numberOfElements: 1
                    empty: false
                Credit Memo List:
                  summary: Credit Memo List
                  value:
                    content:
                      - id: c6db1a67-10d7-4b33-8a69-108e2b9fdefa
                        accountId: 429d8f4c-a055-4fb1-a8a7-db815751fa29
                        number: CM-000000123
                        date: '2026-05-20'
                        dueDate: '2026-05-20'
                        subTotal: 100
                        discountAmount: 0
                        amountAfterDiscount: 100
                        taxAmount: 0
                        totalAmount: 100
                        balance: 100
                        currency: USD
                        status: posted
                        reasonCode: consumption-based-credit
                        originalInvoiceId: 4a64f7c9-cc6d-4d88-8024-12973a0e07fa
                        createdAt: '2026-05-20T09:29:59Z'
                        updatedAt: '2026-05-20T09:29:59Z'
                        createdBy: 39b21041-ddb5-4cda-98f5-bb28f3c70cf0
                        updatedBy: 39b21041-ddb5-4cda-98f5-bb28f3c70cf0
                    pageable:
                      pageNumber: 0
                      pageSize: 20
                      sort:
                        sorted: true
                        empty: false
                        unsorted: false
                      offset: 0
                      paged: true
                      unpaged: false
                    last: true
                    totalElements: 1
                    totalPages: 1
                    first: true
                    size: 20
                    number: 0
                    sort:
                      sorted: true
                      empty: false
                      unsorted: false
                    numberOfElements: 1
                    empty: false
          headers: {}
      deprecated: false
      security:
        - token: []
components:
  schemas:
    DataQueryResponseContent:
      oneOf:
        - $ref: '#/components/schemas/InvoiceInfo'
        - $ref: '#/components/schemas/creditMemoListRes'
    InvoiceInfo:
      type: object
      properties:
        accountId:
          type: string
        id:
          type: string
        number:
          type: string
        date:
          type: string
          format: date
        dueDate:
          type: string
          format: date
        totalAmount:
          type: number
        taxAmount:
          type: number
        subTotal:
          type: number
        discountAmount:
          type: number
        amountAfterDiscount:
          type: number
        currency:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        createdBy:
          type: string
        updatedBy:
          type: string
        status:
          type: string
          enum:
            - draft
            - posted
            - reversed
            - paid
    creditMemoListRes:
      type: object
      properties:
        id:
          type: string
        accountId:
          type: string
        number:
          type: string
        date:
          type: string
        dueDate:
          type: string
        subTotal:
          type: integer
        discountAmount:
          type: integer
        amountAfterDiscount:
          type: integer
        taxAmount:
          type: integer
        totalAmount:
          type: integer
        balance:
          type: integer
        currency:
          type: string
        status:
          type: string
        reasonCode:
          type: string
        originalInvoiceId:
          type: string
        createdAt:
          type: string
        updatedAt:
          type: string
        createdBy:
          type: string
        updatedBy:
          type: string
  securitySchemes:
    token:
      type: http
      scheme: bearer

````