# List Invoices

`GET /v1/billing/invoices`

The organization's invoices, newest first, with amounts, status and
the PDF. Owners only, as on the Billing page.

- Base URL: `https://api.qualia.dev`
- Authentication: an API key in the `X-API-Key` header, or `Authorization: Bearer …`

## Parameters

- `limit` (query, integer): At most this many

  ```yaml
  type: integer
  maximum: 100
  minimum: 1
  default: 24
  ```

## Responses

- `200` Successful Response: `application/json` `BillingInvoices`
- `401` Invalid or missing API key: `application/json` `ErrorResponse`
- `403` The key lacks credits:read or is restricted to workspaces: `application/json` `ErrorResponse`
- `404` Billing is off on this deployment: `application/json` `ErrorResponse`
- `422` Validation Error: `application/json` `HTTPValidationError`

## Schemas

```yaml
BillingInvoices:
  properties:
    account_id:
      type: string
    invoices:
      items:
        $ref: "#/components/schemas/BillingInvoice"
      type: array
  type: object
  required:
    - account_id
    - invoices
  title: BillingInvoices
  description: The organization's invoices, newest first.
BillingInvoice:
  properties:
    id:
      type: string
    number:
      type:
        - string
        - "null"
    created:
      type: string
      format: date-time
    period_start:
      type: string
      format: date-time
    period_end:
      type: string
      format: date-time
    status:
      type: string
      enum:
        - draft
        - open
        - paid
        - void
        - uncollectible
    amount_due_usd:
      type: string
      pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
    amount_paid_usd:
      type: string
      pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
    total_usd:
      type: string
      pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
    description:
      type:
        - string
        - "null"
    hosted_invoice_url:
      type:
        - string
        - "null"
    invoice_pdf:
      type:
        - string
        - "null"
  type: object
  required:
    - id
    - created
    - period_start
    - period_end
    - status
    - amount_due_usd
    - amount_paid_usd
    - total_usd
  title: BillingInvoice
  description: "One invoice: its amounts in dollars, its status and its PDF."
ErrorResponse:
  properties:
    detail:
      type: string
      description: Error message describing what went wrong
  type: object
  required:
    - detail
  title: ErrorResponse
  description: Standard error response.
HTTPValidationError:
  properties:
    detail:
      items:
        $ref: "#/components/schemas/ValidationError"
      type: array
  type: object
  title: HTTPValidationError
ValidationError:
  properties:
    loc:
      items:
        type:
          - string
          - integer
      type: array
      title: Location
    msg:
      type: string
      title: Message
    type:
      type: string
      title: Error Type
    input: {}
    ctx:
      type: object
      title: Context
  type: object
  required:
    - loc
    - msg
    - type
  title: ValidationError
```
