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

# Check period readiness

> Checks what blocks closing an accounting period, including pending transactions and draft journals.



## OpenAPI

````yaml openapi-public-preview.json GET /v1/accounting-periods/{period_id}/close-preflight
openapi: 3.1.0
info:
  title: Entendre API
  version: 1.0.0
  description: Programmatic access to crypto-native accounting and treasury operations.
servers:
  - url: https://api.entendre.finance
    description: Production API.
security:
  - ApiKey: []
tags:
  - name: Cost Basis
    description: >-
      Read and configure the organization cost-basis method and lot-tracking
      scope.
  - name: Organization
    description: Read your organization profile and find members for agent assignments.
  - name: Transactions
    description: Find transactions, inspect their details and create manual records.
  - name: Sources
    description: >-
      Manage wallets, exchange accounts, bank accounts and other transaction
      sources.
  - name: Assets
    description: Inspect asset acquisitions, remaining quantities and cost basis.
  - name: Journals
    description: >-
      Create and post journal entries, correct eligible entries and sync posted
      journals to a connected general ledger.
  - name: Documents
    description: >-
      Upload documents, check processing status and link supporting evidence to
      transactions.
  - name: Legal Entities
    description: Manage the legal entities used in your accounting records.
  - name: Ledger Accounts
    description: Manage your chart of accounts and find accounts for journal entries.
  - name: Tags
    description: Create and manage tags to classify your records.
  - name: Accruals
    description: >-
      Create and post accruals, inspect their status and reverse eligible
      entries.
  - name: Cash Application
    description: Match deposits to invoices and manage the resulting cash applications.
  - name: Classification
    description: >-
      Classify transactions in a batch, post eligible entries and inspect the
      results.
  - name: Revaluation
    description: Run asset revaluations for an accounting period and check their results.
  - name: Accounting Periods
    description: Check whether a period is ready to close, then close or reopen it.
  - name: Income Statement
    description: View revenue, expenses and net income for a reporting period.
  - name: Balance Sheet
    description: View assets, liabilities and equity as of a reporting date.
  - name: Trial Balance
    description: Review ledger account balances and debit and credit totals.
  - name: Closing Positions
    description: View asset positions at the end of a reporting period.
  - name: Treasury Balances
    description: Review treasury balances by asset and source.
  - name: Realized Gains & Losses
    description: Review realized gains and losses from asset dispositions.
  - name: Asset Tax Lots
    description: Inspect asset tax lots, remaining quantities and cost basis.
  - name: Schedule of Dispositions
    description: >-
      Review asset dispositions and their proceeds, cost basis and gains or
      losses.
  - name: Financial Insights
    description: Review financial insights for your selected reporting context.
  - name: Agents
    description: Create agents, schedule their work and inspect their runs.
  - name: Memory
    description: Read, search and maintain the memory files your agents use.
  - name: Connections
    description: Connect providers, manage authorization and disconnect.
  - name: GL Mapping
    description: >-
      Map ledger accounts and legal entities to your ERP. Import legal entities,
      tags and chart of accounts.
  - name: Request
    description: Request information, documents or connections from a client.
  - name: Client
    description: Manage your firm’s client relationships.
  - name: Team
    description: Invite team members and manage their access to your firm.
  - name: Settings
    description: Read and update your firm settings.
  - name: Purpose Accounts
    description: >-
      Read accounting purpose assignments and set the realized gain or loss
      account.
externalDocs:
  description: Versioning, deprecation, and rate-limit policy
  url: https://entendre.ai/docs/get-started/versioning
