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

# List billing entities

> Returns a cursor-paginated list ordered by creation time, newest first.

> [!NOTE]
>
> API v2 is in beta. Endpoints return the `X-Lago-Endpoint-Status: beta` header.


## OpenAPI

````yaml https://swagger.getlago.com/openapi-v2.yaml GET /billing_entities
openapi: 3.1.0
info:
  title: Lago API v2 documentation
  description: >-
    Lago API v2. Documents native v2 endpoints for the product catalog, billing,
    customers, organizations, billing entities, billable metrics, events,
    features, privileges, entitlements, wallets, alerts, logs and webhook
    endpoints. Paginated lists use cursor pagination. Some lists, such as rates
    and phases, return the complete list without pagination. Native v2 endpoints
    use opt-in relationship expansions and structured error responses. Only the
    documented actions and expansions are supported. Some other /api/v2 paths
    still fall back to v1 controllers and are not described here.
  version: 2.0.0-beta
  license:
    name: AGPLv3
    url: https://github.com/getlago/lago-openapi/blob/main/LICENSE
  contact:
    email: tech@getlago.com
servers:
  - url: https://api.getlago.com/api/v2
    description: US Lago cluster
  - url: https://api.eu.getlago.com/api/v2
    description: EU Lago cluster
security:
  - bearerAuth: []
tags:
  - name: taxes
    description: Tax rates
  - name: product_categories
    description: product categories operations
  - name: products
    description: products operations
  - name: product_filters
    description: product filters operations
  - name: rate_cards
    description: rate cards operations
  - name: rate_card_rates
    description: rate card rates operations
  - name: catalog_plans
    description: catalog plans operations
  - name: plan_applied_rate_cards
    description: plan applied rate cards operations
  - name: plan_rate_phases
    description: plan rate phases operations
  - name: contract_applied_rate_cards
    description: contract applied rate cards operations
  - name: contract_rate_phases
    description: contract rate phases operations
  - name: contracts
    description: contracts operations
  - name: invoices
    description: invoices operations
  - name: fees
    description: fees operations
  - name: payments
    description: payments operations
  - name: payment_requests
    description: payment requests operations
  - name: payment_receipts
    description: payment receipts operations
  - name: credit_notes
    description: credit notes operations
  - name: customers
    description: customers operations
  - name: organizations
    description: Organization operations
  - name: billing_entities
    description: billing entities operations
  - name: billable_metrics
    description: billable metrics operations
  - name: events
    description: Event operations
  - name: activity_logs
    description: activity logs operations
  - name: api_logs
    description: api logs operations
  - name: security_logs
    description: security logs operations
  - name: webhook_endpoints
    description: webhook endpoints operations
  - name: features
    description: features operations
  - name: feature_privileges
    description: feature privileges operations
  - name: plan_wallets
    description: plan wallets operations
  - name: contract_wallets
    description: contract wallets operations
  - name: contract_wallet_transactions
    description: contract wallet transactions operations
  - name: plan_wallet_alerts
    description: plan wallet alerts operations
  - name: contract_wallet_alerts
    description: contract wallet alerts operations
  - name: contract_alerts
    description: contract alerts operations
  - name: plan_entitlements
    description: plan entitlements operations
  - name: contract_entitlements
    description: contract entitlements operations
externalDocs:
  description: Lago documentation
  url: https://getlago.com/docs
