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

# Handles `POST /v1/transactions`.

> # Errors

Returns `401` without usable credentials, `400` without an idempotency
key, `422` when the event fails the canonical contract, and `500` when a
store fails. A repeated tenant and idempotency key returns `200` with the
original record instead of creating a second transaction.



## OpenAPI

````yaml /openapi.json post /v1/transactions
openapi: 3.1.0
info:
  title: Esectra API
  description: >-
    Transaction screening, identity verification, and wallet risk.


    Every create route accepts `Idempotency-Key`; replaying one returns the
    original record with `200` where the first call returned `201`. `POST
    /v1/transactions` requires the header, because a duplicated transaction is a
    duplicated financial record.
  license:
    name: proprietary
    identifier: proprietary
  version: 0.1.0
servers:
  - url: https://qa.esectra.com
    description: Esectra QA Documentation
security: []
paths:
  /v1/transactions:
    post:
      tags:
        - Transactions
      summary: Handles `POST /v1/transactions`.
      description: >-
        # Errors


        Returns `401` without usable credentials, `400` without an idempotency

        key, `422` when the event fails the canonical contract, and `500` when a

        store fails. A repeated tenant and idempotency key returns `200` with
        the

        original record instead of creating a second transaction.
      operationId: create_transaction_handler
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionRequestBody'
        required: true
      responses:
        '200':
          description: A replayed Idempotency-Key; the original record
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionResponseBody'
        '201':
          description: Screened and decided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionResponseBody'
        '400':
          description: Idempotency-Key is required on this route
        '401':
          description: No usable credentials
        '422':
          description: The transaction is not well formed
        '503':
          description: A backing store could not be reached
      security:
        - api_key: []
        - session_cookie: []
