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

# Profit & loss

> The profit & loss statement for a business over a period.



## OpenAPI

````yaml /openapi.json get /v1/statements/profit-and-loss
openapi: 3.1.0
info:
  title: 3Rings API
  version: 1.0.0
  summary: Embedded double-entry accounting infrastructure.
  description: >-
    The 3Rings API lets you embed real double-entry accounting into your
    product. Create a business you serve, provision its chart of accounts, post
    balanced journals, and read financial statements — all on the same guarded
    core that powers 3Rings.


    All amounts are **integers in the currency's minor unit** (e.g. kobo for
    NGN, cents for USD). All write endpoints accept an `Idempotency-Key` so
    retries are safe. Balancing and posting are authoritative on our side: you
    send the intent, we keep the books correct.
  contact:
    name: 3Rings Developer Support
    url: https://docs.3ringscapital.co/support
    email: developers@3ringscapital.co
  license:
    name: Proprietary
    url: https://3ringscapital.co/terms-of-use
servers:
  - url: https://api.3ringscapital.co
    description: Production
  - url: https://api-sandbox.3ringscapital.co
    description: Sandbox
security:
  - bearerAuth: []
tags:
  - name: Businesses
    description: >-
      The businesses you serve, modelled as sub-accounts under your partner
      account.
  - name: Chart of Accounts
    description: The ledger accounts each business posts against.
  - name: Journals
    description: >-
      Double-entry journal entries. Debits and credits must balance; we enforce
      it server-side.
  - name: Statements
    description: Trial balance, profit & loss and balance sheet, computed from the ledger.
  - name: Categorization
    description: Classify a transaction into a chart-of-accounts category with AI.
paths:
  /v1/statements/profit-and-loss:
    get:
      tags:
        - Statements
      summary: Profit & loss
      description: The profit & loss statement for a business over a period.
      operationId: getProfitAndLoss
      parameters:
        - $ref: '#/components/parameters/BusinessIdQuery'
        - $ref: '#/components/parameters/From'
        - $ref: '#/components/parameters/To'
      responses:
        '200':
          description: The profit & loss statement.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Statement'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    BusinessIdQuery:
      name: businessId
      in: query
      required: true
      description: The business whose records to return.
      schema:
        type: string
      example: biz_9f2
    From:
      name: from
      in: query
      required: true
      description: Period start (ISO 8601, YYYY-MM-DD).
      schema:
        type: string
        format: date
    To:
      name: to
      in: query
      required: true
      description: Period end (ISO 8601, YYYY-MM-DD).
      schema:
        type: string
        format: date
  schemas:
    Statement:
      type: object
      required:
        - businessId
        - type
        - lines
      properties:
        businessId:
          type: string
          example: biz_9f2
        type:
          type: string
          enum:
            - profit_and_loss
            - balance_sheet
          example: profit_and_loss
        period:
          type: object
          properties:
            from:
              type: string
              format: date
            to:
              type: string
              format: date
        currency:
          type: string
          example: NGN
        lines:
          type: array
          items:
            type: object
            properties:
              label:
                type: string
                example: Revenue
              amount:
                type: integer
                example: 180000000
              section:
                type: string
                example: income
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              description: A stable, machine-readable error type.
              example: invalid_request
            message:
              type: string
              description: A human-readable explanation.
              example: businessId is required.
            code:
              type: string
              description: A dotted sub-code for finer handling.
              example: business.missing
            param:
              type: string
              description: The offending parameter, when applicable.
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The resource does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authenticate with your secret API key as a bearer token: `Authorization:
        Bearer 3r_live_...`. Keys are issued per partner from the dashboard; use
        `3r_test_...` against the sandbox. Never expose a secret key in
        client-side code.

````

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