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

# Enrich transactions (sync)

> Enrich and categorize transactions and consume them in a sync response. For business lending and underwriting, please use "Create end user transactions" instead. Please send a maximum of 249 transactions per request.




## OpenAPI

````yaml https://app.herondata.io/swagger post /api/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/transactions:
    post:
      tags:
        - Transactions
      summary: Enrich transactions (sync)
      description: >
        Enrich and categorize transactions and consume them in a sync response.
        For business lending and underwriting, please use "Create end user
        transactions" instead. Please send a maximum of 249 transactions per
        request.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionsPostSyncSchema'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  _summary:
                    properties:
                      request_id:
                        description: Unique UUID per request
                        type: string
                    type: object
                  transactions:
                    description: only returned for sync enrichment requests
                    items:
                      $ref: '#/components/schemas/TransactionPostOutput'
                    type: array
                type: object
          description: OK
        '413':
          content:
            application/json:
              schema:
                properties:
                  code:
                    example: 413
                    type: integer
                  description:
                    example: Transaction batch size exceeds max of 2500
                    type: string
                  name:
                    example: Payload Too Large
                    type: string
                type: object
          description: Payload Too Large
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TransactionsPostSyncSchema:
      properties:
        transactions:
          items:
            $ref: '#/components/schemas/Transaction1'
          minItems: 1
          type: array
      required:
        - transactions
      type: object
    TransactionPostOutput:
      properties:
        account_id:
          description: Your unique ID for account associated with transaction
          example: checking_account_202348
          maxLength: 400
          nullable: true
          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:
          description: The category associated with the transaction
          items:
            $ref: '#/components/schemas/TransactionAnnotation'
          type: array
        currency:
          description: ISO 4217 currency code
          example: USD
          maxLength: 3
          minLength: 3
          nullable: true
          type: string
        description:
          description: The text description for the transaction
          example: GOOGLE *ADS12340929 cc@google.com US
          type: string
        description_clean:
          description: The cleaned description of the transaction
          example: GOOGLE ADS
          type: string
        duplicate_of_id:
          description: >-
            Indicates that the transaction is a duplicate and gives the heron_id
            of the original
          example: txn_7Hc45iXThunX69UxihD5Ct
        end_user_id:
          description: Your unique ID for end user associated with transaction
          example: my_best_customer_203948
          maxLength: 140
          nullable: true
          type: string
        has_matching_transaction:
          description: >-
            Whether the transaction is a transfer; requires end_user_id and
            timestamp to be present
          type: boolean
        is_potential_duplicate:
          description: >-
            Indicates whether the transaction has another transaction similar to
            it
          readOnly: true
          type: boolean
        is_recurring:
          description: >-
            Whether the transaction is recurring or not; requires end_user_id
            and timestamp to be present
          type: boolean
        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
        merchant:
          allOf:
            - $ref: '#/components/schemas/Merchant'
          description: The merchant associated with the transaction
        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
        payment_processor:
          allOf:
            - $ref: '#/components/schemas/PaymentProcessor'
          description: The payment processor associated with the transaction
        reference_id:
          description: Your unique ID for transaction
          example: my_favourite_transaction_231098
          maxLength: 140
          nullable: true
          type: string
        request_id:
          description: >-
            ID associated with request, e.g., all transactions in same POST
            request will have same request_id
          example: req_hPc3dEHajaQKkKctTWQDfe
          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:
        - amount
        - description
      type: object
    Transaction1:
      properties:
        account_id:
          description: Your unique ID for account associated with transaction
          example: checking_account_202348
          maxLength: 400
          nullable: true
          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
          nullable: true
          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
        end_user_id:
          description: Your unique ID for end user associated with transaction
          example: my_best_customer_203948
          maxLength: 140
          nullable: true
          type: string
        heron_id:
          description: Unique ID of transaction; generated by Heron Data
          example: txn_jpHW6kY6Uhn7fyPQHZ5rNQ
          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
          nullable: true
          type: string
        request_id:
          description: >-
            ID associated with request, e.g., all transactions in same POST
            request will have same request_id
          example: req_hPc3dEHajaQKkKctTWQDfe
          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:
        - amount
        - description
      type: object
    TransactionAnnotation:
      properties:
        annotator:
          description: Annotator type
          example: predicted
          type: string
        confidence:
          description: The confidence associated with the category annotation
          example: 0.5
          type: number
        heron_id:
          description: Unique ID of category; generated by Heron Data
          example: ctg_6dgGnUZrbvPdfuUqzptZ3T
          type: string
        label:
          description: Label of category
          example: Rent
          type: string
        model_version:
          description: The model version that produced the categorisation
          example: f31d8ef7-0524-43c7-8e5f-bfe292864fd4
          type: string
      type: object
    Merchant:
      properties:
        categories:
          items:
            $ref: '#/components/schemas/MerchantCategory'
          readOnly: true
          type: array
        group_id:
          enum:
            - Uber
            - Google
            - Intuit
            - debt.mca_or_rbf
            - debt.non_bank_business
            - debt.equipment_and_auto_leasing
            - debt.mortgage
            - debt.personal_non_mortgage
            - debt.collections
            - debt.bank
            - invoice_factoring
            - fuel_provider
            - gambling_and_betting
            - null
          nullable: true
          type: string
        heron_id:
          example: mrc_QUhi7SeXoP4dcbpvAqbp29
          readOnly: true
          type: string
        icon_url:
          format: url
          nullable: true
          type: string
        is_priority:
          readOnly: true
          type: boolean
        logo_url:
          format: url
          nullable: true
          type: string
        name:
          type: string
        url:
          format: url
          type: string
      required:
        - name
        - url
      type: object
    PaymentProcessor:
      properties:
        heron_id:
          example: mrc_nRYdGU7nYuevb7qem65cEb
          readOnly: true
          type: string
        icon_url:
          default: null
          example: >-
            https://storage.googleapis.com/heron-merchant-assets/icons/mrc_nRYdGU7nYuevb7qem65cEb.svg
          format: url
          nullable: true
          readOnly: true
          type: string
        logo_url:
          default: null
          example: >-
            https://storage.googleapis.com/heron-merchant-assets/logos/mrc_nRYdGU7nYuevb7qem65cEb.svg
          format: url
          nullable: true
          readOnly: true
          type: string
        name:
          default: null
          example: Paypal
          nullable: true
          readOnly: true
          type: string
        url:
          default: null
          example: https://www.paypal.com
          format: url
          nullable: true
          readOnly: true
          type: string
      type: object
    MerchantCategory:
      properties:
        code:
          example: '7311'
          readOnly: true
          type: string
        description:
          default: null
          example: Advertising services
          nullable: true
          readOnly: true
          type: string
        slug:
          default: null
          example: advertising_services
          nullable: true
          readOnly: true
          type: string
      required:
        - code
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````