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

# Create Transactions

> Creates Transactions into a Transaction Source Account. Returns a Transaction Processing Task.



## OpenAPI

````yaml POST /v0/source-accounts/{source_account_id}/transactions
openapi: 3.1.0
info:
  title: Teal API
  version: '0.1'
servers:
  - url: https://api.sandbox.teal.dev
    description: Sandbox
  - url: https://api.teal.dev
    description: Production
security: []
paths:
  /v0/source-accounts/{source_account_id}/transactions:
    post:
      tags:
        - Transactions
      summary: Create Transactions
      description: |-
        Creates Transactions into a Transaction Source Account. Returns a
        Transaction Processing Task.
      operationId: >-
        create_transactions_v0_source_accounts__source_account_id__transactions_post
      parameters:
        - name: source_account_id
          in: path
          required: true
          schema:
            type: string
            description: The Source Account ID
            title: Source Account Id
          description: The Source Account ID
        - name: teal-instance-id
          in: header
          required: true
          schema:
            type: string
            description: The Teal instance ID
            title: Teal-Instance-Id
          description: The Teal instance ID
        - name: modified-by
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: An optional identifier for audit logging.
            title: Modified-By
          description: An optional identifier for audit logging.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CreateTransaction'
              description: A list of Transactions to be created
              title: Transactions
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TxnProcessingTask'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TealErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TealErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TealErrorResponse'
          description: Unprocessable Content
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TealErrorResponse'
          description: Service Unavailable
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    CreateTransaction:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: |-
            The unique ID of the object. This is used as an idempotency 
                    key to prevent duplicates. This is manually set as part of the create 
                    transactions request. If the transaction is created via a data integration, 
                    Plaid for example, it will be set to the `transaction_id` to enforce 
                    idempotency with the data source.
          examples:
            - t_9237232
        amount:
          anyOf:
            - type: number
              maximum: 1000000000000000000
              minimum: -1000000000000000000
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
          description: The value of the transaction in decimal dollar cents.
          examples:
            - 132629.38
        datetime:
          type: string
          format: date-time
          title: Datetime
          description: |-
            The UTC datetime that the Transaction was created. This
                    will never be before an Instance's `entries_start` date. When importing 
                    transactions, transactions whose datetime is before the Instance’s 
                    `entries_start` date will be skipped. Other transactions will be processed 
                    as normal.
          examples:
            - '2024-03-15T15:28:53Z'
        description:
          type: string
          maxLength: 512
          title: Description
          description: |-
            An arbitrary string on the object, useful for
                    displaying information to the user. 
                    Descriptions over 512 characters will be truncated.
          examples:
            - Payroll March 15 2024
        metadata:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Metadata
          description: |-
            Arbitrary structured information about the transaction.
                    This could be location of the transaction to display to the user or vendor 
                    information to use as part of a Platform or Instance categorization rule. 
                    Teal does not use metadata for any accounting purposes.
          examples:
            - null
        tag_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tag Ids
          description: |-
            An array of IDs of the Tag objects associated with 
                    the Transaction.

            Tags are transitive — the tags on a Transaction are 
                    applied to its corresponding Line Entry or Line Entries.
          examples:
            - null
        opposing_ledger_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Opposing Ledger Id
          description: The ledger id of the opposing ledger.
          examples:
            - null
        lines:
          anyOf:
            - items:
                $ref: '#/components/schemas/TransactionLine'
              type: array
            - type: 'null'
          title: Lines
          description: >-
            Optional list of transaction lines to split the transaction across
            multiple ledgers.
          examples:
            - null
      type: object
      required:
        - id
        - amount
        - datetime
        - description
      title: CreateTransaction
    TxnProcessingTask:
      properties:
        id:
          type: string
          title: Id
          examples:
            - UjL3BQnEaJtecuC7CUeDk
        status:
          $ref: '#/components/schemas/ProcessingStatus'
          description: Indicates the status of the task.
          examples:
            - pending
        created_datetime:
          type: string
          format: date-time
          title: Created Datetime
          description: |-
            Indicates the datetime in UTC when the 
                    task was created.
          examples:
            - '2024-01-01T00:00:00Z'
        updated_datetime:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated Datetime
          description: |-
            Indicates the datetime in UTC when the 
                    task was last updated.
          examples:
            - '2024-01-01T00:00:00Z'
        error:
          anyOf:
            - $ref: '#/components/schemas/PlaidError-Output'
            - $ref: '#/components/schemas/GeneralError'
            - type: 'null'
          title: Error
          description: |-
            The Error object if any errors were encountered in the
                    processing. If the processing task was created by a Plaid import, the Plaid
                        errors will be passed through there. See [Plaid's documentation](https://plaid.com/docs/errors/)
                        for more information on their error messages.
          examples:
            - null
        source_account_id:
          type: string
          title: Source Account Id
          description: The source account containing the transactions
        task_type:
          $ref: '#/components/schemas/TxnProcessingTaskType'
          description: Type of transaction processing task
        ledger_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Ledger Id
          description: |-
            The ID of the ledger that the transactions are being
                    created for.
          examples:
            - 7JRNsKwy2Lw66caxVU7WGC
        created_transaction_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Created Transaction Ids
          description: |-
            The IDs of Transactions successfully 
                    processed by this task.
        removed_transaction_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Removed Transaction Ids
          description: |-
            The IDs of Transactions that were 
                    removed by this task.
        modified_transaction_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Modified Transaction Ids
          description: |-
            The IDs of Transactions that were 
                    modified by this task.
        skipped_transaction_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Skipped Transaction Ids
          description: |-
            The IDs of Transactions that were 
                    skipped by this task.
      type: object
      required:
        - id
        - status
        - created_datetime
        - updated_datetime
        - error
        - source_account_id
        - task_type
        - ledger_id
      title: TxnProcessingTask
    TealErrorResponse:
      properties:
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: A description of the error for API developers.
        data:
          title: Data
          description: Data associated with the error.
        display_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Message
          description: A description of the error for end users.
        error_code:
          anyOf:
            - $ref: '#/components/schemas/TealErrorCode'
            - type: 'null'
          description: Error code associated with the error.
      type: object
      required:
        - message
      title: TealErrorResponse
    TransactionLine:
      properties:
        amount:
          anyOf:
            - type: number
              maximum: 1000000000000000000
              minimum: -1000000000000000000
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
          description: The amount for this line item
          examples:
            - 1000
        description:
          type: string
          maxLength: 512
          title: Description
          description: Description for this line item
          examples:
            - Office supplies
        ledger_id:
          type: string
          title: Ledger Id
          description: The ledger ID for this line item
          examples:
            - HLn8oy2eqMUCwjp1Cwdgco
      type: object
      required:
        - amount
        - description
        - ledger_id
      title: TransactionLine
    ProcessingStatus:
      type: string
      enum:
        - pending
        - failed
        - complete
      title: ProcessingStatus
    PlaidError-Output:
      properties:
        error_type:
          type: string
          title: Error Type
          description: The Plaid error type.
          examples:
            - API_ERROR
        error_code:
          type: string
          title: Error Code
          description: The Plaid error code.
          examples:
            - INTERNAL_SERVER_ERROR
        error_message:
          type: string
          title: Error Message
          description: The Plaid error message.
          examples:
            - An unexpected error occurred.
        display_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Message
          description: A display message supplied by Plaid.
          examples:
            - Something went wrong.
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: The Plaid request identifier.
          examples:
            - KipL51BWnPIpOmi
        causes:
          anyOf:
            - items:
                $ref: '#/components/schemas/PlaidError-Output'
              type: array
            - type: 'null'
          title: Causes
        status:
          anyOf:
            - type: integer
            - type: 'null'
          title: Status
          description: The status code returned from Plaid.
          examples:
            - 500
        documentation_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Documentation Url
          description: A url to Plaid's documentation about the error.
          examples:
            - >-
              https://plaid.com/docs/errors/api/#internal_server_error-or-plaid-internal-error
        suggested_action:
          anyOf:
            - type: string
            - type: 'null'
          title: Suggested Action
          description: Plaid's suggested action to resolve the error.
      type: object
      required:
        - error_type
        - error_code
        - error_message
      title: PlaidError
    GeneralError:
      properties:
        error_type:
          type: string
          title: Error Type
          description: The error type.
          examples:
            - API_ERROR
        error_message:
          type: string
          title: Error Message
          description: The error message.
          examples:
            - An unexpected error occurred.
      type: object
      required:
        - error_type
        - error_message
      title: GeneralError
    TxnProcessingTaskType:
      type: string
      enum:
        - import_transactions
        - recategorization
        - delete_date_range
        - set_business_flag
        - process_aged_unposted
        - retry_unposted
        - legacy
      title: TxnProcessingTaskType
    TealErrorCode:
      type: string
      enum:
        - invalid_date
        - invalid_ledger
        - missing_parameters
        - duplicate_name
        - duplicate_sort_code
        - invalid_ledger_type
        - invalid_ledger_report_cash_flow
        - deleting_required_ledger
        - repeated_tag_group
        - deleting_transaction_line
        - modifying_read_only_ledger
        - debits_credits_not_equal
        - modifying_datetime_opening_balance
        - modifying_accrual_journal_entry
        - modifying_payment_application_journal_entry
        - reconciliation_in_progress
        - reconciled_balance_does_not_match
        - journal_entry_outside_reconciliation_period
        - entries_start_date_after_transactions
        - entries_start_date_after_reconciliations
        - entries_start_date_after_journal_entries
      title: TealErrorCode
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      description: >-
        Bearer authentication header of the form Bearer <token>, where <token>
        is your auth token.
      flows:
        password:
          scopes: {}
          tokenUrl: https://developer.teal.dev

````