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

# Create Transaction

> Create a new transaction record. Specify type as either `inflow` or `outflow`. The transaction must contain at least one line item and a valid contact.

Creates a transaction that will be stored and potentially synced with your tax and reconciliation workflows.

**Body Parameters:**

* `type`: Required – `inflow` or `outflow`
* `contact_id`: Required – Must reference a valid contact
* `transaction_date`: ISO 8601 date
* `line_items`: Required – Array of objects with product ID, quantity, amount
* `tax_data`: Optional – Override auto-calculated tax
* `currency`: Optional – Defaults to organization base currency
* `metadata`: Optional – Key-value pairs

**Response:**

Returns the created `Transaction` object, including its generated ID and all computed fields.


## OpenAPI

````yaml POST /transactions
openapi: 3.0.1
info:
  title: Antei API Reference
  description: >-
    Programmatic access to Antei’s platform. Use this API to manage core objects
    and retrieve taxation insights.
  version: 1.0.0
  license:
    name: MIT
  contact:
    name: Antei Developer Support
    email: support@antei.com
    url: https://antei.com
servers:
  - url: https://api.antei.com
security:
  - bearerAuth: []
paths:
  /transactions:
    post:
      summary: Create Transaction
      description: Creates a new transaction entry.
      requestBody:
        description: Transaction payload
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewTransaction'
      responses:
        '200':
          description: Transaction created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    NewTransaction:
      allOf:
        - $ref: '#/components/schemas/Transaction'
    Transaction:
      type: object
      required:
        - id
        - transaction_type
        - amount
        - currency
        - timestamp
      properties:
        id:
          type: string
          description: Unique identifier for the transaction
        transaction_type:
          type: string
          enum:
            - inflow
            - outflow
          description: Direction of the transaction
        amount:
          type: number
          format: float
          description: Transaction amount
        currency:
          type: string
          description: Currency code (e.g., USD, EUR)
        timestamp:
          type: string
          format: date-time
          description: Time of transaction
        description:
          type: string
          description: Optional description of the transaction
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        status:
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````