components:
  schemas:
    TransactionRequestBody:
      type: object
      description: Transaction ingestion request body.
      required:
        - subject_id
        - network
        - asset
        - direction
        - from_addresses
        - to_addresses
        - amount
        - occurred_at
        - source
      properties:
        amount:
          type: string
          description: Decimal amount at the asset's scale.
        asset:
          $ref: '#/components/schemas/AssetBody'
          description: Asset transferred.
        customer_wallet:
          type:
            - string
            - 'null'
          description: The customer's own wallet.
        destination_wallet:
          type:
            - string
            - 'null'
          description: Wallet the value went to.
        direction:
          $ref: '#/components/schemas/TransactionDirection'
          description: Direction relative to the customer.
        fiat_value:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/FiatValueBody'
              description: Fiat-equivalent value.
        from_addresses:
          type: array
          items:
            type: string
          description: Sending addresses.
        metadata:
          type: object
          description: Integration metadata, kept out of decision logic.
          additionalProperties:
            type: string
          propertyNames:
            type: string
        network:
          $ref: '#/components/schemas/BlockchainNetwork'
          description: Network the transfer settled on.
        occurred_at:
          type: string
          description: RFC 3339 time the transfer occurred.
        originating_wallet:
          type:
            - string
            - 'null'
          description: Wallet the value came from.
        source:
          $ref: '#/components/schemas/TransactionSourceBody'
          description: Submitting system and reference.
        subject_id:
          type: string
          description: Tenant's customer the transaction belongs to.
        to_addresses:
          type: array
          items:
            type: string
          description: Receiving addresses.
        transaction_hash:
          type:
            - string
            - 'null'
          description: On-chain transaction hash.
    TransactionResponseBody:
      type: object
      description: Transaction record response body.
      required:
        - transaction_id
        - decision_id
        - decision
        - risk_level
        - review_status
        - reasons
        - evidence
        - received_at
      properties:
        case_id:
          type:
            - string
            - 'null'
          description: Review case opened for the decision, when one was needed.
        decision:
          $ref: '#/components/schemas/Decision'
          description: Decision outcome. Sentinel recommends; it never enforces.
        decision_id:
          type: string
          description: Decision record identifier.
        evidence:
          type: array
          items:
            $ref: '#/components/schemas/EvidenceRef'
          description: References to retained evidence.
        reasons:
          type: array
          items:
            $ref: '#/components/schemas/DecisionReason'
          description: Explanation reasons.
        received_at:
          type: string
          description: RFC 3339 time the event was accepted.
        review_status:
          $ref: '#/components/schemas/ReviewStatus'
          description: Review lifecycle state.
        risk_level:
          $ref: '#/components/schemas/RiskLevel'
          description: Explainable risk level.
        transaction_id:
          type: string
          description: Gorgon's transaction identifier.
    AssetBody:
      type: object
      description: Asset the transfer moved.
      required:
        - symbol
        - decimals
      properties:
        contract_address:
          type:
            - string
            - 'null'
          description: Token contract address, absent for native coins.
        decimals:
          type: integer
          format: int32
          description: Decimal places the asset is divisible to.
          minimum: 0
        symbol:
          type: string
          description: Ticker symbol.
    TransactionDirection:
      type: string
      description: Which way value moved relative to the customer.
      enum:
        - DEPOSIT
        - WITHDRAWAL
    FiatValueBody:
      type: object
      description: Fiat-equivalent value, when the integration has a quote.
      required:
        - currency
        - amount
      properties:
        amount:
          type: string
          description: Decimal amount, for example `"3200.00"`.
        currency:
          type: string
          description: ISO-4217 currency code.
        decimals:
          type:
            - integer
            - 'null'
          format: int32
          description: Minor-unit scale, defaulting to 2.
          minimum: 0
    BlockchainNetwork:
      oneOf:
        - type: string
          description: Bitcoin.
          enum:
            - BITCOIN
        - type: string
          description: Ethereum mainnet.
          enum:
            - ETHEREUM
        - type: string
          description: Polygon.
          enum:
            - POLYGON
        - type: string
          description: Arbitrum.
          enum:
            - ARBITRUM
        - type: string
          description: Optimism.
          enum:
            - OPTIMISM
        - type: string
          description: Base.
          enum:
            - BASE
        - type: string
          description: BNB Smart Chain.
          enum:
            - BNB_SMART_CHAIN
        - type: string
          description: Avalanche C-Chain.
          enum:
            - AVALANCHE
        - type: string
          description: Tron.
          enum:
            - TRON
        - type: string
          description: Solana.
          enum:
            - SOLANA
        - type: string
          description: Litecoin.
          enum:
            - LITECOIN
        - type: object
          description: A network Sentinel does not name explicitly yet.
          required:
            - OTHER
          properties:
            OTHER:
              type: string
              description: A network Sentinel does not name explicitly yet.
      description: >-
        A blockchain network. `Other` keeps unlisted chains expressible without
        a

        code change, since networks are added faster than releases ship.
    TransactionSourceBody:
      type: object
      description: Submitting system and its own reference.
      required:
        - system
      properties:
        reference:
          type:
            - string
            - 'null'
          description: The submitting system's identifier for this event.
        system:
          type: string
          description: Submitting system.
    Decision:
      type: string
      description: Decision emitted by an automated or human-assisted workflow.
      enum:
        - ALLOW
        - WARN
        - BLOCK
        - HOLD
        - REVIEW_REQUIRED
        - FLAG
        - BLOCK_RECOMMENDED
        - SUSPEND
        - END_STREAM
    EvidenceRef:
      type: object
      description: >-
        Reference to retained evidence without embedding raw evidence in
        decisions.
      required:
        - id
        - kind
        - location
        - retention_policy
      properties:
        id:
          type: string
          description: Internal evidence identifier.
        kind:
          $ref: '#/components/schemas/EvidenceKind'
          description: Evidence type.
        location:
          type: string
          description: Storage URI or provider-specific object key.
        retention_policy:
          type: string
          description: Retention policy identifier applied to this evidence.
    DecisionReason:
      type: object
      description: Human-readable reason with a stable machine code.
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable reason code.
        message:
          type: string
          description: Explainable user/operator-facing message.
    ReviewStatus:
      type: string
      description: Human review lifecycle for a decision.
      enum:
        - PENDING
        - APPROVED
        - OVERTURNED
        - NOT_REQUIRED
    RiskLevel:
      type: string
      description: Explainable risk level.
      enum:
        - LOW
        - MEDIUM
        - HIGH
        - CRITICAL
    EvidenceKind:
      type: string
      description: Kind of evidence captured for a decision or case.
      enum:
        - IMAGE
        - VIDEO
        - TEXT
        - DOCUMENT
        - METADATA
  securitySchemes:
    api_key:
      type: http
      scheme: bearer
      description: >-
        A tenant API key. Acts for exactly one tenant and cannot conclude a
        case, because a conclusion records a person.
    session_cookie:
      type: apiKey
      in: cookie
      name: esectra_session
      description: >-
        A signed-in reviewer's session. httpOnly and SameSite=Lax; set by `POST
        /v1/control/sessions` and only usable once the second factor is met.

````