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

# Create end user transactions (async)

> Upload transactions for a specific end user. Does not include enriching transactions -- set end user status = 'ready' to initiate processing. For synchronous enrichment, please instead use "Enrich transactions (sync). Either timestamp (preferred) or date must be present in the transaction payload."




## OpenAPI

````yaml https://app.herondata.io/swagger post /api/end_users/{end_user_id_or_heron_id}/transactions
openapi: 3.0.0
info:
  contact:
    email: support@herondata.io
    name: Support
  title: Heron Data API
  version: '2021-07-19'
servers:
  - description: Production
    url: https://app.herondata.io
security:
  - ApiKeyAuth:
      - key_XXX
externalDocs:
  description: Read Tutorial
  url: https://docs.herondata.io/
paths:
  /api/end_users/{end_user_id_or_heron_id}/transactions:
    post:
      tags:
        - Transactions
      summary: Create end user transactions (async)
      description: >
        Upload transactions for a specific end user. Does not include enriching
        transactions -- set end user status = 'ready' to initiate processing.
        For synchronous enrichment, please instead use "Enrich transactions
        (sync). Either timestamp (preferred) or date must be present in the
        transaction payload."
      parameters:
        - in: path
          name: end_user_id_or_heron_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EndUserTransactionsPostAsyncSchema'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                properties:
                  request_id:
                    description: Unique UUID per request
                    type: string
                  transactions_loaded:
                    description: The number of transactions loaded
                    type: integer
                type: object
          description: OK
      security:
        - ApiKeyAuth: []
components:
  schemas:
    EndUserTransactionsPostAsyncSchema:
      properties:
        balances:
          description: >-
            Bank account balance information for a particular account_id. The
            balance here must be the *latest balance* after all the transactions
            in this batch have been applied.
          items:
            $ref: '#/components/schemas/AccountBalance1'
          nullable: true
          type: array
        transactions:
          items:
            $ref: '#/components/schemas/EndUserTransactionPostAsync'
          minItems: 1
          type: array
      required:
        - transactions
      type: object
    AccountBalance1:
      properties:
        account_id:
          example: checking_account_202348
          maxLength: 400
          type: string
        batch_closing_balance:
          description: >-
            The closing balance for this account after the transactions in this
            batch
          example: 25000.45
          type: number
      required:
        - account_id
        - batch_closing_balance
      type: object
    EndUserTransactionPostAsync:
      properties:
        account_id:
          description: Your unique ID for account associated with transaction
          example: checking_account_202348
          maxLength: 400
          type: string
        amount:
          description: >-
            Amount. Inflows to an account should be positive, and outflows from
            an account should be negative. If using Plaid, please flip the
            amount sign for all transactions.
          example: -42.42
          type: number
        balance:
          description: The running balance of the account after transaction ocurred
          example: 423
          nullable: true
          type: number
        categories_default:
          description: >-
            Category of transaction that you may have received from other
            sources
          example: shopping
          nullable: true
          type: string
          writeOnly: true
        currency:
          description: ISO 4217 currency code
          example: USD
          maxLength: 3
          minLength: 3
          type: string
        date:
          description: >-
            The date of the transaction; 'timestamp' field takes priority over
            'date'
          example: '2020-04-27'
          format: date
          nullable: true
          type: string
          writeOnly: true
        description:
          description: The text description for the transaction
          example: GOOGLE *ADS12340929 cc@google.com US
          type: string
        heron_id:
          description: Unique ID of transaction; generated by Heron Data
          example: txn_nGAorLeRUzKFCZCspqio7b
          readOnly: true
          type: string
        mcc_code:
          description: >-
            Merchant category code associated with transaction that you may have
            received from other sources
          nullable: true
          pattern: ^\d{4}$
          type: string
          writeOnly: true
        order:
          description: >-
            If sending a batch of transactions, the order in which the
            transaction occurs, where a higher value is equivalent to a more
            recent transaction
          nullable: true
          type: integer
          writeOnly: true
        reference_id:
          description: Your unique ID for transaction
          example: my_favourite_transaction_231098
          maxLength: 140
          minLength: 1
          type: string
        request_id:
          description: >-
            ID associated with request, e.g., all transactions in same POST
            request will have same request_id
          example: req_2mNn6CZb7kWHnnhooiBqdJ
          nullable: true
          readOnly: true
          type: string
        timestamp:
          description: >-
            The ISO 8601 timezone aware timestamp of the transaction; takes
            precedence over 'date'
          example: '2021-11-12T10:38:05Z'
          format: date-time
          nullable: true
          type: string
        transaction_code:
          description: Code associated with transaction to indicate the type of transaction
          example: card
          maxLength: 140
          nullable: true
          type: string
      required:
        - account_id
        - amount
        - currency
        - description
        - reference_id
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````