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

# Push transactions (batch)

> Create or update cash transactions in batch from an external finance system (the inbound counterpart to the Xero sync). Requires the `transactions:write` scope. Each row is validated independently, so a batch may partially succeed; re-pushing the same `externalId` updates the existing row instead of duplicating it. Amounts are in your organisation's base currency, signed (money-in negative). Cash movements only — journal lines are not accepted.



## OpenAPI

````yaml /openapi.json post /transactions
openapi: 3.1.0
info:
  title: Ledgitify REST API
  version: 1.0.0
  description: >-
    Programmatic access to a single organisation's Ledgitify projects, reports,
    allocations, and transactions. The API key alone determines which
    organisation is accessed; there is no tenant parameter on any endpoint.
    Every endpoint is read-only (GET) except `POST /transactions`, which pushes
    transactions in and requires the `transactions:write` scope.
  contact:
    name: Ledgitify
    url: https://ledgitify.com
servers:
  - url: https://ledgitify.com/api/v1
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Projects
    description: Projects and their budget-vs-actual reports
  - name: Allocations
    description: Allocations recorded against a project's budget lines
  - name: Transactions
    description: Organisation-level accounting transactions
paths:
  /transactions:
    post:
      tags:
        - Transactions
      summary: Push transactions (batch)
      description: >-
        Create or update cash transactions in batch from an external finance
        system (the inbound counterpart to the Xero sync). Requires the
        `transactions:write` scope. Each row is validated independently, so a
        batch may partially succeed; re-pushing the same `externalId` updates
        the existing row instead of duplicating it. Amounts are in your
        organisation's base currency, signed (money-in negative). Cash movements
        only — journal lines are not accepted.
      operationId: pushTransactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rows
              properties:
                rows:
                  type: array
                  minItems: 1
                  maxItems: 500
                  items:
                    $ref: '#/components/schemas/PushTransactionRow'
            example:
              rows:
                - externalId: GL-2026-0001
                  date: '2026-08-01'
                  description: Office supplies
                  contact: Officeworks
                  amount: 249.5
                  accountCode: '400'
                - externalId: GL-2026-0002
                  date: '2026-08-02'
                  description: Grant receipt
                  amount: -50000
      responses:
        '200':
          description: At least one row succeeded. Per-row results plus a summary.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PushResponse'
              example:
                results:
                  - externalId: GL-2026-0001
                    status: created
                    id: 77aa...
                  - externalId: GL-2026-0002
                    status: updated
                    id: 77ab...
                summary:
                  total: 2
                  created: 1
                  updated: 1
                  rejected: 0
        '400':
          description: >-
            The batch envelope itself is malformed (missing `rows`, empty, or
            over 500 rows).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PushEnvelopeError'
              example:
                error: The "rows" array must not be empty.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          description: >-
            Every row was rejected. The body carries the per-row rejection
            reasons.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PushResponse'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    PushTransactionRow:
      type: object
      required:
        - externalId
        - date
        - amount
      properties:
        externalId:
          type: string
          maxLength: 200
          description: >-
            Your stable id for the transaction. Idempotency key — re-pushing the
            same value updates the existing row.
        date:
          type: string
          format: date
          description: ISO date, e.g. 2026-08-01.
        amount:
          type: number
          description: >-
            Signed, in your base currency. Money-in is negative, money-out
            positive. Must be non-zero.
        description:
          type: string
          maxLength: 1000
        contact:
          type:
            - string
            - 'null'
          maxLength: 500
          description: Payee / counterparty name.
        currency:
          type: string
          description: 3-letter ISO code; defaults to AUD.
        type:
          type: string
          enum:
            - bank_transaction
          default: bank_transaction
          description: Cash movements only.
        accountCode:
          type:
            - string
            - 'null'
          maxLength: 100
        trackingCategories:
          type: array
          items:
            type: string
          maxItems: 50
    PushResponse:
      type: object
      required:
        - results
        - summary
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/PushResultItem'
        summary:
          type: object
          required:
            - total
            - created
            - updated
            - rejected
          properties:
            total:
              type: integer
            created:
              type: integer
            updated:
              type: integer
            rejected:
              type: integer
    PushEnvelopeError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable reason the batch envelope was rejected.
    PushResultItem:
      type: object
      required:
        - status
      properties:
        externalId:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - created
            - updated
            - rejected
        id:
          type: string
          description: The Ledgitify transaction id (present when created or updated).
        errors:
          type: array
          items:
            type: string
          description: Present when status is rejected.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden
                - insufficient_scope
                - not_found
                - rate_limited
            message:
              type: string
  responses:
    Unauthorized:
      description: Missing, malformed, unknown, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Invalid or revoked API key.
    Forbidden:
      description: >-
        The plan does not include API access, or the key lacks the required
        scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            planGate:
              value:
                error:
                  code: forbidden
                  message: API access is not available on this plan.
            scope:
              value:
                error:
                  code: insufficient_scope
                  message: This key lacks the reports:read scope.
    RateLimited:
      description: Per-key rate limit exceeded (120 requests/minute).
      headers:
        Retry-After:
          description: Seconds until the limit resets.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: The per-minute request limit.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests remaining in the current window.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Rate limit exceeded.
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: lk_live_...
      description: >-
        API key as a Bearer token: `Authorization: Bearer lk_live_<48 hex>`.
        Create keys in Settings → API keys (Owner or Admin); the full key is
        shown once. API access is a Professional+ feature. Each key is granted
        one or more scopes — read (`projects:read`, `reports:read`,
        `allocations:read`, `transactions:read`) and the single write scope
        (`transactions:write`) — and is limited to 120 requests per minute.

````