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

# Upload a bank statement (write scope)

> Send a statement file and Cherry does the rest: transcribes it, verifies the transactions roll the opening balance forward to the printed closing balance (a statement that doesn't reconcile is rejected whole), creates or matches the manual institution + account, and lands the transactions — deduplicated against rows pushed via POST /transactions.

Processing is asynchronous: the response is a `202` with a `documentId`; poll GET /bank-statements/{documentId} for the outcome (typically well under a minute). Re-uploading the same statement is a no-op: the period is keyed by (account, periodStart, periodEnd) and each transaction by its content, so nothing duplicates.

PDF is the best input; images of statements work too. 25 MB max. Requires the `write` scope. Rate-limited more tightly than other writes — each upload costs a transcription pass.



## OpenAPI

````yaml /openapi.json post /bank-statements
openapi: 3.0.3
info:
  title: Cherry API
  version: 1.0.0
  description: >-
    Cherry's public developer API — programmatic access to a business's books as
    Cherry keeps them: bank transactions with their categorizations, the chart
    of accounts, the double-entry journal, financial statements, legal entities,
    the tax-obligation calendar, and the fiscal health score.


    Authenticate every request with an API key: `Authorization: Bearer
    ck_live_…`. Keys are created in the Cherry app and are scoped to one
    business (tenant) — there is no tenant id in any URL. Keys carry a `read`
    and/or `write` scope; every GET needs `read`, mutations need `write`.


    Conventions: successful responses wrap the payload in `{ "data": … }`; list
    endpoints add `{ "meta": { "pagination": { limit, offset, nextOffset } } }`
    — pass `nextOffset` back as `offset` until it is null. Errors are `{
    "error": string, "reason"?: string }` with conventional status codes. Dates
    are `YYYY-MM-DD`; money amounts are numbers in the row's currency. Requests
    are rate-limited per key with token buckets (429 + `Retry-After` when
    exhausted); report generation has a smaller budget than plain reads.
servers:
  - url: https://api.trycherry.ai/v1
security:
  - bearerAuth: []
tags:
  - name: Transactions
    description: Bank feed rows and their categorizations.
  - name: Accounts
    description: The tenant's chart of accounts.
  - name: Bank accounts
    description: >-
      Connected bank accounts — Plaid-linked and manual. Manual institutions are
      how developers without a Plaid connection bring their own accounts and
      transactions.
  - name: Bank statements
    description: >-
      Statement uploads — send a statement PDF/image and Cherry transcribes it,
      verifies the balances reconcile, and lands the transactions on a manual
      bank account. The no-export alternative to pushing rows yourself.
  - name: Journal
    description: The double-entry journal (entries and lines).
  - name: Reports
    description: Trial balance and financial statements.
  - name: Entities
    description: Legal entities behind the tenant.
  - name: Obligations
    description: The tax/compliance calendar Cherry tracks.
  - name: Health
    description: Cherry's composite fiscal readiness score.
  - name: Meta
    description: The API's own machine-readable contract.
paths:
  /bank-statements:
    post:
      tags:
        - Bank statements
      summary: Upload a bank statement (write scope)
      description: >-
        Send a statement file and Cherry does the rest: transcribes it, verifies
        the transactions roll the opening balance forward to the printed closing
        balance (a statement that doesn't reconcile is rejected whole), creates
        or matches the manual institution + account, and lands the transactions
        — deduplicated against rows pushed via POST /transactions.


        Processing is asynchronous: the response is a `202` with a `documentId`;
        poll GET /bank-statements/{documentId} for the outcome (typically well
        under a minute). Re-uploading the same statement is a no-op: the period
        is keyed by (account, periodStart, periodEnd) and each transaction by
        its content, so nothing duplicates.


        PDF is the best input; images of statements work too. 25 MB max.
        Requires the `write` scope. Rate-limited more tightly than other writes
        — each upload costs a transcription pass.
      operationId: uploadBankStatement
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: The statement file (PDF or image). Max 25 MB.
                entityId:
                  type: string
                  format: uuid
                  description: >-
                    Legal entity the account belongs to (UUID from GET
                    /entities). Defaults to the tenant's primary entity.
      responses:
        '202':
          description: Accepted — processing has started.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      documentId:
                        type: string
                        format: uuid
                      status:
                        type: string
                        enum:
                          - processing
              example:
                data:
                  documentId: 9f8e7d6c-5b4a-4321-8765-4321fedcba98
                  status: processing
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Stable machine-readable error code.
        reason:
          type: string
          description: Human-readable explanation.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ck_live_…
      description: >-
        Cherry API key, created in the app. Sent as `Authorization: Bearer
        ck_live_…`.

````