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

# Get payables analytics

> Retrieve aggregated statistics for payables, including total amount and count, both overall and by status.

For more flexible configuration and retrieval of other data types, use `GET /analytics/payables`.



## OpenAPI

````yaml /.tooling/schemas/rest/tags/product-finops.json get /finops/v1/payables/analytics
openapi: 3.1.0
info:
  title: Tesouro Partner API
  version: '2025-06-23'
  description: The Tesouro REST API, for Tesouro partners to integrate with our solution.
  termsOfService: https://tesouro.com/terms
  contact:
    name: Tesouro team
    url: https://tesouro.com/about/
    email: developers@tesouro.com
servers:
  - url: https://api.sandbox.tesouro.com
    description: Sandbox
security: []
tags:
  - name: Accounting connections
  - name: Accounting data pull
  - name: Accounting synchronized records
  - name: Accounting tax rates
  - name: Analytics
  - name: Approval policies
  - name: Approval requests
  - name: Bank details
  - name: Comments
  - name: Cost centers
  - name: Counterpart VAT IDs
  - name: Counterpart addresses
  - name: Counterpart bank accounts
  - name: Counterpart contacts
  - name: Counterparts
  - name: Credit notes
  - name: Custom tax rates
  - name: Delivery notes
  - name: Documents
  - name: Entities
  - name: Entity users
  - name: Events
  - name: Files
  - name: Identity
  - name: Ledger accounts
  - name: Mail templates
  - name: Mailbox domains
  - name: Mailboxes
  - name: Measure units
  - name: OCR
  - name: Overdue reminders
  - name: PDF templates
  - name: Payable line items
  - name: Payables
  - name: Payment intents
  - name: Payment links
  - name: Payment methods
  - name: Payment records
  - name: Payment reminders
  - name: Payment terms
  - name: Products
  - name: Projects
  - name: Purchase orders
  - name: Receipts
  - name: Receivables
  - name: Recurrences
  - name: Tags
  - name: Text templates
  - name: Transactions
  - name: VAT rates
  - name: Webhook deliveries
  - name: Webhook subscriptions
