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

# New Sales Report

> Accounts newly booked (entered active/current status) within the date range.



## OpenAPI

````yaml /api-reference/external_api.openapi.json get /reports/nsr
openapi: 3.1.0
info:
  title: Monterey External Reporting API
  description: >-
    Org-scoped, API-key-authenticated reporting endpoints for Monterey Financial
    clients.
  version: 0.1.0
servers:
  - url: https://api.montereyfinancial.app
    description: Production
security:
  - BearerApiKey: []
paths:
  /reports/nsr:
    get:
      tags:
        - Reports
      summary: New Sales Report
      description: >-
        Accounts newly booked (entered active/current status) within the date
        range.
      operationId: new_sales_report_reports_nsr_get
      parameters:
        - name: from
          in: query
          required: true
          schema:
            type: string
            format: date
            title: From
        - name: to
          in: query
          required: true
          schema:
            type: string
            format: date
            title: To
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Organization Id
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque pagination cursor from a previous response's
              `page.next_cursor`. Omit on the first page.
            title: Cursor
          description: >-
            Opaque pagination cursor from a previous response's
            `page.next_cursor`. Omit on the first page.
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 1000
                minimum: 1
              - type: 'null'
            description: >-
              Page size for cursor pagination. Default 100, minimum 1, maximum
              1000. Requests above the maximum return 422 — narrow your page
              size and use the returned `next_cursor` to walk additional pages.
            title: Limit
          description: >-
            Page size for cursor pagination. Default 100, minimum 1, maximum
            1000. Requests above the maximum return 422 — narrow your page size
            and use the returned `next_cursor` to walk additional pages.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_LifecycleRow_'
        '401':
          description: Missing, malformed, expired, or unknown API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: '`organization_id` filter targets an org outside the key''s allowlist.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerApiKey: []
components:
  schemas:
    Page_LifecycleRow_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/LifecycleRow'
          type: array
          title: Items
        page:
          $ref: '#/components/schemas/PageMeta'
      type: object
      required:
        - items
        - page
      title: Page[LifecycleRow]
      description: 'A page of results: `items` plus a `page` pagination envelope.'
    ErrorResponse:
      properties:
        detail:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Standard error envelope. Branch on `detail.error_code`.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
      description: >-
        Parameter-validation error (HTTP 422). `detail` lists each violated
        constraint with its location, message, and type.
    LifecycleRow:
      properties:
        account_id:
          type: string
          title: Account Id
        organization_id:
          type: string
          title: Organization Id
        status_code:
          type: string
          title: Status Code
          description: >-
            Short code for the status the account entered (e.g. OPEN,
            CHARGED_OFF, PAID_IN_FULL).
        previous_status_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Status Code
          description: >-
            Short code for the status the account held immediately before this
            transition. Null for the account's very first status entry.
        effective_from:
          type: string
          format: date-time
          title: Effective From
        status_reason_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Reason Code
          description: >-
            Sub-classification code for the status transition (e.g. C-CA, G-GA,
            K-KA, Y-YA, B-BA). Present on write-off events.
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
          description: >-
            Free-text reason entered by the operator at the time of the status
            change.
      type: object
      required:
        - account_id
        - organization_id
        - status_code
        - effective_from
      title: LifecycleRow
      description: >-
        One account status-change event — used by the NSR, WOR, and PIF reports.

        Each row represents a transition the account underwent within the
        requested date range.
    PageMeta:
      properties:
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: Opaque token to pass as ?cursor= to fetch the next page.
        has_more:
          type: boolean
          title: Has More
          description: True if more rows exist past this page.
        limit:
          type: integer
          title: Limit
          description: Echo of the resolved page size.
      type: object
      required:
        - has_more
        - limit
      title: PageMeta
      description: >-
        Pagination envelope on list responses. `next_cursor` is non-null when
        more rows exist — pass it back as `cursor` to continue.
    ErrorBody:
      properties:
        error_code:
          type: string
          title: Error Code
      type: object
      required:
        - error_code
      title: ErrorBody
      description: Standard error body. Branch on `error_code`.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
      description: >-
        A single parameter-validation failure: `loc` is the path to the
        offending input, `msg` is human-readable, and `type` is the rule that
        failed.
  securitySchemes:
    BearerApiKey:
      type: http
      description: Static API key issued via the client portal. Treat it like a password.
      scheme: bearer
      bearerFormat: ApiKey

````