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

# Cancel a flow

> Cancels a flow that is still initiated, meaning no source has been attached yet. Returns 400 if flowId is not a valid UUID and 409 flow_invalid_transition if the flow is in any other state. Requires an environment API token with the flow.write scope.



## OpenAPI

````yaml https://app.dynamic.xyz/api-docs/public-api.yaml post /server/{environmentId}/flow/{flowId}/cancel
openapi: 3.0.1
info:
  title: Dashboard API
  description: Dashboard API documentation
  version: 1.0.0
servers:
  - url: https://app.dynamicauth.com/api/v0
  - url: https://app.dynamic.xyz/api/v0
  - url: http://localhost:3333/api/v0
security: []
tags:
  - name: Analytics
    description: Query usage analytics and event counts for your environment.
  - name: SDK
    description: SDK-facing endpoints consumed by embedded Dynamic clients.
  - name: Server
    description: Server-side SDK endpoints authenticated by environment API tokens.
  - name: Organizations
    description: >-
      Manage organizations — the top-level container for all environments and
      projects.
  - name: Projects
    description: Manage projects that group related environments under an organization.
  - name: Environments
    description: >-
      Manage environments (live and sandbox) where your authentication
      configuration lives.
  - name: Users
    description: List, search, and manage authenticated users within an environment.
  - name: Invites
    description: >-
      Manage invitation links that grant specific external users access to your
      environment.
  - name: Tokens
    description: >-
      Create and manage API tokens used to authenticate requests to the Dynamic
      API.
  - name: Origins
    description: >-
      Configure allowed origins (CORS) for SDK and API access to your
      environment.
  - name: Allowlists
    description: >-
      Manage allowlists to control which wallet addresses or email addresses can
      access your environment.
  - name: Wallets
    description: View and manage wallets linked to users in your environment.
  - name: Members
    description: Manage team members and their roles within an organization.
  - name: Sessions
    description: View and revoke active user sessions within an environment.
  - name: Settings
    description: Read and update environment-level configuration settings.
  - name: Exchanges
    description: >-
      Configure exchange integrations (Coinbase, Binance, etc.) for fiat on-ramp
      within your environment.
  - name: Yield
    description: List yield vaults registered for your environment.
  - name: Providers
    description: >-
      List, enable, disable, and configure authentication providers (OAuth,
      email, wallet, SMS, etc.) for your environment.
  - name: Captcha
    description: >-
      Configure captcha verification (provider, site key, secret key) for your
      environment.
  - name: Gates
    description: >-
      Define access gates that restrict environment entry to users who meet
      specific criteria.
  - name: Chains
    description: >-
      Manage the blockchain networks available for wallet connection in your
      environment.
  - name: Exports
    description: Export user and wallet data from your environment as downloadable files.
  - name: Events
    description: Browse the event log of actions performed within your environment.
  - name: Webhooks
    description: >-
      Create and manage webhooks to receive real-time events (user.created,
      wallet.linked, etc.) at your endpoint.
  - name: Custom Fields
    description: >-
      Define and manage custom metadata fields collected from users at sign-up
      or login.
  - name: MfaSettings
    description: >-
      Configure multi-factor authentication (MFA) policies for your
      organization.
  - name: Mfa
    description: Manage MFA enrollment and verification for individual users.
  - name: CustomHostnames
    description: >-
      Configure custom hostnames for white-labeling the Dynamic authentication
      experience.
  - name: TestAccount
    description: >-
      Manage test accounts used for automated testing and QA within an
      environment.
  - name: NameServices
    description: >-
      Configure name service integrations (ENS, Unstoppable Domains, etc.) for
      human-readable wallet addresses.
  - name: GlobalWallets
    description: >-
      Manage global wallets shared across multiple environments in an
      organization.
  - name: GlobalWalletConnections
    description: Configure which environments can access and use global wallets.
  - name: GlobalWalletAccessControl
    description: Control which users and roles can access and operate global wallets.
  - name: UserApiTokens
    description: >-
      Create and manage user-scoped API tokens for programmatic access on behalf
      of a user.
  - name: Waas
    description: Wallet-as-a-Service endpoints for creating and managing embedded wallets.
  - name: WalletConnect
    description: Configure WalletConnect integration settings for your environment.
  - name: Checkout
    description: >-
      Accept crypto payments and deposits from any wallet. Settle in any token
      you choose.
  - name: Flow
    description: >-
      Accept crypto payments, deposits, and withdrawals. Amount and destination
      are fixed server-side at create; the post-create lifecycle is driven with
      a capability session token.
  - name: FlowAnalytics
    description: >-
      Query aggregated analytics and paginated transaction lists for the Flow
      product.
  - name: Gasless
    description: >-
      Query billing summaries and paginated transaction lists for sponsored
      (gasless) transactions.
  - name: Custom Networks
    description: >-
      Add and manage custom EVM-compatible networks beyond the built-in chain
      list.
  - name: Chainalysis
    description: >-
      Configure Chainalysis integration for blockchain address screening and
      risk assessment.
  - name: Visits
    description: Track and query user visit activity within your environment.
  - name: ExternalJwt
    description: >-
      Configure external JWT providers so existing auth tokens can be used with
      Dynamic.
  - name: SDK Views
    description: >-
      Manage SDK view configurations that customize the appearance of Dynamic
      modals and flows.
  - name: DeeplinkUrls
    description: Configure deep link URLs for mobile app integration with the Dynamic SDK.
  - name: OrganizationSettings
    description: >-
      Read and update organization-level settings such as approval workflow
      configuration.
  - name: AdminActions
    description: >-
      Manage admin action requests that require approval from another
      administrator.
  - name: ClientGrant
    description: |
      OAuth 2.0 Device Authorization Grant flow (RFC 8628) used by first-party
      Dynamic clients (CLI, MCP server, demo apps, IDE plugins) to obtain a
      revocable, 30-day client JWT without ever seeing the user's dashboard
      session token.
  - name: AuthorizedClients
    description: |
      Manage first-party clients (CLI / MCP / demo / IDE plugins) authorized
      to act as a dashboard user. Surfaced under Profile → Authorized Clients.
  - name: Kyb
    description: >-
      Verify a business's identity via AI Prise passthrough and check KYB tier
      status.
  - name: BusinessAccounts
    description: >-
      Administer the business accounts (multi-operator wallet containers) that
      end users create in an environment.
  - name: ScreeningPolicies
    description: >
      Author per-provider address screening policies that map TRM and
      Chainalysis

      signals to block, alert, or allow, plus per-address exceptions. The

      sanctions floor sits underneath every policy and is not configurable.