paths:
  /billing_entities:
    get:
      tags:
        - billing_entities
      summary: List billing entities
      description: >-
        Returns a cursor-paginated list ordered by creation time, newest first.
        Use after or before to navigate. The page and per_page parameters are
        rejected.

        Lists active billing entities only.

        Requires the product catalog to be enabled and billing_entity read
        permission on the API key.
      operationId: findAllBillingEntities
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/after'
        - $ref: '#/components/parameters/before'
        - $ref: '#/components/parameters/include_total_count'
        - $ref: '#/components/parameters/created_at_from'
        - $ref: '#/components/parameters/created_at_to'
      responses:
        '200':
          description: Successful response
          headers:
            X-Lago-Endpoint-Status:
              $ref: '#/components/headers/EndpointStatus'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingEntitiesPaginated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  parameters:
    limit:
      name: limit
      in: query
      description: >-
        Maximum number of records per page. Values outside the supported range
        return 400.
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
        example: 20
    after:
      name: after
      in: query
      description: >-
        Opaque next_cursor from a previous response. Returns the next page.
        Cannot be combined with before or include_total_count=true. Keep the
        same filters when paging.
      required: false
      schema:
        type: string
        example: >-
          eyJ2IjoxLCJvIjp7InQiOiJ0YXhlcyIsInMiOiJjcmVhdGVkX2F0OmRlc2MsaWQ6ZGVzYyJ9LCJrIjpbIjIwMjItMDQtMjlUMDg6NTk6NTEuMDAwMDAwWiIsIjFhOTAxYTkwLTFhOTAtMWE5MC0xYTkwLTFhOTAxYTkwMWE5MCJdfQ
    before:
      name: before
      in: query
      description: >-
        Opaque prev_cursor from a previous response. Returns the previous page
        in the same list order. Cannot be combined with after or
        include_total_count=true. Keep the same filters when paging.
      required: false
      schema:
        type: string
        example: >-
          eyJ2IjoxLCJvIjp7InQiOiJ0YXhlcyIsInMiOiJjcmVhdGVkX2F0OmRlc2MsaWQ6ZGVzYyJ9LCJrIjpbIjIwMjItMDQtMjlUMDg6NTk6NTEuMDAwMDAwWiIsIjFhOTAxYTkwLTFhOTAtMWE5MC0xYTkwLTFhOTAxYTkwMWE5MCJdfQ
    include_total_count:
      name: include_total_count
      in: query
      description: >-
        Requests the total number of matching records. Supported only on the
        first page, without after or before. The count can be estimated;
        total_count_estimated is then present and true.
      required: false
      schema:
        type: boolean
        default: false
        example: true
    created_at_from:
      name: created_at_from
      in: query
      description: >-
        Inclusive lower bound on the creation time, as an ISO 8601 date or
        timestamp. A date starts at midnight UTC. Invalid values return 422.
      required: false
      schema:
        type: string
        example: '2022-04-01T00:00:00Z'
    created_at_to:
      name: created_at_to
      in: query
      description: >-
        Inclusive upper bound on the creation time, as an ISO 8601 date or
        timestamp. A date includes that whole UTC day. Invalid values return
        422.
      required: false
      schema:
        type: string
        example: '2022-04-30T23:59:59Z'
  headers:
    EndpointStatus:
      description: Indicates that the endpoint is in beta.
      schema:
        type: string
        enum:
          - beta
        example: beta
  schemas:
    BillingEntitiesPaginated:
      type: object
      description: billing entities list.
      required:
        - billing_entities
        - meta
      properties:
        billing_entities:
          type: array
          description: Records in this response.
          items:
            $ref: '#/components/schemas/BillingEntityObject'
        meta:
          $ref: '#/components/schemas/CursorPaginationMeta'
    BillingEntityObject:
      type: object
      description: Billing Entity.
      required:
        - code
        - name
        - default_currency
        - country
        - address_line1
        - address_line2
        - phone
        - city
        - state
        - zipcode
        - einvoicing
        - email
        - legal_name
        - legal_number
        - timezone
        - email_settings
        - document_numbering
        - document_number_prefix
        - tax_identification_number
        - finalize_zero_amount_invoice
        - invoice_footer
        - invoice_grace_period
        - document_locale
        - eu_tax_management
        - periodic_invoice_issuing_date_anchor
        - periodic_invoice_issuing_date_adjustment
        - lago_id
        - is_default
        - logo_url
        - created_at
        - updated_at
        - archived_at
        - deleted_at
      properties:
        code:
          type: string
          description: Code.
          example: example
        name:
          type: string
          description: Name.
          example: example
        default_currency:
          type: string
          description: Default currency.
          example: example
        country:
          type:
            - string
            - 'null'
          description: Country.
          example: example
        address_line1:
          type:
            - string
            - 'null'
          description: Address line1.
          example: example
        address_line2:
          type:
            - string
            - 'null'
          description: Address line2.
          example: example
        phone:
          type:
            - string
            - 'null'
          description: Phone.
          example: example
        city:
          type:
            - string
            - 'null'
          description: City.
          example: example
        state:
          type:
            - string
            - 'null'
          description: State.
          example: example
        zipcode:
          type:
            - string
            - 'null'
          description: Zipcode.
          example: example
        einvoicing:
          type: boolean
          description: Einvoicing.
          example: false
        email:
          type:
            - string
            - 'null'
          description: Email.
          example: billing@acme.example
        legal_name:
          type:
            - string
            - 'null'
          description: Legal name.
          example: example
        legal_number:
          type:
            - string
            - 'null'
          description: Legal number.
          example: example
        timezone:
          type: string
          description: Timezone.
          example: example
        email_settings:
          type: array
          description: Enabled email notification types.
          items:
            type: string
            description: Enabled email notification types.
            example: invoice.finalized
        document_numbering:
          type: string
          description: Document numbering scope.
          example: per_customer
          enum:
            - per_customer
            - per_billing_entity
        document_number_prefix:
          type:
            - string
            - 'null'
          description: Document number prefix.
          example: example
        tax_identification_number:
          type:
            - string
            - 'null'
          description: Tax identification number.
          example: example
        finalize_zero_amount_invoice:
          type: boolean
          description: Finalize zero amount invoice.
          example: false
        invoice_footer:
          type:
            - string
            - 'null'
          description: Invoice footer.
          example: Example
        invoice_grace_period:
          type: integer
          description: Invoice grace period.
          example: 1
        document_locale:
          type: string
          description: Document locale.
          example: example
        eu_tax_management:
          type:
            - boolean
            - 'null'
          description: Eu tax management.
          example: false
        periodic_invoice_issuing_date_anchor:
          type:
            - string
            - 'null'
          description: Date used to issue periodic invoices.
          example: current_period_end
          enum:
            - current_period_end
            - next_period_start
            - null
        periodic_invoice_issuing_date_adjustment:
          type:
            - string
            - 'null'
          description: Adjustment applied to periodic invoice issuing dates.
          example: keep_anchor
          enum:
            - keep_anchor
            - align_with_finalization_date
            - null
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        is_default:
          type: boolean
          description: Whether this is the organization default billing entity.
          example: false
        logo_url:
          type:
            - string
            - 'null'
          description: Logo URL.
          example: https://cdn.acme.example/logo.png
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        archived_at:
          type:
            - string
            - 'null'
          description: Archived at.
          example: null
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
        taxes:
          type: array
          description: Assigned taxes. Included only with expands[]=taxes.
          items:
            $ref: '#/components/schemas/TaxObject'
        selected_invoice_custom_sections:
          type: array
          description: >-
            Selected sections. Included only with
            expands[]=selected_invoice_custom_sections.
          items:
            $ref: '#/components/schemas/InvoiceCustomSectionObject'
    CursorPaginationMeta:
      type: object
      required:
        - next_cursor
        - prev_cursor
      dependentRequired:
        total_count_estimated:
          - total_count
      properties:
        next_cursor:
          type:
            - string
            - 'null'
          description: >-
            Opaque cursor to pass as after for the next page. It is null when
            there is no next page.
          example: null
        prev_cursor:
          type:
            - string
            - 'null'
          description: >-
            Opaque cursor to pass as before for the previous page. It is null
            when there is no previous page.
          example: null
        total_count:
          type: integer
          minimum: 0
          description: >-
            Number of matching records, returned only when include_total_count
            is true on the first page. The count can be estimated.
          example: 42
        total_count_estimated:
          type: boolean
          enum:
            - true
          description: >-
            Present and true only when total_count is an estimate. Omitted for
            an exact count.
          example: true
    ApiError:
      type: object
      required:
        - code
        - details
      properties:
        code:
          type: string
          pattern: ^[a-z][a-z0-9_]*$
          description: >-
            Code identifying the failure. The HTTP status is carried by the
            response, not the body.
          example: validation_errors
        details:
          type: array
          description: >-
            Details of the failure. The array is empty when no field details are
            available.
          items:
            type: object
            required:
              - code
              - field
              - meta
            properties:
              code:
                type: string
                pattern: ^[a-z][a-z0-9_]*$
                description: >-
                  Code identifying the field error or the reason a request
                  parameter was rejected.
                example: value_is_mandatory
              field:
                type: string
                description: >-
                  Request field or parameter. Nested fields use dots and
                  zero-based array indexes. A resource-level failure uses base.
                example: name
              meta:
                type: object
                description: >-
                  Information about the failure, such as the missing resource,
                  allowed values or bounds. The object is empty when no metadata
                  is available.
                additionalProperties: true
                example: {}
                properties:
                  min:
                    type: integer
                    description: Inclusive minimum value.
                    example: 0
                  max:
                    type: integer
                    description: Inclusive maximum value.
                    example: 100
                  min_length:
                    type: integer
                    description: Minimum string length, in characters.
                    example: 1
                  max_length:
                    type: integer
                    description: Maximum string length, in characters.
                    example: 255
                  max_items:
                    type: integer
                    description: Maximum number of items.
                    example: 100
                  allowed_values:
                    type: array
                    description: Values accepted for the field.
                    items:
                      type: string
                      description: Allowed value.
                      example: draft
                  invalid_values:
                    type: array
                    description: Values rejected by request validation.
                    items:
                      type: string
                      description: Rejected value.
                      example: unknown
                  value:
                    type: string
                    description: Query parameter value received.
                    example: unknown
                  resource:
                    type: string
                    description: Resource that could not be found.
                    example: customer
                  provider_name:
                    type: string
                    description: Name of the provider that failed.
                    example: stripe
                  provider_code:
                    type: string
                    description: Code of the provider connection.
                    example: stripe_eu
                  provider_error_code:
                    type: string
                    description: Error code returned by the provider.
                    example: resource_missing
    TaxObject:
      type: object
      required:
        - lago_id
        - name
        - code
        - rate
        - description
        - created_at
        - updated_at
        - deleted_at
      properties:
        lago_id:
          type: string
          format: uuid
          description: Unique identifier of the tax, created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
        name:
          type: string
          description: Name of the tax.
          example: VAT
        code:
          type: string
          description: Unique code of the tax within the organization.
          example: standard_vat
        rate:
          type: number
          description: Percentage rate of the tax, returned as a JSON number.
          example: 20
        description:
          type:
            - string
            - 'null'
          description: Internal description of the tax.
          example: Standard VAT
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          format: date-time
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T09:30:00.123456Z'
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            UTC deletion timestamp, with microsecond precision. It is null until
            the tax is deleted.
          example: null
      example:
        lago_id: 1a901a90-1a90-1a90-1a90-1a901a901a90
        name: VAT
        code: standard_vat
        rate: 20
        description: Standard VAT
        created_at: '2022-04-29T08:59:51.123456Z'
        updated_at: '2022-04-29T09:30:00.123456Z'
        deleted_at: null
    InvoiceCustomSectionObject:
      type: object
      description: Invoice Custom Section.
      required:
        - lago_id
        - code
        - name
        - description
        - details
        - display_name
        - created_at
        - updated_at
        - deleted_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        code:
          type: string
          description: Code.
          example: example
        name:
          type: string
          description: Name.
          example: example
        description:
          type:
            - string
            - 'null'
          description: Description.
          example: example
        details:
          type:
            - string
            - 'null'
          description: Details.
          example: example
        display_name:
          type:
            - string
            - 'null'
          description: Display name.
          example: example
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
  responses:
    BadRequest:
      description: Invalid request body, pagination or relationship expansion
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: invalid_expand
            details:
              - code: malformed
                field: expands
                meta:
                  allowed_values: []
    Unauthorized:
      description: Missing or invalid API key
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: unauthorized
            details: []
    Forbidden:
      description: Feature unavailable or insufficient API permissions
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: feature_unavailable
            details: []
    UnprocessableEntity:
      description: Invalid fields or filters
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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