paths:
  /finops/v1/payables/analytics:
    get:
      tags:
        - Payables
      summary: Get payables analytics
      description: >-
        Retrieve aggregated statistics for payables, including total amount and
        count, both overall and by status.


        For more flexible configuration and retrieval of other data types, use
        `GET /analytics/payables`.
      operationId: get_payables_analytics
      parameters:
        - required: true
          schema:
            type: string
            format: date
          example: '2025-06-23'
          name: x-finops-version
          in: header
        - description: >-
            Return only payables created in Monite after the specified date and
            time. The value must be in the ISO 8601 format
            YYYY-MM-DDThh:mm[:ss[.ffffff]][Z|±hh:mm].
          required: false
          schema:
            type: string
            format: date-time
          name: created_at__gt
          in: query
        - description: >-
            Return only payables created in Monite before the specified date and
            time.
          required: false
          schema:
            type: string
            format: date-time
          name: created_at__lt
          in: query
        - description: >-
            Return only payables created in Monite on or after the specified
            date and time.
          required: false
          schema:
            type: string
            format: date-time
          name: created_at__gte
          in: query
        - description: >-
            Return only payables created in Monite before or on the specified
            date and time.
          required: false
          schema:
            type: string
            format: date-time
          name: created_at__lte
          in: query
        - description: >-
            Return only payables that have the specified
            [status](https://docs.monite.com/accounts-payable/payables/index).


            To query multiple statuses at once, use the `status__in` parameter
            instead.
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/PayableStateEnum'
          name: status
          in: query
        - description: >-
            Return only payables that have the specified
            [statuses](https://docs.monite.com/accounts-payable/payables/index).


            To specify multiple statuses, repeat this parameter for each value:
            `status__in=draft&status__in=new`
          required: false
          schema:
            items:
              $ref: '#/components/schemas/PayableStateEnum'
            type: array
          name: status__in
          in: query
        - description: >-
            Return only payables with specified IDs. Valid but nonexistent IDs
            do not raise errors but produce no results.


            To specify multiple IDs, repeat this parameter for each value:
            `id__in=<id1>&id__in=<id2>`
          required: false
          schema:
            items:
              type: string
              format: uuid
            type: array
          name: id__in
          in: query
        - description: >-
            Return only payables with the exact specified total amount. The
            amount must be specified in the minor units of currency. For
            example, $12.5 is represented as 1250.
          required: false
          schema:
            type: integer
          name: total_amount
          in: query
        - description: >-
            Return only payables whose total amount (in minor units) exceeds the
            specified value.
          required: false
          schema:
            type: integer
          name: total_amount__gt
          in: query
        - description: >-
            Return only payables whose total amount (in minor units) is less
            than the specified value.
          required: false
          schema:
            type: integer
          name: total_amount__lt
          in: query
        - description: >-
            Return only payables whose total amount (in minor units) is greater
            than or equal to the specified value.
          required: false
          schema:
            type: integer
          name: total_amount__gte
          in: query
        - description: >-
            Return only payables whose total amount (in minor units) is less
            than or equal to the specified value.
          required: false
          schema:
            type: integer
          name: total_amount__lte
          in: query
        - description: Return only payables with the specified amount.
          required: false
          schema:
            type: integer
          name: amount
          in: query
        - description: >-
            Return only payables whose amount (in minor units) exceeds the
            specified value.
          required: false
          schema:
            type: integer
          name: amount__gt
          in: query
        - description: >-
            Return only payables whose amount (in minor units) is less than the
            specified value.
          required: false
          schema:
            type: integer
          name: amount__lt
          in: query
        - description: >-
            Return only payables whose amount (in minor units) is greater than
            or equal to the specified value.
          required: false
          schema:
            type: integer
          name: amount__gte
          in: query
        - description: >-
            Return only payables whose amount (in minor units) is less than or
            equal to the specified value.
          required: false
          schema:
            type: integer
          name: amount__lte
          in: query
        - description: Return only payables that use the specified currency.
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/CurrencyEnum'
          name: currency
          in: query
        - description: >-
            Return only payables received from counterparts with the specified
            name (exact match, case-sensitive).


            For counterparts of `type = individual`, the full name is formatted
            as `first_name last_name`.
          required: false
          schema:
            type: string
          name: counterpart_name
          in: query
        - description: >-
            Return only payables received from counterparts whose name contains
            the specified string (case-sensitive).
          required: false
          schema:
            type: string
          name: counterpart_name__contains
          in: query
        - description: >-
            Return only payables received from counterparts whose name contains
            the specified string (case-insensitive).
          required: false
          schema:
            type: string
          name: counterpart_name__icontains
          in: query
        - description: >-
            Apply the `icontains` condition to search for the specified text in
            the `document_id` and `counterpart_name` fields in the payables.
          required: false
          schema:
            type: string
          name: search_text
          in: query
        - description: Return payables that are due on the specified date (YYYY-MM-DD)
          required: false
          schema:
            type: string
            format: date
          name: due_date
          in: query
        - description: >-
            Return payables that are due after the specified date (exclusive,
            YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
          name: due_date__gt
          in: query
        - description: >-
            Return payables that are due before the specified date (exclusive,
            YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
          name: due_date__lt
          in: query
        - description: >-
            Return payables that are due on or after the specified date
            (YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
          name: due_date__gte
          in: query
        - description: >-
            Return payables that are due before or on the specified date
            (YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
          name: due_date__lte
          in: query
        - description: Return payables that are issued at the specified date (YYYY-MM-DD)
          required: false
          schema:
            type: string
            format: date
          name: issued_at
          in: query
        - description: >-
            Return payables that are issued after the specified date (exclusive,
            YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
          name: issued_at__gt
          in: query
        - description: >-
            Return payables that are issued before the specified date
            (exclusive, YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
          name: issued_at__lt
          in: query
        - description: >-
            Return payables that are issued on or after the specified date
            (YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
          name: issued_at__gte
          in: query
        - description: >-
            Return payables that are issued before or on the specified date
            (YYYY-MM-DD).
          required: false
          schema:
            type: string
            format: date
          name: issued_at__lte
          in: query
        - description: >-
            Return a payable with the exact specified document number
            (case-sensitive).


            The `document_id` is the user-facing document number such as
            INV-00042, not to be confused with Monite resource IDs (`id`).
          required: false
          schema:
            type: string
          name: document_id
          in: query
        - description: >-
            Return only payables whose document number (`document_id`) contains
            the specified string (case-sensitive).
          required: false
          schema:
            type: string
          name: document_id__contains
          in: query
        - description: >-
            Return only payables whose document number (`document_id`) contains
            the specified string (case-insensitive).
          required: false
          schema:
            type: string
          name: document_id__icontains
          in: query
        - description: >-
            Return only payables created in Monite by the entity user with the
            specified ID.
          required: false
          schema:
            type: string
            format: uuid
          name: was_created_by_user_id
          in: query
        - description: >-
            Return only payables received from the counterpart with the
            specified ID.


            Counterparts that have been deleted but have associated payables
            will still return results here because the payables contain a frozen
            copy of the counterpart data.


            If the specified counterpart ID does not exist and never existed, no
            results are returned.
          required: false
          schema:
            type: string
            format: uuid
          name: counterpart_id
          in: query
        - description: >-
            Return only payables received from the counterparts with the
            specified IDs. Valid but nonexistent IDs do not raise errors but
            produce no results.


            To specify multiple IDs, repeat this parameter for each value:
            `counterpart_id__in=<id1>&counterpart_id__in=<id2>`
          required: false
          schema:
            items:
              type: string
              format: uuid
            type: array
          name: counterpart_id__in
          in: query
        - description: Return only payables coming from the specified source.
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/SourceOfPayableDataEnum'
          name: source_of_payable_data
          in: query
        - description: Return only payables with specific OCR statuses.
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/OcrStatusEnum'
          name: ocr_status
          in: query
        - description: >-
            Search for a payable by the identifier of the line item associated
            with it.
          required: false
          schema:
            type: string
            format: uuid
          name: line_item_id
          in: query
        - description: >-
            Search for a payable by the identifier of the purchase order
            associated with it.
          required: false
          schema:
            type: string
            format: uuid
          name: purchase_order_id
          in: query
        - description: >-
            Return only payables assigned to the project with the specified ID.


            Valid but nonexistent project IDs do not raise errors but return no
            results.
          required: false
          schema:
            type: string
            format: uuid
          name: project_id
          in: query
        - description: >-
            Return only payables whose `project_id` include at least one of the
            project_id with the specified IDs. Valid but nonexistent project IDs
            do not raise errors but produce no results.
          required: false
          schema:
            items:
              type: string
              format: uuid
            type: array
          name: project_id__in
          in: query
        - description: >-
            Return only payables whose `tags` include at least one of the tags
            with the specified IDs. Valid but nonexistent tag IDs do not raise
            errors but produce no results.
          required: false
          schema:
            items:
              type: string
              format: uuid
            type: array
          name: tag_ids
          in: query
        - description: >-
            Return only payables whose `tags` do not include any of the tags
            with the specified IDs. Valid but nonexistent tag IDs do not raise
            errors but produce the results.
          required: false
          schema:
            items:
              type: string
              format: uuid
            type: array
          name: tag_ids__not_in
          in: query
        - description: >-
            Filter objects based on whether they have tags. If true, only
            objects with tags are returned. If false, only objects without tags
            are returned.
          required: false
          schema:
            type: boolean
          name: has_tags
          in: query
        - description: Return only payables from a given origin ['upload', 'email']
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/PayableOriginEnum'
          name: origin
          in: query
        - description: Return only payables with or without attachments (files)
          required: false
          schema:
            type: boolean
          name: has_file
          in: query
        - description: The ID of the entity that owns the requested resource.
          required: true
          schema:
            type: string
            format: uuid
            examples:
              - 9d2b4c8f-2087-4738-ba91-7359683c49a4
          name: x-organization-id
          in: header
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayableAggregatedDataResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
      deprecated: true
      security:
        - HTTPBearer: []
components:
  schemas:
    PayableStateEnum:
      type: string
      enum:
        - draft
        - new
        - approve_in_progress
        - waiting_to_be_paid
        - partially_paid
        - paid
        - canceled
        - rejected
    CurrencyEnum:
      type: string
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BTN
        - BWP
        - BYN
        - BZD
        - CAD
        - CDF
        - CHF
        - CLP
        - CNY
        - COP
        - CRC
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - ISK
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SEK
        - SGD
        - SHP
        - SLE
        - SOS
        - SRD
        - SSP
        - SVC
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYU
        - UZS
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
    SourceOfPayableDataEnum:
      type: string
      enum:
        - ocr
        - user_specified
    OcrStatusEnum:
      type: string
      enum:
        - processing
        - error
        - success
        - canceled
    PayableOriginEnum:
      type: string
      enum:
        - upload
        - email
    PayableAggregatedDataResponse:
      properties:
        count:
          type: integer
          description: The total count of payables across all statuses.
        data:
          items:
            $ref: '#/components/schemas/PayableAggregatedItem'
          type: array
          description: >-
            A list of aggregated items, each representing a status with its
            associated sum of the amount field and count.
        sum_total_amount:
          type: integer
          description: >-
            The total sum of the amount field for all payables across all
            statuses.
      additionalProperties: false
      type: object
      required:
        - count
        - data
        - sum_total_amount
    ErrorSchemaResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorSchema'
      type: object
      required:
        - error
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    PayableAggregatedItem:
      properties:
        count:
          type: integer
          description: The total count of payables with this specific status.
        status:
          allOf:
            - $ref: '#/components/schemas/PayableStateEnum'
          description: The status of the payable (e.g., paid, draft, etc.).
        sum_total_amount:
          type: integer
          description: >-
            The total sum of the amount field for all payables with this
            specific status.
      additionalProperties: false
      type: object
      required:
        - count
        - status
        - sum_total_amount
    ErrorSchema:
      properties:
        message:
          type: string
      type: object
      required:
        - message
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
      type: object
      required:
        - loc
        - msg
        - type
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````