paths:
  /server/{environmentId}/flow/{flowId}/cancel:
    post:
      tags:
        - Server
      summary: Cancel a flow
      description: >-
        Cancels a flow that is still initiated, meaning no source has been
        attached yet. Returns 400 if flowId is not a valid UUID and 409
        flow_invalid_transition if the flow is in any other state. Requires an
        environment API token with the flow.write scope.
      operationId: cancelFlowServer
      parameters:
        - $ref: '#/components/parameters/environmentId'
        - $ref: '#/components/parameters/flowId'
      responses:
        '200':
          description: Flow cancelled; executionState is cancelled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Flow'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/FlowConflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    environmentId:
      in: path
      name: environmentId
      required: true
      description: ID of the environment
      schema:
        $ref: '#/components/schemas/uuid'
    flowId:
      in: path
      name: flowId
      required: true
      description: UUID of the flow
      schema:
        $ref: '#/components/schemas/uuid'
  schemas:
    Flow:
      description: >-
        A single payment, deposit, or withdraw flow. Collapses the former
        Checkout and CheckoutTransaction into one resource.
      type: object
      required:
        - id
        - mode
        - amount
        - currency
        - executionState
        - settlementState
        - riskState
        - quoteVersion
        - createdAt
        - updatedAt
      properties:
        id:
          $ref: '#/components/schemas/uuid'
        mode:
          $ref: '#/components/schemas/FlowModeEnum'
        amount:
          description: >-
            Amount in the specified currency. Set at create by the API-key
            caller. Immutable for payment and withdraw flows; for deposit flows
            it is a suggested amount the payer can change when quoting.
          type: string
        amountUsd:
          description: >-
            Amount in USD. Equals `amount` when `currency` is USD. For
            token-denominated currencies it is `amount` multiplied by the
            settlement token's USD price, calculated when a quote is generated.
            Absent until then, or if no price is available.
          type: string
        currency:
          $ref: '#/components/schemas/NonEmptyStringWith50MaxLength'
        currencyTokenInfo:
          $ref: '#/components/schemas/FlowTokenInfo'
        memo:
          description: Arbitrary metadata attached to the flow
          type: object
        userId:
          $ref: '#/components/schemas/uuid'
        executionState:
          $ref: '#/components/schemas/FlowExecutionStateEnum'
        settlementState:
          $ref: '#/components/schemas/FlowSettlementStateEnum'
        riskState:
          $ref: '#/components/schemas/FlowRiskStateEnum'
        sourceType:
          $ref: '#/components/schemas/FlowSourceTypeEnum'
        fromAddress:
          $ref: '#/components/schemas/WalletPublicKey'
        fromChainId:
          $ref: '#/components/schemas/NonEmptyStringWith50MaxLength'
        fromChainName:
          $ref: '#/components/schemas/ChainEnum'
        fromToken:
          $ref: '#/components/schemas/NonEmptyStringWith255MaxLength'
        toAddress:
          $ref: '#/components/schemas/WalletPublicKey'
        toChainId:
          $ref: '#/components/schemas/NonEmptyStringWith50MaxLength'
        toChainName:
          $ref: '#/components/schemas/ChainEnum'
        toToken:
          $ref: '#/components/schemas/NonEmptyStringWith255MaxLength'
        quoteVersion:
          description: Version number of the quote used for this flow
          type: integer
        quote:
          $ref: '#/components/schemas/FlowQuote'
        txHash:
          $ref: '#/components/schemas/NonEmptyStringWith4096MaxLength'
        settlementTxHash:
          allOf:
            - $ref: '#/components/schemas/NonEmptyStringWith4096MaxLength'
            - description: Transaction hash on the destination chain
        broadcastedAt:
          description: ISO 8601 timestamp of when the flow was broadcast to the network
          type: string
          format: date-time
        sourceConfirmedAt:
          description: >-
            ISO 8601 timestamp of when the source chain confirmed the
            transaction
          type: string
          format: date-time
        confirmations:
          description: Number of blockchain confirmations received
          type: integer
        settlement:
          $ref: '#/components/schemas/FlowSettlementData'
        completedAt:
          description: ISO 8601 timestamp of when the flow was completed
          type: string
          format: date-time
        failure:
          $ref: '#/components/schemas/FlowFailure'
        expiresAt:
          description: ISO 8601 timestamp of when the flow expires
          type: string
          format: date-time
        createdAt:
          description: ISO 8601 timestamp of when the flow was created
          type: string
          format: date-time
        updatedAt:
          description: ISO 8601 timestamp of when the flow was last updated
          type: string
          format: date-time
        depositAddress:
          $ref: '#/components/schemas/WalletPublicKey'
        exchangeSource:
          $ref: '#/components/schemas/FlowExchangeSource'
        pegStablecoins:
          description: >-
            When true, known stablecoins (USDC, USDT, DAI, etc.) in the
            settlement config are pegged 1:1 to the flow currency, skipping
            market-price lookup. Non-stablecoin settlements still use live
            pricing.
          type: boolean
        disableSwaps:
          description: >-
            When true, the flow will not be quoted through swap providers; the
            payer must supply a token/chain already accepted by the settlement
            config. Defaults to false.
          type: boolean
        uiConfig:
          $ref: '#/components/schemas/FlowUIConfig'
        settlementConfig:
          allOf:
            - $ref: '#/components/schemas/SettlementConfigInput'
            - description: >-
                Settlement configuration (tokens/chains accepted for payment).
                Only returned on the server (API-key) endpoint.
        destinationConfig:
          allOf:
            - $ref: '#/components/schemas/DestinationConfigInput'
            - description: >-
                Destination configuration (where settled funds are sent). Only
                returned on the server (API-key) endpoint.
    uuid:
      type: string
      pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      minLength: 36
      maxLength: 36
      example: 95b11417-f18f-457f-8804-68e361f9164f
    FlowModeEnum:
      description: The lifecycle a flow follows — payment, deposit, or withdraw.
      type: string
      enum:
        - payment
        - deposit
        - withdraw
    NonEmptyStringWith50MaxLength:
      type: string
      pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
      example: An example name
      maxLength: 50
    FlowTokenInfo:
      description: Token metadata returned alongside a flow or flow quote.
      type: object
      required:
        - symbol
        - decimals
      properties:
        symbol:
          description: Token symbol (e.g. USDC, ETH)
          type: string
        decimals:
          description: Number of decimal places for this token
          type: integer
        name:
          description: Human-readable token name (e.g. USD Coin, Ether)
          type: string
        logoURI:
          description: URL to the token logo image
          type: string
    FlowExecutionStateEnum:
      description: Execution axis of a flow's state machine.
      type: string
      enum:
        - initiated
        - source_attached
        - quoted
        - signing
        - broadcasted
        - source_detected
        - source_confirmed
        - cancelled
        - expired
        - failed
    FlowSettlementStateEnum:
      description: Settlement axis of a flow's state machine.
      type: string
      enum:
        - none
        - routing
        - bridging
        - swapping
        - settling
        - completed
        - failed
    FlowRiskStateEnum:
      description: Risk-screening axis of a flow's state machine.
      type: string
      enum:
        - unknown
        - pending
        - cleared
        - blocked
        - review
    FlowSourceTypeEnum:
      description: How a flow is funded — a connected wallet, a CEX, or a deposit address.
      type: string
      enum:
        - wallet
        - exchange
        - deposit_address
    WalletPublicKey:
      type: string
      pattern: ^[A-Za-z0-9_-]{18,100}$
      description: >-
        Valid blockchain wallet address, must be an alphanumeric string
        (underscores allowed for chains like Midnight, hyphens allowed for
        chains using base64url-encoded addresses like TON)
      example: '0xbF394748301603f18d953C90F0b087CBEC0E1834'
      maxLength: 255
    ChainEnum:
      type: string
      enum:
        - ETH
        - EVM
        - FLOW
        - SOL
        - ALGO
        - STARK
        - COSMOS
        - BTC
        - ECLIPSE
        - SUI
        - SPARK
        - TRON
        - APTOS
        - TON
        - STELLAR
        - ALEO
        - TEMPO
        - MIDNIGHT
    NonEmptyStringWith255MaxLength:
      type: string
      pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
      maxLength: 255
      example: An example name
    FlowQuote:
      description: A versioned quote snapshot stored on a flow.
      type: object
      required:
        - version
        - fromAmount
        - toAmount
        - expiresAt
        - createdAt
      properties:
        version:
          description: Monotonically increasing version number for this quote
          type: integer
        fromAmount:
          description: Amount being sent in source-token base units
          type: string
        toAmount:
          description: Amount to be received in destination-token base units
          type: string
        fees:
          $ref: '#/components/schemas/FlowFeeBreakdown'
        estimatedTimeSec:
          description: Estimated time in seconds for the swap to complete
          type: integer
        signingPayload:
          $ref: '#/components/schemas/SwapSigningPayload'
        createdAt:
          description: ISO 8601 timestamp of when the quote was created
          type: string
          format: date-time
        expiresAt:
          description: ISO 8601 timestamp of when the quote expires
          type: string
          format: date-time
        fromChainName:
          $ref: '#/components/schemas/ChainEnum'
        fromChainId:
          $ref: '#/components/schemas/NonEmptyStringWith50MaxLength'
        fromToken:
          $ref: '#/components/schemas/NonEmptyStringWith255MaxLength'
        toChainName:
          $ref: '#/components/schemas/ChainEnum'
        toChainId:
          $ref: '#/components/schemas/NonEmptyStringWith50MaxLength'
        toToken:
          $ref: '#/components/schemas/NonEmptyStringWith255MaxLength'
        fromTokenInfo:
          $ref: '#/components/schemas/FlowTokenInfo'
        toTokenInfo:
          $ref: '#/components/schemas/FlowTokenInfo'
    NonEmptyStringWith4096MaxLength:
      type: string
      maxLength: 4096
      description: A string with a max length of 4096 characters
    FlowSettlementData:
      description: Resolved settlement destination and completion time for a flow.
      type: object
      required:
        - toChainId
        - toToken
        - toAddress
      properties:
        toChainId:
          $ref: '#/components/schemas/NonEmptyStringWith50MaxLength'
        toToken:
          $ref: '#/components/schemas/NonEmptyStringWith255MaxLength'
        toAddress:
          $ref: '#/components/schemas/WalletPublicKey'
        completedAt:
          description: ISO 8601 timestamp of when the settlement was completed
          type: string
          format: date-time
        amount:
          description: >-
            Amount actually delivered to the destination, in the smallest unit
            of toToken. Can differ from the quoted amount when a deposit-address
            flow settles short, or when the payer changed a deposit flow's
            amount on the exchange. Absent when the provider did not report it.
          type: string
        amountUsd:
          description: USD equivalent of the delivered amount
          type: string
        toTokenInfo:
          $ref: '#/components/schemas/FlowTokenInfo'
    FlowFailure:
      description: Structured failure detail recorded on a flow when an operation fails.
      type: object
      required:
        - code
        - message
        - category
        - stage
        - retryable
      properties:
        code:
          $ref: '#/components/schemas/NonEmptyStringWith50MaxLength'
        message:
          description: Human-readable error message describing the failure
          type: string
        category:
          $ref: '#/components/schemas/NonEmptyStringWith50MaxLength'
        stage:
          $ref: '#/components/schemas/NonEmptyStringWith50MaxLength'
        retryable:
          description: Whether the failed operation can be retried
          type: boolean
        details:
          description: Additional structured details about the failure
          type: object
    FlowExchangeSource:
      description: >-
        Exchange source for a flow. Present when sourceType is 'exchange'.
        Contains the exchange reference and provider-specific metadata (e.g.
        buyUrl for Coinbase).
      type: object
      required:
        - exchangeId
        - metadata
      properties:
        exchangeId:
          $ref: '#/components/schemas/uuid'
        metadata:
          type: object
          description: Provider-specific data. Shape varies by exchange.
    FlowUIConfig:
      type: object
      description: >-
        Payer-facing UI config for a flow, set once at creation. Not part of the
        execution/settlement record.
      properties:
        returnUrl:
          description: >-
            Payer app URL to redirect to once the flow reaches a specific state.
            Origin must be a registered CORS origin for the environment.
            Redirected to as `returnUrl?status=success|failure&flowId=...`.
          type: string
        termsOfServicesUrl:
          $ref: '#/components/schemas/OptionalNonEmptyUrlWithLocalhostAndDeepLink'
        merchantName:
          $ref: '#/components/schemas/OptionalNonEmptyStringWith255MaxLength'
        merchantLogoUrl:
          $ref: '#/components/schemas/OptionalNonEmptyImageUrl'
        externalPaymentId:
          $ref: '#/components/schemas/OptionalNonEmptyStringWith255MaxLength'
        enabledPaymentMethods:
          description: >-
            Source types the payer UI should offer. Omit to offer every method.
            Display-only — not enforced when a source is attached. Duplicates
            are ignored.
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/FlowSourceTypeEnum'
    SettlementConfigInput:
      type: object
      required:
        - strategy
        - settlements
      properties:
        strategy:
          $ref: '#/components/schemas/SettlementStrategyEnum'
        settlements:
          description: List of settlement strategy configurations
          type: array
          items:
            $ref: '#/components/schemas/ChainSettlementConfig'
    DestinationConfigInput:
      type: object
      required:
        - destinations
      properties:
        destinations:
          description: List of chain-specific destination wallet configurations
          type: array
          items:
            $ref: '#/components/schemas/ChainDestinationConfig'
    BadRequest:
      type: object
      properties:
        error:
          description: Human-readable error message
          type: string
        code:
          description: >-
            Machine-readable reason for the 400, set only by endpoints that
            distinguish rejections.
          type: string
          example: exchange_currency_unsupported
    Unauthorized:
      type: object
      properties:
        error:
          description: Human-readable error message describing the authentication failure
          type: string
          example: No jwt provided!
    NotFound:
      type: object
      required:
        - error
        - code
      properties:
        error:
          description: Human-readable error message
          type: string
          example: Not Found
        code:
          description: >-
            Machine-readable error code. Flow endpoints use not_found when the
            flow doesn't exist in the environment, and exchange_not_configured
            when the requested exchange isn't set up for the environment.
          type: string
          example: not_found
    FlowConflict:
      type: object
      required:
        - error
        - code
      properties:
        error:
          description: Human-readable error message
          type: string
          example: Flow cannot be cancelled from state 'source_attached'
        code:
          description: >-
            Machine-readable reason for the 409. flow_invalid_transition: the
            action isn't allowed in the flow's current state; retrying won't
            help. flow_concurrent_update: another request changed the flow
            first; re-read the flow and retry. flow_tx_hash_already_recorded:
            the transaction hash is already recorded, possibly on another flow;
            don't retry.
          type: string
          example: flow_invalid_transition
    InternalServerError:
      type: object
      properties:
        error:
          description: Human-readable error message
          type: string
          example: Internal Server Error
    FlowFeeBreakdown:
      description: Fee breakdown for a flow's quote.
      type: object
      properties:
        totalFeeUsd:
          description: Total fees for the flow in USD
          type: string
        gasEstimate:
          $ref: '#/components/schemas/FlowGasEstimate'
    SwapSigningPayload:
      type: object
      required:
        - chainName
        - chainId
      properties:
        chainName:
          $ref: '#/components/schemas/ChainEnum'
        chainId:
          type: string
          description: Source chain identifier
        evmTransaction:
          $ref: '#/components/schemas/SwapEvmTransactionData'
        evmApproval:
          $ref: '#/components/schemas/SwapEvmApprovalData'
        serializedTransaction:
          type: string
          description: Base64-encoded serialized transaction
        psbt:
          type: string
          description: Base64-encoded unsigned PSBT
        tronTransaction:
          $ref: '#/components/schemas/SwapTronTransactionData'
      description: >
        Chain-aware signing payload. Which fields are populated depends on
        chainName: EVM uses evmTransaction + optional evmApproval. SOL and SUI
        use serializedTransaction. BTC uses psbt. TRON uses tronTransaction.
    OptionalNonEmptyUrlWithLocalhostAndDeepLink:
      type: string
      pattern: >-
        ^$|^((https?:\/\/)?([a-z0-9]+([-.]+[a-z0-9]+)*\.[a-z]{2,10}|localhost)(:[0-9]{1,5})?(\/.*)?|([a-zA-Z+-]{2,20}):\/\/(?!.*\*.*\*.*)[-*a-zA-Z0-9.-\/]{0,255}(:[*0-9]{1,5})?((\/|\?).*)?)$
      example: https://website-sample.com
    OptionalNonEmptyStringWith255MaxLength:
      type: string
      pattern: ^$|^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
      example: An example name
      maxLength: 255
    OptionalNonEmptyImageUrl:
      type: string
      pattern: >-
        ^$|^https?:\/\/[a-z0-9]+([-.]+[a-z0-9]+)*\.[a-z]{2,10}([0-9]{1,5})?(\/.*)?$|^data:image\/(png|jpe?g|gif|webp|svg\+xml);base64,[a-zA-Z0-9+\/=\s]+$
      example: https://website-sample.com/logo.png
      maxLength: 8192
    SettlementStrategyEnum:
      type: string
      enum:
        - cheapest
        - fastest
        - preferred_order
    ChainSettlementConfig:
      type: object
      required:
        - chainName
        - tokenAddress
        - chainId
        - symbol
        - tokenDecimals
      properties:
        chainName:
          $ref: '#/components/schemas/ChainEnum'
        tokenAddress:
          $ref: '#/components/schemas/NonEmptyStringWith255MaxLength'
        chainId:
          $ref: '#/components/schemas/NonEmptyStringWith50MaxLength'
        symbol:
          $ref: '#/components/schemas/NonEmptyStringWith50MaxLength'
        tokenDecimals:
          type: integer
          description: The number of decimals for the token
          example: 18
        isNative:
          type: boolean
          description: Whether the token is the native token for the chain
          example: true
          default: false
    ChainDestinationConfig:
      type: object
      required:
        - chainName
        - type
        - identifier
      properties:
        chainName:
          $ref: '#/components/schemas/ChainEnum'
        type:
          $ref: '#/components/schemas/DestinationTypeEnum'
        identifier:
          $ref: '#/components/schemas/NonEmptyStringWith255MaxLength'
    FlowGasEstimate:
      description: Estimated gas cost for executing a flow's source transaction.
      type: object
      properties:
        usdValue:
          type: string
          description: Estimated gas cost in USD
        nativeValue:
          type: string
          description: Estimated gas cost in native-token base units (wei, lamports, etc.)
        nativeSymbol:
          type: string
          description: Symbol of the native token (e.g. "ETH", "SOL")
    SwapEvmTransactionData:
      type: object
      required:
        - to
        - data
        - value
      properties:
        to:
          type: string
          description: Contract address to call
        data:
          type: string
          description: Encoded calldata (hex)
        value:
          type: string
          description: Native asset amount in wei (hex string, "0x0" if token-only)
        gasLimit:
          type: string
          description: Suggested gas limit (hex string)
        gasPrice:
          type: string
          description: Gas price in wei (hex string, legacy transactions)
        maxFeePerGas:
          type: string
          description: Max fee per gas (EIP-1559)
        maxPriorityFeePerGas:
          type: string
          description: Max priority fee per gas (EIP-1559)
        nonce:
          type: integer
          description: Transaction nonce
    SwapEvmApprovalData:
      type: object
      required:
        - tokenAddress
        - spenderAddress
        - amount
      properties:
        tokenAddress:
          type: string
          description: ERC-20 contract to approve
        spenderAddress:
          type: string
          description: Contract that needs the allowance (e.g. LiFi Diamond)
        amount:
          type: string
          description: Amount to approve in token's smallest unit
    SwapTronTransactionData:
      type: object
      required:
        - rawDataHex
        - to
        - value
      properties:
        rawDataHex:
          type: string
          description: >
            Hex-encoded serialized Tron raw_data protobuf (a
            TriggerSmartContract call to the swap router). This is the full
            signable transaction; the Tron signer derives the txID (sha256 of
            raw_data) and signs it.
        to:
          type: string
          description: Router contract address (base58), for display only
        value:
          type: string
          description: Native TRX amount in sun (hex string, "0x0" if token-only)
    DestinationTypeEnum:
      type: string
      enum:
        - address
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BadRequest'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Unauthorized'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFound'
    FlowConflict:
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FlowConflict'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InternalServerError'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.