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

# Get average payment period

> See how many days your customers took, on average, to pay the invoices paid off each month, as on your dashboard's Average payment period chart. See [Reports](/guides/reports#average-payment-period).



## OpenAPI

````yaml /api-reference/openapi.yaml get /reports/average_payment_period
openapi: 3.0.3
info:
  title: Streamlined API
  description: >
    Access customers, customer applications, customer groups, products, payouts,
    invoices, transactions, deposit links, and the reports behind your dashboard
    programmatically through this API, and receive webhooks when deposit links
    change. All requests must be authenticated with an API key.
  version: 1.8.0
  license:
    name: Proprietary
    url: https://streamlinedpayments.com/terms
servers:
  - url: https://api.staging.streamlinedpayments.com/api/v1
    description: Sandbox
  - url: https://api.streamlinedpayments.com/api/v1
    description: Production
security:
  - AppIdAuth: []
    ApiKeyAuth: []
tags:
  - name: Customers
    description: Create, update and delete the businesses you sell to.
  - name: Customer applications
    description: >-
      List the applications your customers submit, and approve them. Approving
      can also set net terms and export the customer to Shopify. See [Approve
      customer applications](/guides/customer-applications).
  - name: Customer groups
    description: >-
      Organize customers into groups and manage who's in each one. A group can
      be linked to a Shopify B2B company.
  - name: Customer files
    description: Upload and manage files attached to a customer.
  - name: Customer addresses
    description: Manage a customer's addresses and choose their default billing address.
  - name: Orders
    description: Create orders, add and remove line items, and schedule them.
  - name: Invoices
    description: Create invoices from orders, then list, look up and update them.
  - name: Transactions
    description: List transactions and look one up.
  - name: Payouts
    description: List payouts, including pending ones, and look one up.
  - name: Products
    description: >-
      Create and update the products and services you sell, import them in bulk,
      and merge duplicates.
  - name: Deposit links
    description: Collect money from a customer before an invoice exists.
  - name: Webhooks
    description: >-
      Register HTTPS endpoints to receive events when something changes. See
      [Webhooks](/guides/webhooks) for signatures, retries and delivery
      guarantees.
  - name: Reports
    description: >-
      Read the aging, sales, collections, and customer figures your dashboard
      and customer pages show. Amounts are in cents, in the currency each
      response names. See [Reports](/guides/reports) for how each figure is
      worked out.
paths:
  /reports/average_payment_period:
    get:
      tags:
        - Reports
      summary: Get average payment period
      description: >-
        See how many days your customers took, on average, to pay the invoices
        paid off each month, as on your dashboard's Average payment period
        chart. See [Reports](/guides/reports#average-payment-period).
      operationId: getAveragePaymentPeriodReport
      parameters:
        - $ref: '#/components/parameters/ReportStartDate'
        - $ref: '#/components/parameters/ReportEndDate'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AveragePaymentPeriod'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  parameters:
    ReportStartDate:
      name: start_date
      in: query
      description: >-
        First month of the range, as any day in it (`YYYY-MM-DD`). The range can
        be at most 24 months.
      required: false
      schema:
        type: string
        format: date
    ReportEndDate:
      name: end_date
      in: query
      description: Last month of the range, as any day in it (`YYYY-MM-DD`).
      required: false
      schema:
        type: string
        format: date
  schemas:
    AveragePaymentPeriod:
      type: object
      properties:
        data:
          type: array
          description: Every month in the range, oldest first.
          items:
            type: object
            properties:
              month:
                $ref: '#/components/schemas/ReportMonth'
              average_days_to_pay:
                type: integer
                nullable: true
                description: >-
                  Average days from issue to payment, for the invoices paid off
                  that month. Null in a month with nothing paid off. `0` means
                  paid on the day of issue.
                example: 34
              median_days_to_pay:
                type: integer
                nullable: true
                description: >-
                  Median days from issue to payment, for the same invoices. A
                  few very old invoices pull the average up but barely move the
                  median. Null when the average is.
                example: 21
              paid_invoice_count:
                type: integer
                description: Number of invoices the average covers.
                example: 6
    ReportMonth:
      type: string
      description: Month, as `YYYY-MM`, in your account's time zone.
      example: 2026-10
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  responses:
    BadRequest:
      description: >-
        A parameter is malformed, out of range, or not one of its allowed values
        (`invalid_parameter`). `message` says which. Values aren't ignored,
        except that `per_page` above 100 is treated as 100.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: invalid_parameter
            message: weeks must be one of 13, 26, 52
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            AuthenticationRequired:
              value:
                error: Authentication required
                message: >-
                  API endpoint requires authentication. Please provide valid
                  X-App-Id and X-Api-Key headers.
            InvalidCredentials:
              value:
                error: Invalid credentials
                message: >-
                  The provided API credentials are invalid. Please check your
                  X-App-Id and X-Api-Key values.
  securitySchemes:
    AppIdAuth:
      type: apiKey
      in: header
      name: X-App-Id
      description: App ID for authentication
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API Key for authentication

````

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