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

# Consultar reporte

> Ejecuta una consulta analítica agrupada sobre ventas, compras, pagos o inventario. El campo `source` determina qué dimensiones y métricas están disponibles.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/reports/query
openapi: 3.1.0
info:
  title: La Pyme API
  description: >-
    Resources and workflows for purchases, sales, inventory, contacts, products,
    reports, and settings.
  version: 1.0.0
  contact:
    name: La Pyme Support
    email: hola@lapyme.com.ar
  license:
    name: Proprietary
    url: https://lapyme.com.ar/terminos
servers:
  - url: https://api.lapyme.com.ar
    description: Servidor de producción
security:
  - bearerAuth: []
tags:
  - name: API
    description: Public API operations for La Pyme integrations.
paths:
  /api/v1/reports/query:
    post:
      tags:
        - API
      summary: Consultar reporte
      description: >-
        Ejecuta una consulta analítica agrupada sobre ventas, compras, pagos o
        inventario. El campo `source` determina qué dimensiones y métricas están
        disponibles.
      operationId: queryApiReport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportRequest'
            examples:
              sales_by_product:
                summary: Ventas por producto en Q1 2026
                value:
                  source: sales
                  period:
                    start_date: '2026-01-01'
                    end_date: '2026-03-31'
                  dimensions:
                    - product
                  measures:
                    - total
                    - units
                    - count
                  include_totals: true
              purchases_by_supplier:
                summary: Compras por proveedor en marzo de 2026
                value:
                  source: purchases
                  period:
                    start_date: '2026-03-01'
                    end_date: '2026-03-31'
                  dimensions:
                    - supplier
                  measures:
                    - purchase_total
                    - purchase_count
              payments_by_method:
                summary: Cobros y pagos por método en marzo de 2026
                value:
                  source: payments
                  period:
                    start_date: '2026-03-01'
                    end_date: '2026-03-31'
                  dimensions:
                    - payment_method
                  measures:
                    - payment_net_cashflow
                    - payment_collected_total
                    - payment_paid_total
              inventory_snapshot:
                summary: Inventario final por producto
                value:
                  source: inventory
                  period:
                    start_date: '2026-03-01'
                    end_date: '2026-03-31'
                  dimensions:
                    - product
                    - warehouse
                  measures:
                    - ending_inventory_units
                    - ending_inventory_value
      responses:
        '200':
          description: Reporte ejecutado exitosamente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportQueryResponse'
              examples:
                sales_example:
                  summary: Ventas por producto
                  value:
                    request_id: req_report_1
                    data:
                      rows:
                        - id: 9c692e8b
                          ids:
                            - 9c692e8b-0f9a-4f7c-8b99-061a2eb188ae
                          labels:
                            - Almohada Microfibra 80x50
                          measures:
                            total: 998300
                            units: 12
                            count: 8
                        - id: 3b4a1c2d
                          ids:
                            - 3b4a1c2d-1234-5678-abcd-ef1234567890
                          labels:
                            - King size sheet
                          measures:
                            total: 450000
                            units: 5
                            count: 4
                      totals:
                        total: 1448300
                        units: 17
                        count: 12
                      metadata:
                        source: sales
                        dimensions:
                          - product
                        measures:
                          - total
                          - units
                          - count
                        period:
                          start_date: '2026-01-01'
                          end_date: '2026-03-31'
                        date_basis: commercial
        '400':
          description: Solicitud inválida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_report_1
                    error:
                      code: INVALID_REQUEST
                      message: Invalid request for querying reports
                      retryable: false
                      details:
                        - field: measures
                          code: too_small
                          message: Select at least one measure
                      type: invalid_request_error
        '401':
          description: API key faltante o inválida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: AUTHENTICATION_REQUIRED
                  value:
                    request_id: req_report_1
                    error:
                      code: AUTHENTICATION_REQUIRED
                      message: API key is required in the Authorization header
                      retryable: false
                      type: invalid_request_error
                      details: []
        '403':
          description: Scopes insuficientes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: FORBIDDEN
                  value:
                    request_id: req_report_1
                    error:
                      code: FORBIDDEN
                      message: Your API key does not have permission for this operation
                      retryable: false
                      type: invalid_request_error
                      details: []
        '429':
          description: Límite de solicitudes excedido para la organización
          headers:
            Retry-After:
              description: Segundos a esperar antes de volver a intentar la solicitud.
              schema:
                type: string
                example: '30'
            X-RateLimit-Limit:
              description: Límite de la ventana activa.
              schema:
                type: string
                example: '5000'
            X-RateLimit-Remaining:
              description: Solicitudes restantes en la ventana activa.
              schema:
                type: string
                example: '0'
            X-RateLimit-Reset:
              description: Segundos restantes hasta el reset de la ventana activa.
              schema:
                type: string
                example: '30'
            RateLimit-Limit:
              description: Límite de la ventana activa en formato estándar.
              schema:
                type: string
                example: '5000'
            RateLimit-Remaining:
              description: Solicitudes restantes en la ventana activa en formato estándar.
              schema:
                type: string
                example: '0'
            RateLimit-Reset:
              description: >-
                Segundos hasta el reset de la ventana activa en formato
                estándar.
              schema:
                type: string
                example: '30'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: RATE_LIMITED
                  value:
                    request_id: req_rate_limit_1
                    error:
                      type: rate_limit_error
                      code: RATE_LIMITED
                      message: >-
                        The organization request limit was reached. Try again
                        later.
                      retryable: true
                      details: []
        '500':
          description: Error interno del servidor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INTERNAL_ERROR
                  value:
                    request_id: req_report_1
                    error:
                      code: INTERNAL_ERROR
                      message: Could not run the report query
                      retryable: false
                      type: invalid_request_error
                      details: []
      x-codeSamples:
        - lang: typescript
          label: La Pyme SDK
          source: |
            import { Lapyme } from "lapyme";

            const lapyme = new Lapyme({
              bearerAuth: process.env["LAPYME_API_KEY"] ?? "",
            });

            const report = await lapyme.reports.query({
              source: "sales",
              period: {
                startDate: "2026-01-01",
                endDate: "2026-03-31",
              },
              dimensions: ["product"],
              measures: ["total", "units", "count"],
              includeTotals: true,
            });
