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

# Get revenue waterfall

> Use when showing revenue per customer, contract or performance obligation and month: actual (posted), pending (earned, not yet posted) and scheduled (invoiced, not yet earned), with optional month-end deferred and unbilled balances. Covers at most 36 months.



## OpenAPI

````yaml https://swagger.flexprice.io post /revenue_reports/waterfall
openapi: 3.0.1
info:
  title: Flexprice API
  description: Flexprice API Service
  contact:
    name: API Support
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  version: '1.0'
servers:
  - url: https://us.api.flexprice.io/v1
    description: US Region
  - url: https://api.cloud.flexprice.io/v1
    description: India Region
security: []
paths:
  /revenue_reports/waterfall:
    post:
      tags:
        - Revenue Reports
      summary: Get revenue waterfall
      description: >-
        Use when showing revenue per customer, contract or performance
        obligation and month: actual (posted), pending (earned, not yet posted)
        and scheduled (invoiced, not yet earned), with optional month-end
        deferred and unbilled balances. Covers at most 36 months.
      operationId: getRevenueWaterfall
      requestBody:
        description: Waterfall request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WaterfallRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WaterfallResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: go
          label: Go
          source: "package main\n\nimport(\n\t\"context\"\n\tflexprice \"github.com/flexprice/go-sdk/v2\"\n\t\"github.com/flexprice/go-sdk/v2/types\"\n\t\"github.com/flexprice/go-sdk/v2/models/types\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := flexprice.New(\n        flexprice.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n    )\n\n    res, err := s.RevenueReports.GetRevenueWaterfall(ctx, types.WaterfallRequest{\n        Currency: \"Dalasi\",\n        PeriodEnd: types.MustTimeFromString(\"2025-08-28T20:02:24.445Z\"),\n        PeriodStart: types.MustTimeFromString(\"2024-03-13T15:39:09.277Z\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.WaterfallResponse != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python
          source: |-
            from flexprice import Flexprice
            from flexprice.utils import parse_datetime


            with Flexprice(
                api_key_auth="<YOUR_API_KEY_HERE>",
            ) as f_client:

                res = f_client.revenue_reports.get_revenue_waterfall(currency="Dalasi", period_end=parse_datetime("2025-08-28T20:02:24.445Z"), period_start=parse_datetime("2024-03-13T15:39:09.277Z"))

                # Handle response
                print(res)
        - lang: typescript
          label: TypeScript
          source: |-
            import { Flexprice } from "@flexprice/sdk";

            const flexprice = new Flexprice({
              apiKeyAuth: "<YOUR_API_KEY_HERE>",
            });

            async function run() {
              const result = await flexprice.revenueReports.getRevenueWaterfall({
                currency: "Dalasi",
                periodEnd: new Date("2025-08-28T20:02:24.445Z"),
                periodStart: new Date("2024-03-13T15:39:09.277Z"),
              });

              console.log(result);
            }

            run();
components:
  schemas:
    WaterfallRequest:
      required:
        - currency
        - period_end
        - period_start
      type: object
      properties:
        as_of:
          type: string
          description: 'report date: pending and scheduled split here; defaults to now'
        contract_ids:
          type: array
          items:
            type: string
        currency:
          type: string
        customer_ids:
          type: array
          items:
            type: string
        details:
          type: boolean
          description: month-end deferred and unbilled balances
        group_by:
          $ref: '#/components/schemas/types.RevenueReportGroupBy'
        limit:
          maximum: 1000
          minimum: 0
          type: integer
          description: rows per page; totals are never paged
        offset:
          minimum: 0
          type: integer
        period_end:
          type: string
          description: YYYY-MM, at most 36 months from period_start
          format: date-time
        period_start:
          type: string
          description: YYYY-MM
          format: date-time
        pob_ids:
          type: array
          items:
            type: string
    WaterfallResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/WaterfallRow'
        pagination:
          $ref: '#/components/schemas/types.PaginationResponse'
        totals:
          type: array
          description: per period over all rows, never paged
          items:
            $ref: '#/components/schemas/WaterfallCell'
    errors.ErrorResponse:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/errors.ErrorCode'
        http_status_code:
          type: integer
        message:
          type: string
      x-speakeasy-name-override: ErrorResponse
    types.RevenueReportGroupBy:
      type: string
      enum:
        - customer_id
        - contract_id
        - pob_id
      x-enum-varnames:
        - RevenueReportGroupByCustomer
        - RevenueReportGroupByContract
        - RevenueReportGroupByPOB
      x-speakeasy-name-override: RevenueReportGroupBy
    WaterfallRow:
      type: object
      properties:
        cells:
          type: array
          description: one per requested period, in order
          items:
            $ref: '#/components/schemas/WaterfallCell'
        contract_id:
          type: string
        customer_id:
          type: string
        pob_id:
          type: string
    types.PaginationResponse:
      type: object
      properties:
        limit:
          type: integer
        offset:
          type: integer
        total:
          type: integer
      x-speakeasy-name-override: PaginationResponse
    WaterfallCell:
      type: object
      properties:
        deferred:
          type: string
          description: 'details: closing deferred_revenue, ended months only'
        period:
          type: string
          description: YYYY-MM
        revenue:
          $ref: '#/components/schemas/RevenueBreakdown'
        unbilled:
          type: string
          description: 'details: closing unbilled_receivable, ended months only'
    errors.ErrorCode:
      type: string
      enum:
        - http_client_error
        - system_error
        - internal_error
        - not_found
        - already_exists
        - version_conflict
        - validation_error
        - invalid_operation
        - permission_denied
        - database_error
        - service_unavailable
        - too_many_requests
        - not_implemented
      x-enum-varnames:
        - ErrCodeHTTPClient
        - ErrCodeSystemError
        - ErrCodeInternalError
        - ErrCodeNotFound
        - ErrCodeAlreadyExists
        - ErrCodeVersionConflict
        - ErrCodeValidation
        - ErrCodeInvalidOperation
        - ErrCodePermissionDenied
        - ErrCodeDatabase
        - ErrCodeServiceUnavailable
        - ErrCodeTooManyRequests
        - ErrCodeNotImplemented
      x-speakeasy-name-override: ErrorCode
    RevenueBreakdown:
      type: object
      properties:
        actual:
          type: string
        pending:
          type: string
        scheduled:
          type: string
        total:
          type: string
          description: actual + pending + scheduled
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Enter your API key in the format *x-api-key &lt;api-key&gt;**
      name: x-api-key
      in: header

````

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