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

# List proforma invoices



## OpenAPI

````yaml get /v1/billing/proforma-invoices
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: >-
    Flextell REST API referansı. Kimlik doğrulama, scope ve istek kuralları için
    API sekmesindeki rehberlere bakın.
servers:
  - url: https://app.flextell.ai/api
    description: Üretim
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/billing/proforma-invoices:
    get:
      tags:
        - Billing
        - ProformaInvoice
      summary: List proforma invoices
      operationId: billing.reachable.proforma-invoices.index
      parameters:
        - name: view
          in: query
          description: >-
            List documents, pending purchases or closed purchases; omitted
            preserves the invoice history.
          schema:
            type:
              - string
              - 'null'
            enum:
              - documents
              - purchases
              - closed
              - null
        - name: search
          in: query
          description: The search query.
          schema:
            type:
              - string
              - 'null'
            maxLength: 255
        - name: status
          in: query
          description: >-
            Filter by status (draft, pending_approval, approved, rejected,
            pending_payment, partially_paid, paid, refunded, cancelled).
          schema:
            type:
              - string
              - 'null'
            enum:
              - draft
              - pending_approval
              - approved
              - rejected
              - pending_payment
              - partially_paid
              - paid
              - refunded
              - cancelled
              - null
        - name: kind
          in: query
          description: Filter by kind (period, quota_purchase, subscription).
          schema:
            type:
              - string
              - 'null'
            enum:
              - period
              - subscription
              - quota_purchase
              - null
        - name: issue_date_from
          in: query
          description: Filter records from this issue date (inclusive, YYYY-MM-DD).
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: issue_date_to
          in: query
          description: Filter records up to this issue date (inclusive, YYYY-MM-DD).
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: due_date_from
          in: query
          description: Filter records from this due date (inclusive, YYYY-MM-DD).
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: due_date_to
          in: query
          description: Filter records up to this due date (inclusive, YYYY-MM-DD).
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: per_page
          in: query
          description: The number of items per page.
          schema:
            type:
              - integer
              - 'null'
            minimum: 1
            maximum: 100
        - name: page
          in: query
          description: The page number.
          schema:
            type:
              - integer
              - 'null'
            minimum: 1
        - name: sort_by
          in: query
          description: The field to sort by.
          schema:
            type:
              - string
              - 'null'
            enum:
              - issue_date
              - due_date
              - total_amount
              - number
              - created_at
              - null
        - name: sort_order
          in: query
          description: The sort direction (asc or desc).
          schema:
            type:
              - string
              - 'null'
            enum:
              - asc
              - desc
              - null
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      responses:
        '200':
          description: Paginated set of `ProformaInvoiceResource`
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProformaInvoiceResource'
                  links:
                    type: object
                    properties:
                      first:
                        type:
                          - string
                          - 'null'
                      last:
                        type:
                          - string
                          - 'null'
                      prev:
                        type:
                          - string
                          - 'null'
                      next:
                        type:
                          - string
                          - 'null'
                    required:
                      - first
                      - last
                      - prev
                      - next
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                        minimum: 1
                      from:
                        type:
                          - integer
                          - 'null'
                        minimum: 1
                      last_page:
                        type: integer
                        minimum: 1
                      links:
                        type: array
                        description: Generated paginator links.
                        items:
                          type: object
                          properties:
                            url:
                              type:
                                - string
                                - 'null'
                            label:
                              type: string
                            active:
                              type: boolean
                          required:
                            - url
                            - label
                            - active
                      path:
                        type:
                          - string
                          - 'null'
                        description: Base path for paginator generated URLs.
                      per_page:
                        type: integer
                        description: Number of items shown per page.
                        minimum: 0
                      to:
                        type:
                          - integer
                          - 'null'
                        description: Number of the last item in the slice.
                        minimum: 1
                      total:
                        type: integer
                        description: Total number of items being paginated.
                        minimum: 0
                    required:
                      - current_page
                      - from
                      - last_page
                      - links
                      - path
                      - per_page
                      - to
                      - total
                required:
                  - data
                  - links
                  - meta
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    ProformaInvoiceResource:
      type: object
      properties:
        id:
          type: integer
        tenant_id:
          type: integer
        number:
          type: string
        kind:
          type: string
        kind_label:
          type:
            - string
            - 'null'
        subscription_plan_code:
          type:
            - string
            - 'null'
        is_subscription_upgrade:
          type: boolean
        subscription_activation_pending:
          type: boolean
        subscription_upgrade_from_code:
          type:
            - string
            - 'null'
        subscription_upgrade_period_end:
          type:
            - string
            - 'null'
        status:
          type: string
        status_label:
          type: string
        currency:
          type: string
        gross_amount:
          type: string
        discount_amount:
          type: string
        net_amount:
          type: string
        tax_amount:
          type: string
        total_amount:
          type: string
        paid_amount:
          type: string
        outstanding_amount:
          type: string
        is_fully_paid:
          type: boolean
        is_overdue:
          type: boolean
        is_payable:
          type: string
        is_pending_purchase:
          type: boolean
          description: Whether this document is an unpaid purchase attempt.
        purchase_expired:
          type: boolean
          description: Whether the purchase payment deadline has passed.
        checkout:
          type: object
          description: >-
            Checkout availability, included with the payment details; write
            endpoints enforce permissions separately.
          properties:
            can_pay:
              type: string
            can_cancel_purchase:
              type: string
            can_apply_discount:
              type: string
            can_complete_without_payment:
              type: string
            active_payment_id:
              type:
                - integer
                - 'null'
            blocked_error_code:
              type:
                - string
                - 'null'
            blocked_message:
              type:
                - string
                - 'null'
          required:
            - can_pay
            - can_cancel_purchase
            - can_apply_discount
            - can_complete_without_payment
            - active_payment_id
            - blocked_error_code
            - blocked_message
        period_start:
          type:
            - string
            - 'null'
          description: Keep calendar dates free of timezone conversion.
        period_end:
          type:
            - string
            - 'null'
        issue_date:
          type: string
        due_date:
          type: string
        approved_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        lines:
          type: array
          items:
            $ref: '#/components/schemas/ProformaInvoiceLineResource'
        discount_applications:
          type: array
          items:
            $ref: '#/components/schemas/BillingDiscountApplicationResource'
        payments:
          type: array
          items:
            $ref: '#/components/schemas/BillingPaymentResource'
      required:
        - id
        - tenant_id
        - number
        - kind
        - kind_label
        - subscription_plan_code
        - is_subscription_upgrade
        - subscription_activation_pending
        - subscription_upgrade_from_code
        - subscription_upgrade_period_end
        - status
        - status_label
        - currency
        - gross_amount
        - discount_amount
        - net_amount
        - tax_amount
        - total_amount
        - paid_amount
        - outstanding_amount
        - is_fully_paid
        - is_overdue
        - is_payable
        - is_pending_purchase
        - purchase_expired
        - period_start
        - period_end
        - issue_date
        - due_date
        - approved_at
        - created_at
        - updated_at
      title: ProformaInvoiceResource
    ProformaInvoiceLineResource:
      type: object
      properties:
        id:
          type: integer
        billing_quota_package_id:
          type:
            - integer
            - 'null'
          description: The purchased quota package identifier, when applicable.
        proforma_invoice_id:
          type: integer
        source:
          type: string
        source_label:
          type:
            - string
            - 'null'
        billing_type:
          type:
            - string
            - 'null'
        billing_type_label:
          type:
            - string
            - 'null'
        description:
          type: string
        quantity:
          type: string
        unit:
          type: string
        unit_label:
          type:
            - string
            - 'null'
        unit_price:
          type: string
        gross_amount:
          type: string
        discount_allocated:
          type: string
        net_amount:
          type: string
        tax_rate:
          type: string
        tax_amount:
          type: string
        line_total:
          type: string
        period_start:
          type:
            - string
            - 'null'
        period_end:
          type:
            - string
            - 'null'
        sort_order:
          type: integer
      required:
        - id
        - billing_quota_package_id
        - proforma_invoice_id
        - source
        - source_label
        - billing_type
        - billing_type_label
        - description
        - quantity
        - unit
        - unit_label
        - unit_price
        - gross_amount
        - discount_allocated
        - net_amount
        - tax_rate
        - tax_amount
        - line_total
        - period_start
        - period_end
        - sort_order
      title: ProformaInvoiceLineResource
    BillingDiscountApplicationResource:
      type: object
      properties:
        status:
          type: string
          description: An actual recorded discount application, not merely an assignment.
          const: applied
        proforma_invoice_number:
          type: string
        currency:
          type: string
        id:
          type: integer
        proforma_invoice_id:
          type: integer
        usage_type:
          type: string
        usage_type_label:
          type:
            - string
            - 'null'
        applied_amount:
          type: string
        applied_at:
          type:
            - string
            - 'null'
          format: date-time
        discount:
          $ref: '#/components/schemas/RelatedBillingDiscountResource'
      required:
        - status
        - id
        - proforma_invoice_id
        - usage_type
        - usage_type_label
        - applied_amount
        - applied_at
      title: BillingDiscountApplicationResource
    BillingPaymentResource:
      type: object
      properties:
        id:
          type: integer
        proforma_invoice_id:
          type: integer
        method:
          type: string
        method_label:
          type:
            - string
            - 'null'
        gateway:
          type:
            - string
            - 'null'
        status:
          type: string
        status_label:
          type:
            - string
            - 'null'
        failure_message:
          type:
            - string
            - 'null'
          description: Safe localized failure explanation; null unless the payment failed.
        amount:
          type: string
        refunded_amount:
          type: string
        currency:
          type: string
        masked_reference:
          type:
            - string
            - 'null'
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - proforma_invoice_id
        - method
        - method_label
        - gateway
        - status
        - status_label
        - failure_message
        - amount
        - refunded_amount
        - currency
        - masked_reference
        - completed_at
        - created_at
      title: BillingPaymentResource
    RelatedBillingDiscountResource:
      type: object
      properties:
        id:
          type: integer
        code:
          type:
            - string
            - 'null'
        application_mode:
          type: string
        name:
          type: string
        discount_type:
          type: string
        discount_type_label:
          type:
            - string
            - 'null'
        value:
          type: string
      required:
        - id
        - code
        - application_mode
        - name
        - discount_type
        - discount_type_label
        - value
      title: RelatedBillingDiscountResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````

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