components:
  schemas:
    ReportRequest:
      oneOf:
        - $ref: '#/components/schemas/SalesReportRequest'
          title: Ventas
        - $ref: '#/components/schemas/PurchasesReportRequest'
          title: Compras
        - $ref: '#/components/schemas/PaymentsReportRequest'
          title: Pagos
        - $ref: '#/components/schemas/InventoryReportRequest'
          title: Inventario
    ReportQueryResponse:
      type: object
      properties:
        request_id:
          type: string
        data:
          type: object
          properties:
            rows:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  ids:
                    type: array
                    items:
                      type: string
                  labels:
                    type: array
                    items:
                      type: string
                  measures:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: number
                required:
                  - id
                  - ids
                  - labels
                  - measures
                additionalProperties: false
            totals:
              anyOf:
                - type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    type: number
                - type: 'null'
              description: >-
                Aggregated totals for all rows. Present only when
                `includeTotals: true` is sent.
            metadata:
              type: object
              properties:
                source:
                  $ref: '#/components/schemas/ApiSharedEnum07ee8fd91e'
                dimensions:
                  type: array
                  items:
                    type: string
                measures:
                  type: array
                  items:
                    type: string
                period:
                  type: object
                  properties:
                    start_date:
                      type: string
                    end_date:
                      type: string
                  required:
                    - start_date
                    - end_date
                  additionalProperties: false
                date_basis:
                  type: string
                  enum:
                    - commercial
                    - fiscal
              required:
                - source
                - dimensions
                - measures
              additionalProperties: false
          required:
            - rows
            - totals
            - metadata
          additionalProperties: false
      required:
        - request_id
        - data
      additionalProperties: false
    ApiErrorEnvelope:
      type: object
      properties:
        request_id:
          type: string
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - api_error
                - authentication_error
                - authorization_error
                - business_error
                - external_dependency_error
                - idempotency_error
                - invalid_request_error
                - rate_limit_error
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            details:
              type: array
              items:
                $ref: '#/components/schemas/ApiSharedObjectc671832641'
          required:
            - type
            - code
            - message
            - retryable
            - details
          additionalProperties: false
      required:
        - request_id
        - error
      additionalProperties: false
    SalesReportRequest:
      type: object
      required:
        - source
        - period
        - measures
      properties:
        source:
          type: string
          enum:
            - sales
        period:
          $ref: '#/components/schemas/ReportPeriod'
        dimensions:
          type: array
          items:
            anyOf:
              - type: string
                enum:
                  - date
                  - week
                  - weekOfYear
                  - month
                  - monthOfYear
                  - dayOfWeek
                  - year
                  - quarter
                  - hourOfDay
                  - customer
                  - customerName
                  - customerEmail
                  - customerTaxCategory
                  - province
                  - city
                  - product
                  - productName
                  - variant
                  - variantSku
                  - category
                  - subcategory
                  - defaultSupplierName
                  - productType
                  - salesperson
                  - pointOfSale
                  - warehouse
                  - register
                  - integrationSource
                  - voucherType
                  - currency
                  - paymentStatus
                  - caeStatus
                  - invoiceStatus
                  - formattedInvoiceNumber
                  - taxRate
                  - saleLineType
              - type: string
                pattern: ^product_metafield:[a-z][a-z0-9_]*$
                description: >-
                  Product select custom field dimension. Use
                  product_metafield:<key>, for example product_metafield:season.
                examples:
                  - product_metafield:season
              - type: string
                pattern: ^contact_metafield:[a-z][a-z0-9_]*$
                description: >-
                  Contact select custom field dimension. Use
                  contact_metafield:<key>, for example
                  contact_metafield:customer_segment.
                examples:
                  - contact_metafield:customer_segment
          maxItems: 12
          uniqueItems: true
          description: >-
            Dimensiones de agrupación. Máximo 12. Acepta product_metafield:<key>
            para campos personalizados select de producto y
            contact_metafield:<key> para campos personalizados select de
            contacto.
        measures:
          type: array
          items:
            type: string
            enum:
              - total
              - subtotal
              - taxAmount
              - count
              - units
              - cost
              - margin
              - avgTicket
              - marginPercent
              - discountAmount
              - lineDiscountAmount
              - lineDiscountRate
              - globalDiscountAmount
              - globalDiscountRate
              - discountedSalesCount
              - balance
              - uniqueCustomers
              - uniqueProducts
          minItems: 1
          uniqueItems: true
          description: Medidas a calcular. Al menos una.
        dimension_filters:
          type: object
          description: >-
            Filtros por dimensión. Cada clave debe ser una dimensión filtrable
            para la fuente. También acepta product_metafield:<key> para campos
            personalizados select de producto y contact_metafield:<key> para
            campos personalizados select de contacto cuando la fuente lo
            soporta. El valor es un array de IDs o valores a incluir.
          additionalProperties: false
          patternProperties:
            ^product_metafield:[a-z][a-z0-9_]*$:
              type: array
              items:
                type: string
              minItems: 1
              description: Values to include for a product select custom field dimension.
            ^contact_metafield:[a-z][a-z0-9_]*$:
              type: array
              items:
                type: string
              minItems: 1
              description: Values to include for a contact select custom field dimension.
          properties:
            customer:
              type: array
              items:
                type: string
              minItems: 1
            customer_name:
              type: array
              items:
                type: string
              minItems: 1
            customer_email:
              type: array
              items:
                type: string
              minItems: 1
            customer_tax_category:
              type: array
              items:
                type: string
              minItems: 1
            province:
              type: array
              items:
                type: string
              minItems: 1
            city:
              type: array
              items:
                type: string
              minItems: 1
            product:
              type: array
              items:
                type: string
              minItems: 1
            product_name:
              type: array
              items:
                type: string
              minItems: 1
            variant_sku:
              type: array
              items:
                type: string
              minItems: 1
            category:
              type: array
              items:
                type: string
              minItems: 1
            subcategory:
              type: array
              items:
                type: string
              minItems: 1
            default_supplier_name:
              type: array
              items:
                type: string
              minItems: 1
            product_type:
              type: array
              items:
                type: string
              minItems: 1
            salesperson:
              type: array
              items:
                type: string
              minItems: 1
            point_of_sale:
              type: array
              items:
                type: string
              minItems: 1
            warehouse:
              type: array
              items:
                type: string
              minItems: 1
            register:
              type: array
              items:
                type: string
              minItems: 1
            integration_source:
              type: array
              items:
                type: string
              minItems: 1
            voucher_type:
              type: array
              items:
                type: string
              minItems: 1
            currency:
              type: array
              items:
                type: string
              minItems: 1
            payment_status:
              type: array
              items:
                type: string
              minItems: 1
            cae_status:
              type: array
              items:
                type: string
              minItems: 1
            invoice_status:
              type: array
              items:
                type: string
              minItems: 1
            formatted_invoice_number:
              type: array
              items:
                type: string
              minItems: 1
            tax_rate:
              type: array
              items:
                type: string
              minItems: 1
            sale_line_type:
              type: array
              items:
                type: string
              minItems: 1
            customer_status:
              type: array
              items:
                type: string
              minItems: 1
            product_status:
              type: array
              items:
                type: string
              minItems: 1
            warehouse_status:
              type: array
              items:
                type: string
              minItems: 1
            point_of_sale_status:
              type: array
              items:
                type: string
              minItems: 1
            register_status:
              type: array
              items:
                type: string
              minItems: 1
        include_totals:
          type: boolean
          description: >-
            Si es true, la respuesta incluye totales agregados en el campo
            `totals`.
        date_basis:
          type: string
          enum:
            - commercial
            - fiscal
          default: commercial
          description: >-
            `commercial` usa la fecha de venta. `fiscal` usa la fecha contable
            del comprobante.
    PurchasesReportRequest:
      type: object
      required:
        - source
        - period
        - measures
      properties:
        source:
          type: string
          enum:
            - purchases
        period:
          $ref: '#/components/schemas/ReportPeriod'
        dimensions:
          type: array
          items:
            anyOf:
              - type: string
                enum:
                  - date
                  - week
                  - month
                  - quarter
                  - year
                  - supplier
                  - supplierName
                  - supplierTaxCategory
                  - supplierProvince
                  - supplierCity
                  - product
                  - variant
                  - category
                  - subcategory
                  - productType
                  - warehouse
                  - voucherType
                  - currency
                  - taxRate
              - type: string
                pattern: ^product_metafield:[a-z][a-z0-9_]*$
                description: >-
                  Product select custom field dimension. Use
                  product_metafield:<key>, for example product_metafield:season.
                examples:
                  - product_metafield:season
              - type: string
                pattern: ^contact_metafield:[a-z][a-z0-9_]*$
                description: >-
                  Contact select custom field dimension. Use
                  contact_metafield:<key>, for example
                  contact_metafield:customer_segment.
                examples:
                  - contact_metafield:customer_segment
          maxItems: 12
          uniqueItems: true
          description: >-
            Dimensiones de agrupación. Máximo 12. Acepta product_metafield:<key>
            para campos personalizados select de producto y
            contact_metafield:<key> para campos personalizados select de
            contacto.
        measures:
          type: array
          items:
            type: string
            enum:
              - purchaseTotal
              - purchaseSubtotal
              - purchaseTaxAmount
              - purchaseCount
              - purchaseUnits
              - purchaseCost
              - uniqueSuppliers
              - avgPurchaseTicket
              - avgPurchaseUnitCost
          minItems: 1
          uniqueItems: true
          description: Medidas a calcular. Al menos una.
        dimension_filters:
          type: object
          description: >-
            Filtros por dimensión. Cada clave debe ser una dimensión filtrable
            para la fuente. También acepta product_metafield:<key> para campos
            personalizados select de producto y contact_metafield:<key> para
            campos personalizados select de contacto cuando la fuente lo
            soporta. El valor es un array de IDs o valores a incluir.
          additionalProperties: false
          patternProperties:
            ^product_metafield:[a-z][a-z0-9_]*$:
              type: array
              items:
                type: string
              minItems: 1
              description: Values to include for a product select custom field dimension.
            ^contact_metafield:[a-z][a-z0-9_]*$:
              type: array
              items:
                type: string
              minItems: 1
              description: Values to include for a contact select custom field dimension.
          properties:
            supplier:
              type: array
              items:
                type: string
              minItems: 1
            supplier_name:
              type: array
              items:
                type: string
              minItems: 1
            supplier_tax_category:
              type: array
              items:
                type: string
              minItems: 1
            supplier_province:
              type: array
              items:
                type: string
              minItems: 1
            supplier_city:
              type: array
              items:
                type: string
              minItems: 1
            product:
              type: array
              items:
                type: string
              minItems: 1
            category:
              type: array
              items:
                type: string
              minItems: 1
            subcategory:
              type: array
              items:
                type: string
              minItems: 1
            product_type:
              type: array
              items:
                type: string
              minItems: 1
            warehouse:
              type: array
              items:
                type: string
              minItems: 1
            voucher_type:
              type: array
              items:
                type: string
              minItems: 1
            currency:
              type: array
              items:
                type: string
              minItems: 1
            tax_rate:
              type: array
              items:
                type: string
              minItems: 1
            supplier_status:
              type: array
              items:
                type: string
              minItems: 1
            product_status:
              type: array
              items:
                type: string
              minItems: 1
            warehouse_status:
              type: array
              items:
                type: string
              minItems: 1
        include_totals:
          type: boolean
          description: >-
            Si es true, la respuesta incluye totales agregados en el campo
            `totals`.
    PaymentsReportRequest:
      type: object
      required:
        - source
        - period
        - measures
      properties:
        source:
          type: string
          enum:
            - payments
        period:
          $ref: '#/components/schemas/ReportPeriod'
        dimensions:
          type: array
          items:
            anyOf:
              - type: string
                enum:
                  - date
                  - week
                  - weekOfYear
                  - month
                  - monthOfYear
                  - dayOfWeek
                  - year
                  - quarter
                  - hourOfDay
                  - paymentContact
                  - paymentContactName
                  - paymentContactTaxCategory
                  - paymentContactProvince
                  - paymentContactCity
                  - createdBy
                  - pointOfSale
                  - register
                  - posSession
                  - safe
                  - paymentType
                  - paymentRecordStatus
                  - currency
                  - settlementCurrency
                  - formattedPaymentNumber
                  - paymentMethod
                  - paymentMethodType
              - type: string
                pattern: ^contact_metafield:[a-z][a-z0-9_]*$
                description: >-
                  Contact select custom field dimension. Use
                  contact_metafield:<key>, for example
                  contact_metafield:customer_segment.
                examples:
                  - contact_metafield:customer_segment
          maxItems: 12
          uniqueItems: true
          description: >-
            Dimensiones de agrupación. Máximo 12. Acepta contact_metafield:<key>
            para campos personalizados select de contacto.
        measures:
          type: array
          items:
            type: string
            enum:
              - paymentCollectedTotal
              - paymentPaidTotal
              - paymentNetCashflow
              - paymentGrossMovement
              - paymentNetAmount
              - paymentFeeAmount
              - paymentBalance
              - paymentCount
              - paymentSplitCount
              - uniquePaymentContacts
              - avgPaymentAmount
          minItems: 1
          uniqueItems: true
          description: Medidas a calcular. Al menos una.
        dimension_filters:
          type: object
          description: >-
            Filtros por dimensión. Cada clave debe ser una dimensión filtrable
            para la fuente. También acepta product_metafield:<key> para campos
            personalizados select de producto y contact_metafield:<key> para
            campos personalizados select de contacto cuando la fuente lo
            soporta. El valor es un array de IDs o valores a incluir.
          additionalProperties: false
          patternProperties:
            ^contact_metafield:[a-z][a-z0-9_]*$:
              type: array
              items:
                type: string
              minItems: 1
              description: Values to include for a contact select custom field dimension.
          properties:
            payment_contact:
              type: array
              items:
                type: string
              minItems: 1
            payment_contact_name:
              type: array
              items:
                type: string
              minItems: 1
            payment_contact_tax_category:
              type: array
              items:
                type: string
              minItems: 1
            payment_contact_province:
              type: array
              items:
                type: string
              minItems: 1
            payment_contact_city:
              type: array
              items:
                type: string
              minItems: 1
            created_by:
              type: array
              items:
                type: string
              minItems: 1
            point_of_sale:
              type: array
              items:
                type: string
              minItems: 1
            register:
              type: array
              items:
                type: string
              minItems: 1
            pos_session:
              type: array
              items:
                type: string
              minItems: 1
            safe:
              type: array
              items:
                type: string
              minItems: 1
            payment_type:
              type: array
              items:
                type: string
              minItems: 1
            payment_record_status:
              type: array
              items:
                type: string
              minItems: 1
            currency:
              type: array
              items:
                type: string
              minItems: 1
            settlement_currency:
              type: array
              items:
                type: string
              minItems: 1
            formatted_payment_number:
              type: array
              items:
                type: string
              minItems: 1
            payment_method:
              type: array
              items:
                type: string
              minItems: 1
            payment_method_type:
              type: array
              items:
                type: string
              minItems: 1
            payment_contact_status:
              type: array
              items:
                type: string
              minItems: 1
            point_of_sale_status:
              type: array
              items:
                type: string
              minItems: 1
            register_status:
              type: array
              items:
                type: string
              minItems: 1
            safe_status:
              type: array
              items:
                type: string
              minItems: 1
            payment_method_status:
              type: array
              items:
                type: string
              minItems: 1
        include_totals:
          type: boolean
          description: >-
            Si es true, la respuesta incluye totales agregados en el campo
            `totals`.
    InventoryReportRequest:
      type: object
      required:
        - source
        - measures
      properties:
        source:
          type: string
          enum:
            - inventory
        period:
          type: object
          required:
            - start_date
            - end_date
          properties:
            start_date:
              type: string
              format: date
              description: Period start date (YYYY-MM-DD)
              example: '2026-01-01'
            end_date:
              type: string
              format: date
              description: Period end date (YYYY-MM-DD, inclusive)
              example: '2026-03-31'
          description: >-
            Obligatorio cuando se piden métricas históricas de inventario,
            métricas derivadas de ventas o métricas de movimientos.
        dimensions:
          type: array
          items:
            anyOf:
              - type: string
                enum:
                  - date
                  - week
                  - weekOfYear
                  - month
                  - monthOfYear
                  - dayOfWeek
                  - year
                  - quarter
                  - product
                  - productName
                  - variant
                  - variantSku
                  - category
                  - subcategory
                  - defaultSupplierName
                  - productType
                  - currency
                  - inventoryItemCost
                  - warehouse
              - type: string
                pattern: ^product_metafield:[a-z][a-z0-9_]*$
                description: >-
                  Product select custom field dimension. Use
                  product_metafield:<key>, for example product_metafield:season.
                examples:
                  - product_metafield:season
          maxItems: 12
          uniqueItems: true
          description: >-
            Dimensiones de agrupación. Máximo 12. Acepta product_metafield:<key>
            para campos personalizados select de producto.
        measures:
          type: array
          items:
            type: string
            enum:
              - stockOnHand
              - stockAvailable
              - stockReserved
              - stockIncoming
              - stockValueCost
              - stockValueRetail
              - startingInventoryUnits
              - endingInventoryUnits
              - endingInventoryValue
              - endingInventoryRetailValue
              - daysInStock
              - daysOutOfStock
              - inventoryUnitsSold
              - inventoryUnitsSoldPerDay
              - daysOfInventoryRemaining
              - sellThroughRate
              - inventoryUnitsNetChange
              - inventoryAdjustmentChange
              - inventoryAdjustmentCount
              - receivedQuantity
              - transferCount
              - transferLineItemCount
              - uniqueItemsTransferred
          minItems: 1
          uniqueItems: true
          description: >-
            Measures to calculate. Inventory analytics measures are
            period-based; use endingInventoryUnits for the inventory balance at
            the end of the requested period.
        dimension_filters:
          type: object
          description: >-
            Filtros por dimensión. Cada clave debe ser una dimensión filtrable
            para la fuente. También acepta product_metafield:<key> para campos
            personalizados select de producto y contact_metafield:<key> para
            campos personalizados select de contacto cuando la fuente lo
            soporta. El valor es un array de IDs o valores a incluir.
          additionalProperties: false
          patternProperties:
            ^product_metafield:[a-z][a-z0-9_]*$:
              type: array
              items:
                type: string
              minItems: 1
              description: Values to include for a product select custom field dimension.
          properties:
            product:
              type: array
              items:
                type: string
              minItems: 1
            product_name:
              type: array
              items:
                type: string
              minItems: 1
            variant_sku:
              type: array
              items:
                type: string
              minItems: 1
            category:
              type: array
              items:
                type: string
              minItems: 1
            subcategory:
              type: array
              items:
                type: string
              minItems: 1
            default_supplier_name:
              type: array
              items:
                type: string
              minItems: 1
            product_type:
              type: array
              items:
                type: string
              minItems: 1
            currency:
              type: array
              items:
                type: string
              minItems: 1
            warehouse:
              type: array
              items:
                type: string
              minItems: 1
            product_status:
              type: array
              items:
                type: string
              minItems: 1
            warehouse_status:
              type: array
              items:
                type: string
              minItems: 1
            sale_line_type:
              type: array
              items:
                type: string
              minItems: 1
        include_totals:
          type: boolean
          description: >-
            Si es true, la respuesta incluye totales agregados en el campo
            `totals`.
        date_basis:
          type: string
          enum:
            - commercial
            - fiscal
          default: commercial
          description: >-
            Aplica solo cuando se usan métricas derivadas de ventas.
            `commercial` usa la fecha de venta; `fiscal` usa la fecha contable.
    ApiSharedEnum07ee8fd91e:
      type: string
      enum:
        - sales
        - purchases
        - payments
        - inventory
    ApiSharedObjectc671832641:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        field:
          type: string
      required:
        - code
        - message
      additionalProperties: false
    ReportPeriod:
      type: object
      required:
        - start_date
        - end_date
      properties:
        start_date:
          type: string
          format: date
          description: Period start date (YYYY-MM-DD)
          example: '2026-01-01'
        end_date:
          type: string
          format: date
          description: Period end date (YYYY-MM-DD, inclusive)
          example: '2026-03-31'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Incluí tu API key en el header Authorization con el prefijo Bearer.

````