> ## 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.

# Create a manual document

> Create a manual document (BILL or INVOICE) without an uploaded file. The document lands in DRAFT with a DRAFT accrual journal entry (AP for bills, AR for invoices), ready for posting edits and confirm_document. To create a document FROM a file (receipt image, bill/invoice PDF), use `POST /documents/upload-urls` then `POST /documents/ingest` instead.



## OpenAPI

````yaml /openapi.json post /api/documents
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:
    post:
      tags:
        - Documents
      summary: Create a manual document
      description: >-
        Create a manual document (BILL or INVOICE) without an uploaded file. The
        document lands in DRAFT with a DRAFT accrual journal entry (AP for
        bills, AR for invoices), ready for posting edits and confirm_document.
        To create a document FROM a file (receipt image, bill/invoice PDF), use
        `POST /documents/upload-urls` then `POST /documents/ingest` instead.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDocumentInput'
      responses:
        '201':
          description: Created document
          content:
            application/json:
              schema:
                type: object
                properties:
                  document:
                    $ref: '#/components/schemas/Document'
                required:
                  - document
      security:
        - bearerAuth: []
components:
  schemas:
    CreateDocumentInput:
      oneOf:
        - type: object
          properties:
            amount:
              type: string
              pattern: ^\d+(\.\d+)?$
            currency:
              type: string
              enum:
                - CAD
                - USD
                - EUR
                - GBP
                - AUD
            dueDate:
              type: string
              nullable: true
              pattern: ^\d{4}-\d{2}-\d{2}$
            documentNumber:
              type: string
              nullable: true
              maxLength: 80
            displayTitle:
              type: string
              nullable: true
              maxLength: 200
            idempotencyKey:
              type: string
              minLength: 1
              maxLength: 200
            documentType:
              type: string
              enum:
                - BILL
            vendorOrgMerchantId:
              type: integer
              minimum: 0
              exclusiveMinimum: true
            vendorName:
              type: string
              minLength: 1
              maxLength: 200
            lineItems:
              type: array
              items:
                $ref: '#/components/schemas/ManualDocumentLineItem'
            isRecurring:
              type: boolean
            recurringInterval:
              type: integer
              minimum: 0
              exclusiveMinimum: true
            recurringFrequency:
              type: string
              enum:
                - WEEK
                - MONTH
                - YEAR
          required:
            - amount
            - documentType
        - type: object
          properties:
            amount:
              type: string
              pattern: ^\d+(\.\d+)?$
            currency:
              type: string
              enum:
                - CAD
                - USD
                - EUR
                - GBP
                - AUD
            dueDate:
              type: string
              nullable: true
              pattern: ^\d{4}-\d{2}-\d{2}$
            documentNumber:
              type: string
              nullable: true
              maxLength: 80
            displayTitle:
              type: string
              nullable: true
              maxLength: 200
            idempotencyKey:
              type: string
              minLength: 1
              maxLength: 200
            documentType:
              type: string
              enum:
                - INVOICE
            customerOrgMerchantId:
              type: integer
              minimum: 0
              exclusiveMinimum: true
            customerName:
              type: string
              minLength: 1
              maxLength: 200
            issueDate:
              type: string
              nullable: true
              pattern: ^\d{4}-\d{2}-\d{2}$
            terms:
              type: string
              nullable: true
              enum:
                - DUE_ON_RECEIPT
                - NET_15
                - NET_30
                - NET_60
                - null
            note:
              type: string
              nullable: true
              maxLength: 2000
            lineItems:
              type: array
              items:
                $ref: '#/components/schemas/ManualDocumentLineItem'
          required:
            - amount
            - documentType
    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
    ManualDocumentLineItem:
      type: object
      properties:
        name:
          type: string
          nullable: true
          maxLength: 200
        description:
          type: string
          nullable: true
          maxLength: 500
        amount:
          type: number
        categoryAccountId:
          type: integer
          nullable: true
          minimum: 0
          exclusiveMinimum: true
        quantity:
          type: number
        unitPrice:
          type: number
      required:
        - amount
    SettlementStatus:
      type: string
      enum:
        - open
        - partially_closed
        - closed
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token issued from the Equated app under Settings → API Tokens.

````