paths:
  /v1/accounting-periods/{period_id}/close-preflight:
    get:
      tags:
        - Accounting Periods
      summary: Check period readiness
      description: >-
        Checks close blockers and returns pending transaction totals and draft
        journal previews. Resolve outstanding work before closing.
      operationId: check_period_readiness
      parameters:
        - name: period_id
          in: path
          required: true
          description: ID of the period.
          schema:
            type: string
            minLength: 1
          example: ap_507f1f77bcf86cd799439011
      responses:
        '200':
          description: The request succeeded.
          headers:
            X-Request-Id:
              description: Support correlation ID.
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CloseReadiness'
                required:
                  - data
                additionalProperties: false
              example:
                data:
                  accounting_period:
                    id: ap_507f1f77bcf86cd799439011
                    status: Open
                    start_date: '2026-08-01'
                    end_date: '2026-08-31'
                    legal_entity_id: le_507f1f77bcf86cd799439011
                  preconditions:
                    can_close: false
                    blocking_reasons:
                      - >-
                        No next accounting period exists. Close requires a
                        successor period to carry closing balances forward.
                  pending_transactions:
                    count: 0
                    sum_credit_usd: 0
                    sum_debit_usd: 0
                    preview: []
                  draft_journal_entries:
                    count: 1
                    preview:
                      - sequence_number: JE-1001
                        id: je_507f1f77bcf86cd799439011
                        date: '2026-08-31'
                        amount_usd: null
                        label: September software expense
                  recommendation: hold
        '400':
          description: >-
            The request is invalid. `error.fields` lists the fields to correct.
            Nothing was changed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: VALIDATION_ERROR
                  message: Invalid path, query or request body.
                  request_id: req_example
        '401':
          description: The API key is missing, invalid or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: UNAUTHORIZED
                  message: Invalid or expired API Key
                  request_id: req_example
                  suggested_action: >-
                    Send an API key in X-API-Key, or an OAuth access token as
                    Authorization: Bearer. Refresh an expired access token.
                  documentation_url: https://entendre.ai/docs/get-started/authentication
          headers:
            WWW-Authenticate:
              $ref: '#/components/headers/WWW-Authenticate'
        '403':
          description: >-
            The API key does not have the required scope or is not associated
            with a user, or the action needs a review in the dashboard.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: FORBIDDEN
                  message: Insufficient access to organization
                  request_id: req_example
        '404':
          description: The resource does not exist, or your organization cannot access it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: RESOURCE_NOT_FOUND
                  message: Resource not found
                  request_id: req_example
        '422':
          description: >-
            The accounting period record exists but cannot be processed, such as
            a period with a malformed date.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: PERIOD_MALFORMED
                  message: The accounting period cannot be processed.
                  request_id: req_example
        '429':
          description: >-
            Too many requests. If the response has a `Retry-After` header, wait
            that many seconds before you retry. Otherwise, read `error.message`.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: RATE_LIMITED
                  message: Rate limit exceeded. Retry after 30s.
                  request_id: req_example
        '500':
          description: >-
            An unexpected error occurred. A write can still have taken effect;
            check the resource before you retry. Give the `request_id` to
            support.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: INTERNAL_ERROR
                  message: Internal server error
                  request_id: req_example
        '503':
          description: >-
            A service that this operation needs is unavailable. If the response
            has a `Retry-After` header, wait that many seconds. Check for
            earlier accepted work before you send the request again.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: SERVICE_UNAVAILABLE
                  message: Service unavailable.
                  request_id: req_example
components:
  schemas:
    CloseReadiness:
      type: object
      properties:
        accounting_period:
          type: object
          properties:
            id:
              type: string
              description: Record ID.
            status:
              type: string
              enum:
                - Open
                - Closed
                - Soft Closed
              description: Period status.
            start_date:
              type: string
              format: date
              description: Period start date.
            end_date:
              type: string
              format: date
              description: Period end date.
            legal_entity_id:
              type: string
              description: Legal entity ID (`le_…`).
          description: The accounting period that was checked.
        preconditions:
          type: object
          properties:
            can_close:
              type: boolean
              description: '`true` when nothing blocks the close.'
            blocking_reasons:
              type: array
              items:
                type: string
              description: What blocks the close.
          description: Whether the period can be closed.
        pending_transactions:
          type: object
          properties:
            count:
              type: integer
              description: Number of pending transactions.
            sum_credit_usd:
              type: number
              description: >-
                Total for USD credit rows only. Rows with another, unknown or
                missing currency have no USD amount. They stay in count but are
                not in the USD totals. No currency conversion is applied.
            sum_debit_usd:
              type: number
              description: >-
                Total for USD debit rows only. Rows with another, unknown or
                missing currency have no USD amount. They stay in count but are
                not in the USD totals. No currency conversion is applied.
            preview:
              type: array
              description: Some of the pending transactions.
              items:
                type: object
                properties:
                  sequence_number:
                    type: string
                    nullable: true
                  id:
                    type: string
                  date:
                    type: string
                    format: date
                  amount_usd:
                    type: number
                    nullable: true
                    description: >-
                      Signed USD amount for USD rows only; negative for debits.
                      A row with another, unknown or missing currency has a null
                      USD amount. It stays in count but is not in the USD
                      totals. No currency conversion is applied.
                  label:
                    type: string
          description: Transactions in the period that are not posted.
        draft_journal_entries:
          type: object
          properties:
            count:
              type: integer
              description: Number of draft journals.
            preview:
              type: array
              description: Some of the draft journals.
          description: Draft journals in the period.
        recommendation:
          type: string
          enum:
            - safe_to_close
            - hold
          description: '`safe_to_close` or `hold`.'
      additionalProperties: false
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              description: Machine-readable error code.
            message:
              type: string
              description: Technical description for developers.
            fields:
              type: object
              additionalProperties:
                type: string
              description: >-
                Present only on VALIDATION_ERROR. Maps failing field paths to
                reason strings.
            details:
              type: object
              additionalProperties: true
              description: >-
                Optional redacted diagnostic details. Request validation uses
                fields or field_errors.
            suggested_action:
              type: string
              description: A suggested next step.
            documentation_url:
              type: string
              format: uri
              description: Link to documentation about this error.
            request_id:
              type: string
              description: Unique request ID for support escalation.
          description: Error details.
  headers:
    WWW-Authenticate:
      description: >-
        Bearer challenge with `realm="entendre"` and `resource_metadata`, the
        URL of the protected-resource metadata (RFC 9728).
        `error="invalid_token"` is added when the credential that was sent is
        invalid or expired.
      schema:
        type: string
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your organization API key. See
        [Authentication](/get-started/authentication).

````

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