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

# Get one document

> Returns document detail. Bills and invoices include a settlement summary whose links identify each payment or credit adjustment, its relationId for unapply, backing-JE status, payment base amount, and realized FX.



## OpenAPI

````yaml /openapi.json get /api/documents/{id}
openapi: 3.1.0
info:
  title: Equated API
  version: 1.0.0
  description: >-
    Agent-facing accounting API. Authenticate with a bearer token issued from
    Settings → API Tokens, or via the in-app session cookie when called from the
    web client.
servers:
  - url: https://app.equated.co
    description: API server
security: []
paths:
  /api/documents/{id}:
    get:
      tags:
        - Documents
      summary: Get one document
      description: >-
        Returns document detail. Bills and invoices include a settlement summary
        whose links identify each payment or credit adjustment, its relationId
        for unapply, backing-JE status, payment base amount, and realized FX.
      parameters:
        - schema:
            type: number
            nullable: true
          required: false
          name: id
          in: path
      responses:
        '200':
          description: Document detail
          content:
            application/json:
              schema:
                type: object
                properties:
                  document:
                    $ref: '#/components/schemas/DocumentDetail'
                required:
                  - document
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
      security:
        - bearerAuth: []
components:
  schemas:
    DocumentDetail:
      allOf:
        - $ref: '#/components/schemas/Document'
        - type: object
          properties:
            matchedTransactions:
              type: array
              items:
                $ref: '#/components/schemas/MatchedTransactionRelation'
            settlement:
              $ref: '#/components/schemas/SettlementSummary'
            extractedText:
              type: string
              nullable: true
              description: >-
                The file's first pages as plain text, as printed: what the
                structured fields drop (payee address, remittance details,
                service period). Null when no file was read. Detail reads only;
                lists omit it.
            cardLast4:
              type: string
              nullable: true
              description: 'Receipts only: last four digits of the paying card, as printed.'
            resolutionHint:
              type: object
              nullable: true
              properties:
                connectedFinancialAccountId:
                  type: integer
                  nullable: true
                  minimum: 0
                  exclusiveMinimum: true
                suggestedPayerAccountId:
                  type: integer
                  nullable: true
                  minimum: 0
                  exclusiveMinimum: true
              required:
                - connectedFinancialAccountId
                - suggestedPayerAccountId
              description: >-
                Receipts only, from this org's own history of the same card: a
                connected bank account the card belongs to (offer a match), or
                the payer account recorded last time (suggest it only after the
                user confirms personal payment).
          additionalProperties:
            nullable: true
    Document:
      type: object
      properties:
        id:
          type: integer
          minimum: 0
          exclusiveMinimum: true
        documentType:
          type: string
        lifecycle:
          type: string
        amount:
          type: string
          nullable: true
        currency:
          type: string
          nullable: true
        displayTitle:
          type: string
          nullable: true
        documentNumber:
          type: string
          nullable: true
        dueDate:
          type: string
          nullable: true
        createdAt:
          type: string
        orgMerchantId:
          type: integer
          nullable: true
          minimum: 0
          exclusiveMinimum: true
        orgMerchant:
          type: object
          nullable: true
          properties:
            id:
              type: integer
              minimum: 0
              exclusiveMinimum: true
            name:
              type: string
            website:
              type: string
              nullable: true
            imageUrl:
              type: string
              nullable: true
            logo:
              type: string
              nullable: true
          required:
            - id
            - name
            - website
            - imageUrl
            - logo
          additionalProperties:
            nullable: true
        amountBase:
          type: string
          nullable: true
        baseCurrency:
          type: string
          nullable: true
        derivedSettlementStatus:
          $ref: '#/components/schemas/SettlementStatus'
        derivedOutstandingAmount:
          type: string
          nullable: true
          description: Unapplied balance in the document currency.
        payerAccountId:
          type: integer
          nullable: true
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Reimbursement liability/equity payer account; retained on unconfirm
            and null until selected.
        resolution:
          type: string
          nullable: true
          enum:
            - unresolved
            - matched
            - null
          description: >-
            Receipts only: unresolved (not linked to a transaction) or matched
            (linked to one); null for other document types.
      required:
        - id
        - documentType
        - lifecycle
        - amount
        - currency
        - displayTitle
      additionalProperties:
        nullable: true
    MatchedTransactionRelation:
      type: object
      properties:
        id:
          type: integer
          minimum: 0
          exclusiveMinimum: true
        relationId:
          type: integer
          minimum: 0
          exclusiveMinimum: true
        relationType:
          type: string
          enum:
            - evidence
            - enrichment_source
            - accrual
            - settlement
            - credit_application
        settlementAmount:
          type: string
          nullable: true
        settlementCurrency:
          type: string
          nullable: true
        fxJournalEntryId:
          type: integer
          nullable: true
          minimum: 0
          exclusiveMinimum: true
        paymentAmountBase:
          type: string
          nullable: true
      required:
        - id
        - relationId
        - relationType
      additionalProperties:
        nullable: true
    SettlementSummary:
      type: object
      nullable: true
      properties:
        derivedStatus:
          $ref: '#/components/schemas/SettlementStatus'
        settledAmount:
          type: string
        outstandingAmount:
          type: string
        totalRealizedFxBase:
          type: string
        currency:
          type: string
        links:
          type: array
          items:
            $ref: '#/components/schemas/SettlementLink'
      required:
        - derivedStatus
        - settledAmount
        - outstandingAmount
        - totalRealizedFxBase
        - currency
        - links
    SettlementStatus:
      type: string
      enum:
        - open
        - partially_closed
        - closed
    SettlementLink:
      type: object
      properties:
        relationId:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: Relation id used to unapply this payment or adjustment.
        kind:
          type: string
          enum:
            - payment
            - credit
        transactionId:
          type: integer
          nullable: true
          minimum: 0
          exclusiveMinimum: true
        amount:
          type: string
          description: Applied amount in the document currency.
        currency:
          type: string
        matchedAt:
          type: string
        jeStatus:
          type: string
          enum:
            - DRAFT
            - POSTED
            - VOID
          description: Status of the backing payment/reclass or adjustment journal entry.
        fxJournalEntryId:
          type: integer
          nullable: true
          minimum: 0
          exclusiveMinimum: true
        paymentAmountBase:
          type: string
          nullable: true
        realizedFxBase:
          type: string
          nullable: true
          description: >-
            Signed base-currency FX result: negative is a gain, positive is a
            loss.
      required:
        - relationId
        - kind
        - transactionId
        - amount
        - currency
        - matchedAt
        - jeStatus
        - fxJournalEntryId
        - paymentAmountBase
        - realizedFxBase
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token issued from the Equated app under Settings → API Tokens.

````