# Do not edit
openapi: 3.1.0
info:
  title: Flex Transactions API
  version: '2026-10-23'
  summary: Transactions
servers:
  - url: https://api.flex.one
security:
  - apiKey: []
paths:
  /transactions:
    get:
      summary: List transactions
      tags:
        - Endpoints
      operationId: list-transactions
      description: |
        List and filter transactions across your organizations. Your API key needs
        `transactions:read` permission in each organization you request.

        The `Accept` header selects the response format. `application/json` returns a
        paginated response and is the default. `application/x-ndjson` exports full
        transaction objects, and `text/csv` exports selected fields for spreadsheet use.

        See [Pagination & filtering](/fundamentals/pagination/) for shared query guidance.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - metadata
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/UniversalTransaction'
                  metadata:
                    $ref: '#/components/schemas/UniversalTransactionListMetadata'
              examples:
                bookTransfer:
                  summary: Settled $100 book transfer between two banking accounts
                  value:
                    data:
                      - id: 9582f963-6e86-4b8d-9124-9dc251a4fc76
                        organizationId: 3f8bbfa2-9257-4a7e-86d3-df1797b8e143
                        type: transfer
                        status: settled
                        direction: internal
                        date: '2026-11-15T14:00:00Z'
                        description: Book transfer
                        amount:
                          amount: 10000
                          scale: 2
                          currency: USD
                        sourceAmount:
                          amount: 10000
                          scale: 2
                          currency: USD
                        destinationAmount:
                          amount: 10000
                          scale: 2
                          currency: USD
                        source:
                          financialAccountId: 470195c7-4cf3-4df3-9f92-80848be0a3ad
                          name: Operating account
                        destination:
                          financialAccountId: c502fc7b-636f-42a0-a4d6-9c8e91f4de58
                          name: Reserve account
                        sourceFinancialAccount:
                          id: 470195c7-4cf3-4df3-9f92-80848be0a3ad
                          organizationId: 3f8bbfa2-9257-4a7e-86d3-df1797b8e143
                          type: banking
                        destinationFinancialAccount:
                          id: c502fc7b-636f-42a0-a4d6-9c8e91f4de58
                          organizationId: 3f8bbfa2-9257-4a7e-86d3-df1797b8e143
                          type: banking
                        attributes:
                          kind: book
                        createdAt: '2026-11-15T14:00:00Z'
                        lastModifiedAt: '2026-11-15T14:00:01Z'
                        lastModifiedBy: 464c4558-3d41-4255-ad4e-44414e434521
                    metadata:
                      pageSize: 25
                      sort: desc
                      sortBy: date
                      hasMore: false
            application/x-ndjson:
              schema:
                type: string
                format: binary
                description: |
                  One full transaction object per line, including IDs and type-specific attributes.
                  Exports all matching transactions; `pageSize` and `nextToken` do not limit the export.
            text/csv:
              schema:
                type: string
                format: binary
                description: |
                  Selected transaction fields under a fixed header, with names instead of IDs.
                  Amounts are decimal values in major units, with separate currency columns.
                  Type-specific attributes are omitted except `cardLastFour`, which is populated
                  for card purchases when available. Exports all matching transactions;
                  `pageSize` and `nextToken` do not limit the export.
        '400':
          description: Bad Request — an invalid `nextToken`, an incomplete money filter, an unresolvable `flex-version`, or a `flex-version` below 2026-09-21 on an API key, which is the version this operation became available to keys at
        '403':
          description: Forbidden — the caller may not read the requested scope, or holds no transaction read access anywhere
        '406':
          description: Unsupported Accept type.
        '408':
          description: The read timed out. `flexErrorCode` is `TRANSACTIONS_QUERY_TIMED_OUT`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionsErrorBody'
        '429':
          description: Too Many Requests, the rate limit was exceeded. Carries a `Retry-After` header in whole seconds.
      parameters:
        - in: query
          name: organizationIds
          schema:
            type: array
            items:
              type: string
              format: uuid
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 organization IDs. Your API key must have `transactions:read`
            in every requested organization; an unauthorized organization returns 403.
        - in: query
          name: types
          schema:
            type: array
            items:
              $ref: '#/components/schemas/UniversalTransactionType'
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 transaction types. `adjustment` records a balance adjustment,
            `card-purchase` records card activity, including refunds, `fee` records a fee,
            `interest` records interest, `repayment` records a repayment, and `transfer` records a transfer.
        - in: query
          name: statuses
          schema:
            type: array
            items:
              $ref: '#/components/schemas/UniversalTransactionStatus'
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 statuses. Each status matches only transaction types that
            support it; see the status field for each transaction type.
        - in: query
          name: sourceFinancialAccountIds
          schema:
            type: array
            items:
              type: string
              format: uuid
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 source account IDs. Matches the source side only. An
            account that cannot be resolved or is outside your permitted organizations returns 403.
        - in: query
          name: destinationFinancialAccountIds
          schema:
            type: array
            items:
              type: string
              format: uuid
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 destination account IDs. Matches the destination side only. An
            account that cannot be resolved or is outside your permitted organizations returns 403.
        - in: query
          name: financialAccountIds
          schema:
            type: array
            items:
              type: string
              format: uuid
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 account IDs. Matches either the source or destination side. An
            account that cannot be resolved or is outside your permitted organizations returns 403.
        - in: query
          name: dateAfter
          schema:
            type: string
            format: date-time
          description: Transactions dated on or after this instant.
        - in: query
          name: dateBefore
          schema:
            type: string
            format: date-time
          description: Transactions dated on or before this instant.
        - in: query
          name: createdAfter
          schema:
            type: string
            format: date-time
          description: Transactions created on or after this instant.
        - in: query
          name: createdBefore
          schema:
            type: string
            format: date-time
          description: Transactions created on or before this instant.
        - in: query
          name: lastModifiedAfter
          schema:
            type: string
            format: date-time
          description: Transactions last modified on or after this instant.
        - in: query
          name: lastModifiedBefore
          schema:
            type: string
            format: date-time
          description: Transactions last modified on or before this instant.
        - in: query
          name: amount
          schema:
            type: number
          description: |
            Amount in major units, compared against the transaction's magnitude.
            Must be sent together with `amountOperator`.
        - in: query
          name: amountOperator
          schema:
            type: string
            enum:
              - eq
              - gt
              - gte
              - lt
              - lte
          description: |
            Comparison applied to `amount`: `eq` means equal, `gt` greater than, `gte` greater
            than or equal, `lt` less than, and `lte` less than or equal. Required with `amount`.
        - in: query
          name: amountCurrency
          schema:
            type: string
          description: |
            Currency for the `amount` comparison. Without it, the comparison includes all
            currencies without converting between them. Has no effect when `amount` is omitted.
        - in: query
          name: programKeys
          schema:
            type: array
            items:
              type: string
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 program keys. Matches card purchases, repayments, and
            transfers only; other transaction types do not match this filter.
        - in: query
          name: externalIds
          schema:
            type: array
            items:
              type: string
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 exact identifiers from originating systems. A transaction
            matches if any of its external identifiers matches a supplied value.
        - in: query
          name: personIds
          schema:
            type: array
            items:
              type: string
              format: uuid
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 cardholder IDs. Matches card purchases only. A person that
            cannot be resolved or is outside your permitted organizations returns 403.
        - in: query
          name: cardIds
          schema:
            type: array
            items:
              type: string
              format: uuid
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 card IDs. Matches card purchases only; purchases without
            a recorded card ID do not match.
        - in: query
          name: search
          schema:
            type: string
          description: |
            Search transaction descriptions, memos, account nicknames, and merchant names
            by text similarity. Leading and trailing whitespace is ignored; blank input
            does not apply a search filter.

            A full UUID or UUID prefix searches transaction, organization, account, and
            related record IDs instead. A prefix must contain at least eight hexadecimal
            digits. Hyphens may be omitted; when present, they must occupy standard UUID
            positions. All-digit input without hyphens uses text search.
        - in: query
          name: nextToken
          schema:
            type: string
            format: uuid
          description: |
            Continuation token for a JSON page. Returns 400 if its transaction no longer
            matches the filters and permissions. Must be a valid UUID when supplied,
            including for NDJSON and CSV exports, where it does not affect the exported
            results. See [Pagination & filtering](/fundamentals/pagination/).
        - in: query
          name: pageSize
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          description: |
            Maximum transactions per JSON page. Defaults to 25; accepts 1 through 100.
            The same limits are validated for NDJSON and CSV requests, but exports
            include all matching transactions regardless of the supplied page size.
        - in: query
          name: sort
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          description: |
            Sort direction: `asc` for ascending or `desc` for descending. Defaults to `desc`.
        - in: query
          name: sortBy
          schema:
            type: string
            enum:
              - amount
              - createdAt
              - date
              - lastModifiedAt
              - status
          description: |
            Sort by `amount` for the amount magnitude in major units, `createdAt` for
            creation time, `date` for transaction date, `lastModifiedAt` for modification
            time, or `status` for alphabetical status order. Defaults to `date`. Amount
            sorting does not convert currencies.

            When text search is used and `sortBy` is omitted, results are ordered by
            relevance first, then by `date`. UUID and UUID-prefix searches use the default
            date order.
        - $ref: '#/components/parameters/flexVersion'
  /universal-transactions:
    get:
      deprecated: true
      summary: List universal transactions
      tags:
        - Endpoints
      operationId: getUniversalTransactions
      description: |
        Deprecated alias for `GET /transactions`. Use that endpoint for new integrations.

        List and filter transactions across your organizations. Your API key needs
        `transactions:read` permission in each organization you request.

        The `Accept` header selects the response format. `application/json` returns a
        paginated response and is the default. `application/x-ndjson` exports full
        transaction objects, and `text/csv` exports selected fields for spreadsheet use.

        See [Pagination & filtering](/fundamentals/pagination/) for shared query guidance.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - metadata
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/UniversalTransaction'
                  metadata:
                    $ref: '#/components/schemas/UniversalTransactionListMetadata'
            application/x-ndjson:
              schema:
                type: string
                format: binary
                description: |
                  One full transaction object per line, including IDs and type-specific attributes.
                  Exports all matching transactions; `pageSize` and `nextToken` do not limit the export.
            text/csv:
              schema:
                type: string
                format: binary
                description: |
                  Selected transaction fields under a fixed header, with names instead of IDs.
                  Amounts are decimal values in major units, with separate currency columns.
                  Type-specific attributes are omitted except `cardLastFour`, which is populated
                  for card purchases when available. Exports all matching transactions;
                  `pageSize` and `nextToken` do not limit the export.
        '400':
          description: Bad Request — an invalid `nextToken`, an incomplete money filter, or an unresolvable `flex-version`
        '403':
          description: Forbidden — the caller may not read the requested scope, or holds no transaction read access anywhere
        '406':
          description: Unsupported Accept type.
        '408':
          description: The read timed out. `flexErrorCode` is `TRANSACTIONS_QUERY_TIMED_OUT`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionsErrorBody'
        '429':
          description: Too Many Requests, the rate limit was exceeded. Carries a `Retry-After` header in whole seconds.
      parameters:
        - in: query
          name: organizationIds
          schema:
            type: array
            items:
              type: string
              format: uuid
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 organization IDs. Your API key must have `transactions:read`
            in every requested organization; an unauthorized organization returns 403.
        - in: query
          name: types
          schema:
            type: array
            items:
              $ref: '#/components/schemas/UniversalTransactionType'
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 transaction types. `adjustment` records a balance adjustment,
            `card-purchase` records card activity, including refunds, `fee` records a fee,
            `interest` records interest, `repayment` records a repayment, and `transfer` records a transfer.
        - in: query
          name: statuses
          schema:
            type: array
            items:
              $ref: '#/components/schemas/UniversalTransactionStatus'
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 statuses. Each status matches only transaction types that
            support it; see the status field for each transaction type.
        - in: query
          name: sourceFinancialAccountIds
          schema:
            type: array
            items:
              type: string
              format: uuid
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 source account IDs. Matches the source side only. An
            account that cannot be resolved or is outside your permitted organizations returns 403.
        - in: query
          name: destinationFinancialAccountIds
          schema:
            type: array
            items:
              type: string
              format: uuid
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 destination account IDs. Matches the destination side only. An
            account that cannot be resolved or is outside your permitted organizations returns 403.
        - in: query
          name: financialAccountIds
          schema:
            type: array
            items:
              type: string
              format: uuid
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 account IDs. Matches either the source or destination side. An
            account that cannot be resolved or is outside your permitted organizations returns 403.
        - in: query
          name: dateAfter
          schema:
            type: string
            format: date-time
          description: Transactions dated on or after this instant.
        - in: query
          name: dateBefore
          schema:
            type: string
            format: date-time
          description: Transactions dated on or before this instant.
        - in: query
          name: createdAfter
          schema:
            type: string
            format: date-time
          description: Transactions created on or after this instant.
        - in: query
          name: createdBefore
          schema:
            type: string
            format: date-time
          description: Transactions created on or before this instant.
        - in: query
          name: lastModifiedAfter
          schema:
            type: string
            format: date-time
          description: Transactions last modified on or after this instant.
        - in: query
          name: lastModifiedBefore
          schema:
            type: string
            format: date-time
          description: Transactions last modified on or before this instant.
        - in: query
          name: amount
          schema:
            type: number
          description: |
            Amount in major units, compared against the transaction's magnitude.
            Must be sent together with `amountOperator`.
        - in: query
          name: amountOperator
          schema:
            type: string
            enum:
              - eq
              - gt
              - gte
              - lt
              - lte
          description: |
            Comparison applied to `amount`: `eq` means equal, `gt` greater than, `gte` greater
            than or equal, `lt` less than, and `lte` less than or equal. Required with `amount`.
        - in: query
          name: amountCurrency
          schema:
            type: string
          description: |
            Currency for the `amount` comparison. Without it, the comparison includes all
            currencies without converting between them. Has no effect when `amount` is omitted.
        - in: query
          name: programKeys
          schema:
            type: array
            items:
              type: string
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 program keys. Matches card purchases, repayments, and
            transfers only; other transaction types do not match this filter.
        - in: query
          name: externalIds
          schema:
            type: array
            items:
              type: string
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 exact identifiers from originating systems. A transaction
            matches if any of its external identifiers matches a supplied value.
        - in: query
          name: personIds
          schema:
            type: array
            items:
              type: string
              format: uuid
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 cardholder IDs. Matches card purchases only. A person that
            cannot be resolved or is outside your permitted organizations returns 403.
        - in: query
          name: cardIds
          schema:
            type: array
            items:
              type: string
              format: uuid
            maxItems: 10
          style: form
          explode: true
          description: |
            Filter by up to 10 card IDs. Matches card purchases only; purchases without
            a recorded card ID do not match.
        - in: query
          name: search
          schema:
            type: string
          description: |
            Search transaction descriptions, memos, account nicknames, and merchant names
            by text similarity. Leading and trailing whitespace is ignored; blank input
            does not apply a search filter.

            A full UUID or UUID prefix searches transaction, organization, account, and
            related record IDs instead. A prefix must contain at least eight hexadecimal
            digits. Hyphens may be omitted; when present, they must occupy standard UUID
            positions. All-digit input without hyphens uses text search.
        - in: query
          name: nextToken
          schema:
            type: string
            format: uuid
          description: |
            Continuation token for a JSON page. Returns 400 if its transaction no longer
            matches the filters and permissions. Must be a valid UUID when supplied,
            including for NDJSON and CSV exports, where it does not affect the exported
            results. See [Pagination & filtering](/fundamentals/pagination/).
        - in: query
          name: pageSize
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          description: |
            Maximum transactions per JSON page. Defaults to 25; accepts 1 through 100.
            The same limits are validated for NDJSON and CSV requests, but exports
            include all matching transactions regardless of the supplied page size.
        - in: query
          name: sort
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          description: |
            Sort direction: `asc` for ascending or `desc` for descending. Defaults to `desc`.
        - in: query
          name: sortBy
          schema:
            type: string
            enum:
              - amount
              - createdAt
              - date
              - lastModifiedAt
              - status
          description: |
            Sort by `amount` for the amount magnitude in major units, `createdAt` for
            creation time, `date` for transaction date, `lastModifiedAt` for modification
            time, or `status` for alphabetical status order. Defaults to `date`. Amount
            sorting does not convert currencies.

            When text search is used and `sortBy` is omitted, results are ordered by
            relevance first, then by `date`. UUID and UUID-prefix searches use the default
            date order.
        - $ref: '#/components/parameters/flexVersion'
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
  parameters:
    flexVersion:
      in: header
      name: flex-version
      required: false
      example: '2026-10-23'
      schema:
        type: string
        pattern: ^\d{4}-\d{2}-\d{2}$
  schemas:
    TransactionsErrorBody:
      title: TransactionsErrorBody
      type: object
      description: Transactions error body.
      required:
        - statusCode
        - message
      properties:
        statusCode:
          type: integer
          description: HTTP status code echoed in the body.
        message:
          type: string
          description: Human-readable error message.
        errors:
          type: object
          description: Optional field-level error details. May be absent.
          additionalProperties: true
        flexErrorCode:
          $ref: '#/components/schemas/TransactionsFlexErrorCodes'
    TransactionsFlexErrorCodes:
      title: TransactionsFlexErrorCodes
      type: string
      description: Machine-readable error codes returned by the transactions endpoints.
      enum:
        - TRANSACTIONS_QUERY_TIMED_OUT
    UniversalAdjustmentAttributes:
      title: UniversalAdjustmentAttributes
      type: object
      properties:
        origin:
          $ref: '#/components/schemas/UniversalAdjustmentOrigin'
          description: |
            What the adjustment represents. `credit-limit-init` means credit limit initialized;
            `dispute-credit` means dispute credit; `dispute-reversal` means dispute credit reversal;
            `fee-reversal` means fee reversal; `interest-reversal` means interest reversal;
            `late-settlement-adjustment` means late settlement; `negative-adjustment` means account
            credit; `negative-credit-limit-change` means credit limit decrease;
            `negative-fraud-charge-off` means fraud charge-off; `negative-rebate` means rebate;
            `nopay-charge-off` means charge-off; `positive-adjustment` means account charge;
            `positive-credit-limit-change` means credit limit increase; `positive-fraud-charge-off`
            means fraud charge-off reversal; `positive-rebate` means rebate reversal;
            `repayment-refund` means repayment refund.
            Omitted when the adjustment origin is not recorded.
    UniversalAdjustmentOrigin:
      title: UniversalAdjustmentOrigin
      type: string
      description: |
        What the adjustment represents. `credit-limit-init` means credit limit initialized;
        `dispute-credit` means dispute credit; `dispute-reversal` means dispute credit reversal;
        `fee-reversal` means fee reversal; `interest-reversal` means interest reversal;
        `late-settlement-adjustment` means late settlement; `negative-adjustment` means account
        credit; `negative-credit-limit-change` means credit limit decrease;
        `negative-fraud-charge-off` means fraud charge-off; `negative-rebate` means rebate;
        `nopay-charge-off` means charge-off; `positive-adjustment` means account charge;
        `positive-credit-limit-change` means credit limit increase; `positive-fraud-charge-off`
        means fraud charge-off reversal; `positive-rebate` means rebate reversal;
        `repayment-refund` means repayment refund.
      enum:
        - credit-limit-init
        - dispute-credit
        - dispute-reversal
        - fee-reversal
        - interest-reversal
        - late-settlement-adjustment
        - negative-adjustment
        - negative-credit-limit-change
        - negative-fraud-charge-off
        - negative-rebate
        - nopay-charge-off
        - positive-adjustment
        - positive-credit-limit-change
        - positive-fraud-charge-off
        - positive-rebate
        - repayment-refund
    UniversalAdjustmentStatus:
      description: |
        Current status. `canceled` means canceled before completion; `failed` means failed during
        processing; `returned` means returned after processing; `settled` means completed and
        settled.
      title: UniversalAdjustmentStatus
      type: string
      enum:
        - canceled
        - failed
        - returned
        - settled
    UniversalAdjustmentTransaction:
      title: UniversalAdjustmentTransaction
      allOf:
        - $ref: '#/components/schemas/UniversalTransactionBase'
        - type: object
          required:
            - type
            - status
            - attributes
          properties:
            type:
              type: string
              description: Always `adjustment`.
              enum:
                - adjustment
            status:
              $ref: '#/components/schemas/UniversalAdjustmentStatus'
              description: |
                Current status. `canceled` means canceled before completion; `failed` means
                failed during processing; `returned` means returned after processing;
                `settled` means completed and settled.
            attributes:
              $ref: '#/components/schemas/UniversalAdjustmentAttributes'
              description: Type-specific fields for an adjustment.
    UniversalCardPurchaseAttributes:
      title: UniversalCardPurchaseAttributes
      type: object
      required:
        - personId
      properties:
        personId:
          type: string
          format: uuid
          description: |
            ID of the cardholder. Present on every card purchase.
        personName:
          type: string
          description: The cardholder's display name. Absent when the person carries no name.
        cardId:
          type: string
          format: uuid
          description: The card used for the purchase.
        cardName:
          type: string
          description: The card's nickname.
        cardLastFour:
          type: string
          description: The last four digits of the card number.
        merchant:
          $ref: '#/components/schemas/UniversalCardPurchaseMerchant'
          description: The merchant the purchase was made with.
        linkedCardPurchaseId:
          type: string
          format: uuid
          description: The original purchase this row derives from, set on refunds and chargebacks.
        declineReason:
          $ref: '#/components/schemas/UniversalDeclineReason'
          description: |
            Reason for a declined card purchase. `avs_mismatch` means address verification did
            not match; `closed` means the account or card is closed; `country_blocked` means the
            merchant country is blocked; `delinquent` means the account is delinquent;
            `duplicate_transaction` means the transaction was identified as a duplicate;
            `frozen` means the account or card is frozen; `inactive_business` means the business
            is inactive; `inactive_card` means the card is inactive; `inactive_person` means the
            cardholder is inactive; `insufficient_funds` means available funds are insufficient;
            `internal_error` means processing failed within Flex; `loc_limit` means the line of
            credit limit was exceeded; `mcc_blocked` means the merchant category is blocked;
            `network_decline` means the card network declined the purchase;
            `ofac_sanctioned_country` means the merchant country is subject to OFAC sanctions;
            `other` means another or unrecognized reason applies; `oversized_refund` means the
            refund exceeds the allowed amount; `restricted` means the account or card is
            restricted; `unactivated_card` means the card has not been activated;
            `unauthorized_vendor` means the merchant is not authorized; `velocity` means a
            transaction frequency or volume limit was exceeded.
            Omitted when no decline reason was recorded, including historical purchases
            without this data.
          enum:
            - avs_mismatch
            - closed
            - country_blocked
            - delinquent
            - duplicate_transaction
            - frozen
            - inactive_business
            - inactive_card
            - inactive_person
            - insufficient_funds
            - internal_error
            - loc_limit
            - mcc_blocked
            - network_decline
            - ofac_sanctioned_country
            - other
            - oversized_refund
            - restricted
            - unactivated_card
            - unauthorized_vendor
            - velocity
        merchantAmount:
          type: string
          description: |
            Amount the merchant charged, in the merchant currency's major units as the network reported
            it (e.g. `22.99`). Present only on card purchases made in a non-USD currency; absent for
            USD purchases and rows that predate capture. Set together with `merchantCurrencyCode` and
            `merchantConversionRate`. This is the first figure the network reported: the
            authorization's, or the clearing's when the authorization carried none (force captures,
            auth-plus-capture). Once set it stays, while incremental authorizations and clearings can
            move `amount`.
        merchantCurrencyCode:
          type: string
          description: |
            ISO 4217 alphabetic currency code for `merchantAmount`. Returned together
            with `merchantAmount` and `merchantConversionRate`.
        merchantConversionRate:
          type: string
          description: |
            Network conversion rate from the merchant currency to USD. Returned together
            with `merchantAmount` and `merchantCurrencyCode`.
    UniversalCardPurchaseMerchant:
      title: UniversalCardPurchaseMerchant
      type: object
      description: The merchant a card purchase was made with.
      required:
        - name
      properties:
        name:
          type: string
          description: The merchant's name.
        mcc:
          type: string
          description: The merchant category code.
        category:
          type: string
          description: The merchant's category.
        logoUrl:
          type: string
          description: URL to the merchant's logo.
    UniversalCardPurchaseStatus:
      description: |
        Current status. `authorized` means the card purchase was authorized; `declined` means the
        card purchase was declined; `disputed` means the card purchase is disputed; `expired` means
        the card authorization expired; `refund-cleared` means the refund cleared; `refund-pending`
        means the refund is pending; `refund-unsuccessful` means the refund was unsuccessful;
        `settled` means completed and settled.
      title: UniversalCardPurchaseStatus
      type: string
      enum:
        - authorized
        - declined
        - disputed
        - expired
        - refund-cleared
        - refund-pending
        - refund-unsuccessful
        - settled
    UniversalCardPurchaseTransaction:
      title: UniversalCardPurchaseTransaction
      allOf:
        - $ref: '#/components/schemas/UniversalTransactionBase'
        - type: object
          required:
            - type
            - status
            - attributes
          properties:
            type:
              type: string
              description: Always `card-purchase`.
              enum:
                - card-purchase
            status:
              $ref: '#/components/schemas/UniversalCardPurchaseStatus'
              description: |
                Current status. `authorized` means the card purchase was authorized;
                `declined` means the card purchase was declined; `disputed` means the card
                purchase is disputed; `expired` means the card authorization expired;
                `refund-cleared` means the refund cleared; `refund-pending` means the refund
                is pending; `refund-unsuccessful` means the refund was unsuccessful;
                `settled` means completed and settled.
            attributes:
              $ref: '#/components/schemas/UniversalCardPurchaseAttributes'
              description: Type-specific fields for a card purchase.
    UniversalDeclineReason:
      title: UniversalDeclineReason
      type: string
      description: Why the purchase was declined. `internal_error` indicates a processing failure. `other` indicates a decline reason not covered by the listed values.
      enum:
        - avs_mismatch
        - closed
        - country_blocked
        - delinquent
        - duplicate_transaction
        - frozen
        - inactive_business
        - inactive_card
        - inactive_person
        - insufficient_funds
        - internal_error
        - loc_limit
        - mcc_blocked
        - network_decline
        - ofac_sanctioned_country
        - other
        - oversized_refund
        - program_kill_switch
        - restricted
        - substrate_write_failed
        - transfer_error
        - unactivated_card
        - unauthorized_vendor
        - velocity
    UniversalFeeAttributes:
      title: UniversalFeeAttributes
      type: object
      properties:
        feeTypeName:
          type: string
          description: The kind of fee charged.
    UniversalFeeStatus:
      description: |
        Current status. `canceled` means canceled before completion; `failed` means failed during
        processing; `pending` means awaiting processing or completion; `returned` means returned
        after processing; `settled` means completed and settled.
      title: UniversalFeeStatus
      type: string
      enum:
        - canceled
        - failed
        - pending
        - returned
        - settled
    UniversalFeeTransaction:
      title: UniversalFeeTransaction
      allOf:
        - $ref: '#/components/schemas/UniversalTransactionBase'
        - type: object
          required:
            - type
            - status
            - attributes
          properties:
            type:
              type: string
              description: Always `fee`.
              enum:
                - fee
            status:
              $ref: '#/components/schemas/UniversalFeeStatus'
              description: |
                Current status. `canceled` means canceled before completion; `failed` means
                failed during processing; `pending` means awaiting processing or completion;
                `returned` means returned after processing; `settled` means completed and
                settled.
            attributes:
              $ref: '#/components/schemas/UniversalFeeAttributes'
              description: Type-specific fields for a fee.
    UniversalInterestAttributes:
      title: UniversalInterestAttributes
      type: object
      description: Interest transactions carry no type-specific attributes.
      properties: {}
    UniversalInterestStatus:
      description: |
        Current status. `canceled` means canceled before completion; `failed` means failed during
        processing; `returned` means returned after processing; `settled` means completed and
        settled.
      title: UniversalInterestStatus
      type: string
      enum:
        - canceled
        - failed
        - returned
        - settled
    UniversalInterestTransaction:
      title: UniversalInterestTransaction
      allOf:
        - $ref: '#/components/schemas/UniversalTransactionBase'
        - type: object
          required:
            - type
            - status
            - attributes
          properties:
            type:
              type: string
              description: Always `interest`.
              enum:
                - interest
            status:
              $ref: '#/components/schemas/UniversalInterestStatus'
              description: |
                Current status. `canceled` means canceled before completion; `failed` means
                failed during processing; `returned` means returned after processing;
                `settled` means completed and settled.
            attributes:
              $ref: '#/components/schemas/UniversalInterestAttributes'
              description: Type-specific fields for an interest transaction.
    UniversalRampTransferFees:
      title: UniversalRampTransferFees
      type: object
      description: 'What the customer was charged for a conversion, split into the components a statement or a receipt would name. Every component is in USD: a fee taken in USDC or USDT is valued 1:1 as dollars, so a 1.344 USDT fee reports as $1.34. A component Flex absorbs reports zero rather than going missing. The three add up to the total.'
      required:
        - banking
        - network
        - transaction
      properties:
        banking:
          $ref: '#/components/schemas/UniversalTransactionAmount'
          description: The banking rail's charge for moving the fiat leg.
        network:
          $ref: '#/components/schemas/UniversalTransactionAmount'
          description: The blockchain network's charge for settling the onchain leg.
        transaction:
          $ref: '#/components/schemas/UniversalTransactionAmount'
          description: The charge for performing the conversion itself.
    UniversalRepaymentAttributes:
      title: UniversalRepaymentAttributes
      type: object
      properties:
        instantCreditEnabled:
          type: boolean
          description: Whether the repayment credited the line immediately rather than on settlement.
    UniversalRepaymentStatus:
      description: |
        Current status. `canceled` means canceled before completion; `failed` means failed during
        processing; `pending` means awaiting processing or completion; `returned` means returned
        after processing; `settled` means completed and settled.
      title: UniversalRepaymentStatus
      type: string
      enum:
        - canceled
        - failed
        - pending
        - returned
        - settled
    UniversalRepaymentTransaction:
      title: UniversalRepaymentTransaction
      allOf:
        - $ref: '#/components/schemas/UniversalTransactionBase'
        - type: object
          required:
            - type
            - status
            - attributes
          properties:
            type:
              type: string
              description: Always `repayment`.
              enum:
                - repayment
            status:
              $ref: '#/components/schemas/UniversalRepaymentStatus'
              description: |
                Current status. `canceled` means canceled before completion; `failed` means
                failed during processing; `pending` means awaiting processing or completion;
                `returned` means returned after processing; `settled` means completed and
                settled.
            attributes:
              $ref: '#/components/schemas/UniversalRepaymentAttributes'
              description: Type-specific fields for a repayment.
    UniversalTransaction:
      title: UniversalTransaction
      description: |
        A stateful attempt to change an account balance. `type` determines the
        transaction's supported statuses and the details returned in `attributes`.
      oneOf:
        - $ref: '#/components/schemas/UniversalAdjustmentTransaction'
        - $ref: '#/components/schemas/UniversalCardPurchaseTransaction'
        - $ref: '#/components/schemas/UniversalFeeTransaction'
        - $ref: '#/components/schemas/UniversalInterestTransaction'
        - $ref: '#/components/schemas/UniversalRepaymentTransaction'
        - $ref: '#/components/schemas/UniversalTransferTransaction'
    UniversalTransactionAccountType:
      title: UniversalTransactionAccountType
      type: string
      description: |
        Account type as represented in this transaction: `banking` identifies a banking
        account, `crypto` identifies a cryptocurrency account (including stablecoins),
        `rewardCard` identifies a Reward Card line of credit, and `other`
        identifies an account not classified by these categories. An investment account, when
        included as a transaction side, is represented as `other`. These values differ
        from the account types returned by `GET /accounts`.
      enum:
        - banking
        - crypto
        - other
        - rewardCard
    UniversalTransactionAmount:
      title: UniversalTransactionAmount
      type: object
      required:
        - amount
        - scale
      properties:
        amount:
          type: integer
          format: int64
          description: Amount in minor units, always positive.
        scale:
          description: |
            Number of decimal places in `amount`. See [Amounts](/fundamentals/amounts/).
          type: integer
        currency:
          description: |
            Currency of the amount. Defaults to `USD`.
          type: string
          default: USD
    UniversalTransactionBase:
      title: UniversalTransactionBase
      description: |
        The common transaction fields and the accounts included in the response.
        `direction` is `in` when only the destination account is included, `out` when
        only the source account is included, and `internal` when both are included.
        It describes the included accounts, not whether the transaction has settled.
      oneOf:
        - $ref: '#/components/schemas/UniversalTransactionMoneyIn'
        - $ref: '#/components/schemas/UniversalTransactionMoneyOut'
        - $ref: '#/components/schemas/UniversalTransactionMoneyInternal'
      discriminator:
        propertyName: direction
        mapping:
          in: '#/components/schemas/UniversalTransactionMoneyIn'
          out: '#/components/schemas/UniversalTransactionMoneyOut'
          internal: '#/components/schemas/UniversalTransactionMoneyInternal'
    UniversalTransactionFields:
      title: UniversalTransactionFields
      type: object
      description: The fields every transaction carries, independent of its type or direction.
      required:
        - id
        - organizationId
        - date
        - amount
        - sourceAmount
        - destinationAmount
        - createdAt
        - lastModifiedAt
      properties:
        id:
          type: string
          format: uuid
          description: Stable identifier for this transaction. Safe to store and deduplicate on. Carries no encoded meaning, do not parse it.
        organizationId:
          type: string
          format: uuid
          description: The organization the transaction belongs to.
        organizationName:
          type: string
          description: |
            Display name of the organization. Omitted when no name is available.
        date:
          type: string
          format: date-time
          description: When the transaction occurred, as distinct from when it was created or last modified.
        description:
          type: string
          description: The transaction line as a member reads it, such as "TIKTOKADS - Card 1234" or "Direct Deposit".
        memo:
          type: string
          description: Free-form note attached to the transaction, if any.
        amount:
          $ref: '#/components/schemas/UniversalTransactionAmount'
          description: The transaction amount.
        sourceAmount:
          description: |
            Amount on the source side. Uses the transaction amount when no separate source
            amount is recorded.
          $ref: '#/components/schemas/UniversalTransactionAmount'
        destinationAmount:
          description: |
            Amount on the destination side. Uses the transaction amount when no separate
            destination amount is recorded.
          $ref: '#/components/schemas/UniversalTransactionAmount'
        createdAt:
          type: string
          format: date-time
          description: When the transaction was created.
        lastModifiedAt:
          type: string
          format: date-time
          description: When the transaction was last modified.
        source:
          $ref: '#/components/schemas/UniversalTransactionSide'
          description: Where the money came from.
        destination:
          $ref: '#/components/schemas/UniversalTransactionSide'
          description: Where the money went.
    UniversalTransactionFinancialAccount:
      title: UniversalTransactionFinancialAccount
      type: object
      description: The financial account on one side of a transaction.
      required:
        - id
        - organizationId
        - type
      properties:
        id:
          type: string
          format: uuid
          description: The financial account's id.
        nickname:
          type: string
          description: The account's display name, as the customer set it.
        organizationId:
          type: string
          format: uuid
          description: The organization that owns the account.
        type:
          $ref: '#/components/schemas/UniversalTransactionAccountType'
          description: |
            Account type as represented in this transaction: `banking` identifies a banking
            account, `crypto` identifies a cryptocurrency account (including stablecoins),
            `rewardCard` identifies a Reward Card line of credit, and `other`
            identifies an account not classified by these categories. An investment account, when
            included as a transaction side, is represented as `other`. These values differ
            from the account types returned by `GET /accounts`.
    UniversalTransactionListMetadata:
      title: UniversalTransactionListMetadata
      type: object
      description: Pagination details for the returned page.
      required:
        - pageSize
        - sort
        - sortBy
        - hasMore
      properties:
        pageSize:
          description: |
            Maximum number of transactions requested for this page.
          type: integer
        sort:
          description: |
            Applied sort direction. `asc` is ascending and `desc` is descending.
          type: string
          enum:
            - asc
            - desc
        sortBy:
          description: |
            Applied sort field. `amount` is the amount magnitude, `createdAt` is creation
            time, `date` is transaction date, `lastModifiedAt` is modification time, and
            `status` is alphabetical status order. For text search without an explicit
            `sortBy`, this is `date`, with relevance taking priority.
          type: string
          enum:
            - amount
            - createdAt
            - date
            - lastModifiedAt
            - status
        hasMore:
          description: |
            Whether another page of matching transactions is available.
          type: boolean
        nextToken:
          type: string
          format: uuid
          description: Present exactly when `hasMore` is true.
    UniversalTransactionMoneyIn:
      title: UniversalTransactionMoneyIn
      description: |
        A transaction with the destination account information included.
      allOf:
        - $ref: '#/components/schemas/UniversalTransactionFields'
        - type: object
          required:
            - direction
            - destinationFinancialAccount
          properties:
            direction:
              type: string
              description: The value `in` indicates that the destination account information is included.
              enum:
                - in
            destinationFinancialAccount:
              $ref: '#/components/schemas/UniversalTransactionFinancialAccount'
              description: The destination account for this transaction.
    UniversalTransactionMoneyInternal:
      title: UniversalTransactionMoneyInternal
      description: |
        A transaction with the source and destination account information included.
      allOf:
        - $ref: '#/components/schemas/UniversalTransactionFields'
        - type: object
          required:
            - direction
            - sourceFinancialAccount
            - destinationFinancialAccount
          properties:
            direction:
              type: string
              description: The value `internal` indicates that the source and destination account information is included.
              enum:
                - internal
            sourceFinancialAccount:
              $ref: '#/components/schemas/UniversalTransactionFinancialAccount'
              description: The source account for this transaction.
            destinationFinancialAccount:
              $ref: '#/components/schemas/UniversalTransactionFinancialAccount'
              description: The destination account for this transaction.
    UniversalTransactionMoneyOut:
      title: UniversalTransactionMoneyOut
      description: |
        A transaction with the source account information included.
      allOf:
        - $ref: '#/components/schemas/UniversalTransactionFields'
        - type: object
          required:
            - direction
            - sourceFinancialAccount
          properties:
            direction:
              type: string
              description: The value `out` indicates that the source account information is included.
              enum:
                - out
            sourceFinancialAccount:
              $ref: '#/components/schemas/UniversalTransactionFinancialAccount'
              description: The source account for this transaction.
    UniversalTransactionSide:
      title: UniversalTransactionSide
      type: object
      description: One side of a transaction, named as the reading organization sees it. A side that is not a Flex account, such as the merchant on a card purchase, carries a name and no id.
      required:
        - name
      properties:
        financialAccountId:
          type: string
          format: uuid
          description: The account on this side, present only when the caller may see it.
        name:
          type: string
          description: Display name for this side.
    UniversalTransactionStatus:
      title: UniversalTransactionStatus
      type: string
      description: |
        Status values across all transaction types. Not every value is valid for
        every type.
      enum:
        - acknowledged
        - authorized
        - canceled
        - clearing
        - declined
        - disputed
        - expired
        - failed
        - hold
        - initiated
        - manual-review
        - pending
        - pending-return
        - refund-cleared
        - refund-pending
        - refund-unsuccessful
        - rejected
        - return-contested
        - return-dishonored
        - returned
        - scheduled
        - settled
        - submitted
    UniversalTransactionType:
      description: |
        Transaction type. `adjustment` records a balance adjustment,
        `card-purchase` records card activity, including refunds, `fee` records a fee,
        `interest` records interest, `repayment` records a repayment, and `transfer` records a transfer.
      title: UniversalTransactionType
      type: string
      enum:
        - adjustment
        - card-purchase
        - fee
        - interest
        - repayment
        - transfer
    UniversalTransferAttributes:
      title: UniversalTransferAttributes
      type: object
      properties:
        blockExplorerUrl:
          type: string
          format: uri
          description: Where to see the transfer's onchain leg on a block explorer, carrying both the chain and the hash. Present on a stablecoin ramp once its send is broadcast, and on a wallet send or receive from the moment it is recorded; absent before that, and on transfers that have no onchain leg.
        fees:
          $ref: '#/components/schemas/UniversalRampTransferFees'
          description: Present on a stablecoin ramp once its order is priced; absent while one is in flight, and on transfers that are not ramps.
        kind:
          $ref: '#/components/schemas/UniversalTransferKind'
          description: |
            Transfer mechanism. `ach-credit` identifies an ACH credit; `ach-debit` identifies an
            ACH debit; `book` identifies a transfer between accounts held at the same provider;
            `deposited-check` identifies a check deposit; `international-wire` identifies an
            international wire transfer; `issued-check` identifies a payment by issued check;
            `realtime` identifies a real-time transfer; `stablecoin` identifies a stablecoin
            transfer; `wire` identifies a wire transfer.
            Omitted when the transfer mechanism is not exposed by this API.
        linkedCardPurchaseId:
          type: string
          format: uuid
          description: The card purchase this transfer is paired with.
        statusReason:
          $ref: '#/components/schemas/UniversalTransferStatusReason'
          description: Present while a stablecoin ramp is held or after it has failed; absent while one is proceeding normally.
    UniversalTransferKind:
      description: |
        Transfer mechanism. `ach-credit` identifies an ACH credit; `ach-debit` identifies an ACH
        debit; `book` identifies a transfer between accounts held at the same provider;
        `deposited-check` identifies a check deposit; `international-wire` identifies an
        international wire transfer; `issued-check` identifies a payment by issued check; `realtime`
        identifies a real-time transfer; `stablecoin` identifies a stablecoin transfer; `wire`
        identifies a wire transfer.
      title: UniversalTransferKind
      type: string
      enum:
        - ach-credit
        - ach-debit
        - book
        - deposited-check
        - international-wire
        - issued-check
        - realtime
        - stablecoin
        - wire
    UniversalTransferStatus:
      description: |
        Current status. `acknowledged` means the provider confirmed receipt; `canceled` means
        canceled before completion; `clearing` means funds are clearing; `failed` means failed
        during processing; `hold` means funds are held by the provider, compliance, or operations;
        `initiated` means started but not yet sent to the provider; `manual-review` means held for
        human review; `pending` means awaiting processing or completion; `pending-return` means a
        return is in progress; `rejected` means rejected before execution; `return-contested` means
        the returning bank contested a dishonored return; `return-dishonored` means the originating
        bank dishonored the return; `returned` means returned after processing; `scheduled` means
        scheduled for a future date; `settled` means completed and settled; `submitted` means sent
        to the provider but not yet acknowledged.
      title: UniversalTransferStatus
      type: string
      enum:
        - acknowledged
        - canceled
        - clearing
        - failed
        - hold
        - initiated
        - manual-review
        - pending
        - pending-return
        - rejected
        - return-contested
        - return-dishonored
        - returned
        - scheduled
        - settled
        - submitted
    UniversalTransferStatusReason:
      title: UniversalTransferStatusReason
      type: string
      description: "Additional context for the transfer's `status`: what a held transfer is waiting on, or why a transfer failed. `other` indicates a reason not covered by the listed values."
      enum:
        - funding_account_unavailable
        - funding_failed
        - limit_exceeded
        - network_send_failed
        - other
        - quote_expired
        - review_required
        - risk_declined
        - risk_review
        - route_approval
        - route_unavailable
        - submit_rejected
    UniversalTransferTransaction:
      title: UniversalTransferTransaction
      allOf:
        - $ref: '#/components/schemas/UniversalTransactionBase'
        - type: object
          required:
            - type
            - status
            - attributes
          properties:
            type:
              type: string
              description: Always `transfer`.
              enum:
                - transfer
            status:
              $ref: '#/components/schemas/UniversalTransferStatus'
              description: |
                Current status. `acknowledged` means the provider confirmed receipt;
                `canceled` means canceled before completion; `clearing` means funds are
                clearing; `failed` means failed during processing; `hold` means funds are
                held by the provider, compliance, or operations; `initiated` means started
                but not yet sent to the provider; `manual-review` means held for human
                review; `pending` means awaiting processing or completion; `pending-return`
                means a return is in progress; `rejected` means rejected before execution;
                `return-contested` means the returning bank contested a dishonored return;
                `return-dishonored` means the originating bank dishonored the return;
                `returned` means returned after processing; `scheduled` means scheduled for
                a future date; `settled` means completed and settled; `submitted` means sent
                to the provider but not yet acknowledged.
            attributes:
              $ref: '#/components/schemas/UniversalTransferAttributes'
              description: Type-specific fields for a transfer.
tags:
  - name: Endpoints
