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

# List invoices

> Returns a list of invoices for a billing account. Invoices are returned in reverse chronological order.



## OpenAPI

````yaml /api/en/workspaces.yaml get /workspaces/{workspaceId}/billing-accounts/{billingAccountId}/invoices
openapi: 3.0.3
info:
  title: Altostrat Workspaces API
  version: 1.0.0
  description: >-
    The Altostrat Workspaces API is the microservice responsible for tenancy,
    billing, user identity, and organizational hierarchy.

    It serves as the foundational layer for all multi-tenancy and subscription
    logic within the Altostrat SDX platform, enabling the secure separation of
    customer data and resources for SD-WAN, network automation, and agentic AI
    features.

    This API allows you to programmatically manage:

    - **Workspaces:** The top-level containers for all tenant resources, users,
    and billing configurations.

    - **Organizations:** Hierarchical entities used to model customer tenants or
    business units, track resource usage, and apply limits.

    - **Billing & Subscriptions:** The financial accounts and Stripe-powered
    subscriptions that govern access to Altostrat SDX features and resources.

    - **Members & Access:** The users and their specific roles (Owner, Admin,
    Viewer) within a workspace.

    Developers use this API to build the structural foundation and manage the
    billing lifecycle upon which all other Altostrat SDX automation and AI
    features operate.
servers:
  - url: https://v1.api.altostrat.io
    description: Production API Server
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: Manage workspaces, the top-level containers for all resources.
  - name: Workspace Members
    description: Manage user access and roles within a workspace.
  - name: Organizations
    description: Manage hierarchical organizations for tenancy and resource segmentation.
  - name: Billing Accounts
    description: Manage financial accounts linked to Stripe for billing and subscriptions.
  - name: Subscriptions
    description: Manage product subscriptions powered by Stripe.
  - name: Invoices
    description: Retrieve invoice history and preview upcoming billing changes.
  - name: Payment Methods
    description: Manage customer payment methods for subscriptions.
  - name: Public
    description: Unauthenticated endpoints for retrieving public organization information.
paths:
  /workspaces/{workspaceId}/billing-accounts/{billingAccountId}/invoices:
    get:
      tags:
        - Invoices
      summary: List invoices
      description: >-
        Returns a list of invoices for a billing account. Invoices are returned
        in reverse chronological order.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/BillingAccountId'
        - name: limit
          in: query
          description: >-
            A limit on the number of objects to be returned. Limit can range
            between 1 and 200, and the default is 100.
          schema:
            type: integer
            default: 100
        - name: after
          in: query
          description: >-
            A cursor for use in pagination. `after` is an object ID that defines
            your place in the list. For instance, if you make a list request and
            receive 100 objects, ending with `inv_...`, your subsequent call can
            include `after=inv_...` in order to fetch the next page of the list.
          schema:
            type: string
        - name: before
          in: query
          description: >-
            A cursor for use in pagination. `before` is an object ID that
            defines your place in the list. For instance, if you make a list
            request and receive 100 objects, starting with `inv_...`, your
            subsequent call can include `before=inv_...` in order to fetch the
            previous page of the list.
          schema:
            type: string
      responses:
        '200':
          description: A list of invoice objects.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/StripeInvoice'
                  has_more:
                    type: boolean
                  next_cursor:
                    type: string
                    nullable: true
                  previous_cursor:
                    type: string
                    nullable: true
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    WorkspaceId:
      name: workspaceId
      in: path
      required: true
      description: The ID of the workspace.
      schema:
        type: string
        example: ws_a1b2c3d4e5f6g7h8
    BillingAccountId:
      name: billingAccountId
      in: path
      required: true
      description: >-
        The ID of the billing account, which corresponds to a Stripe Customer ID
        (`cus_...`).
      schema:
        type: string
        example: cus_a1b2c3d4e5f6g7h8
  schemas:
    StripeInvoice:
      type: object
      properties:
        id:
          type: string
          example: in_1Kb...
        customer_id:
          type: string
          example: cus_...
        status:
          type: string
          example: paid
        amount_due:
          type: integer
          description: Final amount due in the smallest currency unit (e.g., cents).
          example: 999
        amount_paid:
          type: integer
          description: The amount paid on this invoice in the smallest currency unit.
          example: 999
        currency:
          type: string
          example: usd
        created_at:
          type: string
          format: date-time
          example: '2025-10-29T00:40:06.000000Z'
        subtotal:
          type: integer
          description: Total of all line items before discounts and taxes.
          example: 1099
        total:
          type: integer
          description: Total after discounts and taxes.
          example: 999
        tax:
          type: integer
          nullable: true
          description: The amount of tax on this invoice.
          example: 0
        discount_amount:
          type: integer
          nullable: true
          description: The total discount amount applied to this invoice.
          example: 100
        discount_names:
          type: array
          items:
            type: string
          example:
            - 10% Off Coupon
        lines:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineItem'
        due_date:
          type: string
          format: date-time
          nullable: true
          example: null
        hosted_invoice_url:
          type: string
          format: uri
          nullable: true
          example: https://invoice.stripe.com/...
        invoice_pdf:
          type: string
          format: uri
          nullable: true
          example: https://pay.stripe.com/...
        number:
          type: string
          nullable: true
          example: AB123-001
    InvoiceLineItem:
      type: object
      properties:
        id:
          type: string
          example: il_1Kb...
        description:
          type: string
          example: 10 × Locations
        amount:
          type: integer
          description: The total amount for this line item in the smallest currency unit.
          example: 1000
        currency:
          type: string
          example: usd
        quantity:
          type: integer
          example: 10
        price_id:
          type: string
          nullable: true
          example: price_...
        unit_amount:
          type: integer
          nullable: true
          description: The unit amount in the smallest currency unit.
          example: 100
        product_name:
          type: string
          nullable: true
          example: Locations
  responses:
    Unauthorized:
      description: >-
        Unauthorized - The request was not authenticated. Ensure you have
        provided a valid Bearer token in the Authorization header.
    Forbidden:
      description: >-
        Forbidden - The authenticated user does not have permission to perform
        this action.
    NotFound:
      description: Not Found - The requested resource could not be found.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your JWT in the format: Bearer {token}'

````