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

# List revenue items

> Lists the revenue that the revenue traceabilities tag in a period of up to three months, ordered by the start date of the revenue traceability, the most recent first. Each revenue traceability whose dates overlap the period gives one item for each month and billing account of the invoices of its contract that were issued and are not canceled, in the status issued, synced, pending, paid, overdue or failed, and dated both in the period and inside the dates of the revenue traceability. The item sums, in cents, the line items of the product of the revenue traceability on those invoices. A revenue traceability with no such invoice gives one item with an amount of zero.

Requires the role `contracts:admin`.



## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/revenue-items/
openapi: 3.1.0
info:
  title: API Reference
  version: '1.0'
  description: Aira API Reference
  x-logo:
    url: https://static.useaira.com/images/airalogo.svg
    backgroundColor: '#FFFFFF'
    altText: Aira Logo
servers:
  - url: https://api.useaira.com
    description: API base URL
security:
  - ApiKey: []
paths:
  /v1/revenue-items/:
    get:
      tags:
        - Revenue Traceability
      summary: List revenue items
      description: >-
        Lists the revenue that the revenue traceabilities tag in a period of up
        to three months, ordered by the start date of the revenue traceability,
        the most recent first. Each revenue traceability whose dates overlap the
        period gives one item for each month and billing account of the invoices
        of its contract that were issued and are not canceled, in the status
        issued, synced, pending, paid, overdue or failed, and dated both in the
        period and inside the dates of the revenue traceability. The item sums,
        in cents, the line items of the product of the revenue traceability on
        those invoices. A revenue traceability with no such invoice gives one
        item with an amount of zero.


        Requires the role `contracts:admin`.
      parameters:
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}$
          example: 2026-01
          in: query
          name: period.gte
          required: true
          description: The first month of the period, as YYYY-MM.
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}$
          example: 2026-03
          in: query
          name: period.lte
          required: true
          description: >-
            The last month of the period, as YYYY-MM, at most two months after
            period.gte.
        - schema:
            type: integer
            default: 0
            minimum: 0
            maximum: 2147483647
          in: query
          name: offset
          required: false
          description: Number of items to skip before collecting the page.
        - schema:
            type: integer
            minimum: 1
            default: 100
            maximum: 200
          in: query
          name: limit
          required: false
          description: Maximum number of items to return per page.
      responses:
        '200':
          description: >-
            The revenue items of the period, ordered by the start date of their
            revenue traceability, the most recent first.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      description: >-
                        The revenue that one revenue traceability tags in one
                        month, from the invoices of one billing account.
                      properties:
                        period:
                          type: string
                          pattern: ^\d{4}-\d{2}$
                          description: >-
                            The month of the item, as YYYY-MM: the month of its
                            invoices, or, for an item with no invoice, the later
                            of the month in which the revenue traceability
                            starts and the first month of the period.
                          example: 2026-02
                        proposal:
                          type: string
                          description: >-
                            The value of the proposal custom field of the
                            revenue traceability. An empty string when the
                            revenue traceability has none.
                          example: PROP-2026-014
                        amountCents:
                          type: number
                          description: >-
                            The sum, in cents, of the line items of the product
                            on the invoices of the item. Zero for an item with
                            no invoice.
                        customer:
                          type: object
                          description: >-
                            The customer of the contract, with the name and the
                            tax id of the billing account of the invoices of the
                            item.
                          properties:
                            id:
                              description: >-
                                The unique identifier of the customer in our
                                system.
                              type: string
                              format: uuid
                            name:
                              type: string
                              description: >-
                                The business name of the billing account of the
                                invoices. An empty string for an item with no
                                invoice.
                              example: Padaria Central Ltda
                            externalId:
                              type: string
                              description: >-
                                The unique identifier of the customer in your
                                system.
                              example: 705faf65-9c8b-4053-8c0b-2021281ce83f
                            taxId:
                              type: string
                              description: >-
                                The tax id of the billing account of the
                                invoices. An empty string for an item with no
                                invoice.
                              example: '01234567000195'
                            taxIdType:
                              type: string
                              enum:
                                - cnpj
                                - cpf
                              description: >-
                                The type of the tax id of the billing account of
                                the invoices, or cpf for an item with no
                                invoice.
                          required:
                            - id
                            - name
                            - externalId
                            - taxId
                            - taxIdType
                          additionalProperties: false
                        product:
                          type: object
                          description: >-
                            The product whose revenue the revenue traceability
                            tags.
                          properties:
                            id:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the product in our
                                system.
                            name:
                              type: string
                              description: The name of the product.
                              example: Platform subscription
                            customFields:
                              type: object
                              description: >-
                                The values of the custom fields of products on
                                the product, keyed by the key of each custom
                                field.
                              additionalProperties:
                                anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      type: string
                              default: {}
                              example:
                                customField1: value1
                                customField2:
                                  - value2
                                  - value3
                          required:
                            - id
                            - name
                            - customFields
                          additionalProperties: false
                      required:
                        - period
                        - proposal
                        - amountCents
                        - customer
                        - product
                      additionalProperties: false
                    description: A list of items.
                  hasMore:
                    description: Indicates if there are more items to fetch.
                    type: boolean
                required:
                  - items
                  - hasMore
                additionalProperties: false
        '400':
          description: >-
            The request cannot succeed as sent.


            - `json_schema_validation_error`: a query parameter breaks the
            schema of the endpoint.

            - `invalid_period_range`: the `period.lte` is more than two months
            after the `period.gte`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - json_schema_validation_error
                      - invalid_period_range
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                json_schema_validation_error:
                  value:
                    message: '''period.gte'' must be string'
                    code: json_schema_validation_error
                invalid_period_range:
                  value:
                    message: occurredAt.gte must not be after occurredAt.lte
                    code: invalid_period_range
        '401':
          description: >-
            The request carries no API key.


            - `no_authorization`: the request carries no API key in the
            `X-API-KEY` header.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - no_authorization
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                no_authorization:
                  value:
                    message: No authorization provided
                    code: no_authorization
        '403':
          description: >-
            The API key cannot call the endpoint.


            - `bad_auth`: the API key does not hold the role that the endpoint
            requires.

            - `invalid_api_key`: the API key does not exist.

            - `deactivated_api_key`: the API key is deactivated.

            - `revoked_api_key`: the API key is revoked.

            - `expired_api_key`: the API key is past its expiry date.

            - `ip_not_allowed`: the tenant does not allow the IP of the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - bad_auth
                      - invalid_api_key
                      - deactivated_api_key
                      - revoked_api_key
                      - expired_api_key
                      - ip_not_allowed
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                bad_auth:
                  value:
                    message: role contracts:admin can not be satisfied
                    code: bad_auth
                invalid_api_key:
                  value:
                    message: Invalid API key
                    code: invalid_api_key
                deactivated_api_key:
                  value:
                    message: Deactivated API key
                    code: deactivated_api_key
                revoked_api_key:
                  value:
                    message: Revoked API key
                    code: revoked_api_key
                expired_api_key:
                  value:
                    message: Expired API key
                    code: expired_api_key
                ip_not_allowed:
                  value:
                    message: IP not allowed
                    code: ip_not_allowed
        '429':
          description: >-
            The tenant reached one of its limits of reads.


            - `too_many_reads_per_second`: the tenant already made 50 reads in
            this second.

            - `too_many_reads_in_flight`: the tenant already has 20 reads in
            flight.
          headers:
            Retry-After:
              schema:
                type: integer
              description: The seconds to wait before the next read.
            RateLimit-Limit:
              schema:
                type: integer
              description: >-
                The limit that the read hit: 20 for the reads in flight, 50 for
                the reads per second.
            RateLimit-Remaining:
              schema:
                type: integer
              description: The reads left under that limit, which is 0.
            RateLimit-Reset:
              schema:
                type: integer
              description: >-
                The seconds to wait before the next read, as in Retry-After. The
                limit of reads per second takes new reads in the next second,
                but the limit of reads in flight takes a new read only once one
                of the reads in flight ends.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - too_many_reads_per_second
                      - too_many_reads_in_flight
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                too_many_reads_per_second:
                  value:
                    message: >-
                      Too many reads: a tenant can make at most 50 reads per
                      second. Retry after 1 second.
                    code: too_many_reads_per_second
                too_many_reads_in_flight:
                  value:
                    message: >-
                      Too many reads in flight: a tenant can have at most 20
                      reads in flight. Retry after 1 second.
                    code: too_many_reads_in_flight
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      description: API Key Authentication.
      name: X-API-KEY
      in: header

````

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