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

# List Invoices

> Retrieve a list of all your invoices filtered by various parameters and their payment status.



## OpenAPI

````yaml GET /v1/c/invoice
openapi: 3.0.3
info:
  title: wingback-api
  description: ''
  contact:
    name: ''
  license:
    name: commercial
  version: 0.1.0
servers:
  - url: http://127.0.0.1:8080
    description: Local server
  - url: https://api.app.test.wingback.com
    description: Testing server
security: []
paths:
  /v1/c/invoice:
    get:
      tags:
        - invoice
      operationId: list_invoice
      parameters:
        - name: customer
          in: query
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/Id'
            nullable: true
        - name: date_before
          in: query
          required: false
          schema:
            type: string
            format: date
            nullable: true
        - name: date_after
          in: query
          required: false
          schema:
            type: string
            format: date
            nullable: true
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: offset
          in: query
          required: false
          schema:
            type: string
            nullable: true
        - name: direction
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/Direction'
      responses:
        '200':
          description: List of invoices
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Paginated_ListedInvoice'
      security:
        - api-key: []
        - wb_user_cookie: []
components:
  schemas:
    Id:
      type: string
      description: >-
        Unique identifier of an object. Consists of object class prefix and a
        UUID
      example: Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670
    Direction:
      type: string
      description: |-
        Pagination direction:
        * Forward - from first entry to last
        * Backward - from last entry to first
      enum:
        - forward
        - backward
    Paginated_ListedInvoice:
      type: object
      description: |-
        A paginated result of the requested resource
        This is based on Keyset Pagination
        https://vladmihalcea.com/sql-seek-keyset-pagination/
      required:
        - total
        - total_pages
        - current_page
        - hits
      properties:
        backward:
          type: string
          description: Index of the previous page in the result set
        current_page:
          type: integer
          description: Number of the current page
        first:
          type: string
          description: Index of the first element in the result set
        forward:
          type: string
          description: Index of the next page in the result set
        hits:
          type: array
          items:
            $ref: '#/components/schemas/ListedInvoice'
        last:
          type: string
          description: Index of the last element in the result set
        total:
          type: integer
          description: Total number of results
        total_pages:
          type: integer
          description: Number of pages in the result
    ListedInvoice:
      type: object
      description: |-
        An invoice with a detailed status and some plan information
        for lists
      required:
        - invoice
        - detailed_invoice_status
      properties:
        detailed_invoice_status:
          $ref: '#/components/schemas/DetailedInvoiceStatus'
        invoice:
          $ref: '#/components/schemas/Invoice'
        payment_execution_provider:
          allOf:
            - $ref: '#/components/schemas/core.payment.Provider'
          nullable: true
        payment_execution_status:
          allOf:
            - $ref: '#/components/schemas/PaymentExecutionStatus'
          nullable: true
    DetailedInvoiceStatus:
      type: string
      description: >-
        Detailed Status of an invoice, taking into account the

        status of the eventual payment:


        * pending_validation: in wait for a validation of the invoice

        * paid: invoice is paid

        * not_yet_due: the invoice due date hasn't been reached

        * customer_not_active: customer not being active, we don't process their
        invoices

        * canceled_unpaid_transaction: a previously created but unrealized
        deposit transaction has been canceled - the status will change next time
        the billing engine runs

        * canceled_self_handled_payment: a previously created manual payment has
        been canceled, a new one is necessary

        * pending_payment_processing: not yet processed - transitory state

        * no_valid_payment_method: invoice is configured for automatic payment
        but there's no valid automatic payment method

        * sum_smaller_than_payment_threshold: the total amounts of all invoices
        which can be gathered in a payment (same customer and currency) is
        smaller than the minimal amount of a transaction

        * automatic_payment_in_progress: a non-instant payment (e.g. SEPA) is
        being processed

        * awaiting_self_handled_payment: the invoice isn't set for automatic
        payment and no manual payment was registered

        * self_handled_payment_in_progress: a self-handled payment has been
        registered by the wb_customer but hasn't been validated yet

        * self_handled_payment_failed: a self-handled payment has been
        registered by the wb_customer but has been flagged as failed

        * automatic_payment_canceled: an automatic payment has been canceled by
        the payment processor

        * payment_error_retry: there was an error, the billing engine will retry
        later

        * payment_error_no_retry: there was an error, the billing engine won't
        retry unless it's requested to do it
      enum:
        - pending_validation
        - paid
        - nothing_to_pay
        - not_yet_due
        - customer_not_active
        - canceled_unpaid_transaction
        - canceled_self_handled_payment
        - pending_payment_processing
        - no_valid_payment_method
        - sum_smaller_than_payment_threshold
        - automatic_payment_in_progress
        - awaiting_self_handled_payment
        - self_handled_payment_in_progress
        - self_handled_payment_failed
        - automatic_payment_canceled
        - payment_error_retry
        - payment_error_no_retry
        - internal_error
    Invoice:
      type: object
      description: Overall information about the issued invoice
      required:
        - id
        - customer_id
        - date
        - status
        - total
        - currency
        - deposit_transaction_status
        - due_date
        - invoice_number
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
        customer_id:
          $ref: '#/components/schemas/Id'
        date:
          type: string
          format: date-time
          description: Date when the invoice was created
        deposit_transaction_id:
          allOf:
            - $ref: '#/components/schemas/Id'
          nullable: true
        deposit_transaction_status:
          $ref: '#/components/schemas/InvoiceDepositStatus'
        due_date:
          type: string
          format: date-time
          description: Date the invoice is due
        external_reference:
          type: string
          description: Optional reference in a non-wingback system
          nullable: true
        id:
          $ref: '#/components/schemas/Id'
        invoice_number:
          $ref: '#/components/schemas/InvoiceNumber'
        status:
          $ref: '#/components/schemas/InvoiceStatus'
        total:
          type: string
          description: Total sum of the invoice
    core.payment.Provider:
      type: string
      description: |-
        The payment providers known by the backend.

        Those variants MUST be kept identical to the variants of
        the payment_provider enum of the postgres database
      enum:
        - authorize
        - self_handled
        - stripe
      example: stripe
    PaymentExecutionStatus:
      type: string
      description: |-
        Payment execution status:
        * Pending - pending processing
        * ErrorRetry - error, will be retried
        * ErrorNoRetry - error, retrying impossible
        * InProgress - in progress
        * Done - completed
        * Canceled - canceled
      enum:
        - pending
        - error_retry
        - error_no_retry
        - in_progress
        - done
        - canceled
    Currency:
      type: string
      description: |-
        A supported currency

        The format for parsing and reading is the lowercased
        ISO 4217 currency code (e.g. "usd")
      enum:
        - usd
        - eur
        - gbp
        - brl
        - ars
    InvoiceDepositStatus:
      type: string
      description: |-
        Status of the deposit transaction creation, which
        explains, whent the deposit transaction wasn't
        created, why it's the case.

        This status isn't meant for (wb_)customer display
        as it's quite technical. For this purpose,
        see DetailedInvoiceStatus.

        When the invoice holds a deposit transaction id,
        then this status is *always* Created (enforced by
        DB constraint)
      enum:
        - not_processed
        - customer_not_active
        - canceled_unpaid_transaction
        - canceled_self_handled_payment
        - no_valid_payment_method
        - sum_smaller_than_payment_threshold
        - created
    InvoiceNumber:
      type: object
      description: |-
        An invoice number, unique per wb_customer

        The current format is
        `<wb_customer-customer-key>-<year>-<customer-sequential-number>`
      required:
        - number
      properties:
        number:
          type: string
          description: The invoice number, unique
    InvoiceStatus:
      type: string
      description: |-
        Status of the invoice:
        * PendingValidation - Invoice awaits manual review
        * ReadyForPayment - invoice can be paid
        * Paid - invoice was paid
      enum:
        - pending_validation
        - ready_for_payment
        - paid
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: wb-key
    wb_user_cookie:
      type: apiKey
      in: cookie
      name: app-session

````