Skip to main content
POST
/
sdk
/
{environmentId}
/
flow
/
{flowId}
/
quote
Get a quote for a flow
curl --request POST \
  --url https://app.dynamicauth.com/api/v0/sdk/{environmentId}/flow/{flowId}/quote \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Dynamic-Flow-Session-Token: <x-dynamic-flow-session-token>' \
  --data '
{
  "fromTokenAddress": "An example name",
  "fromChainId": "An example name",
  "slippage": 123
}
'
{
  "id": "95b11417-f18f-457f-8804-68e361f9164f",
  "amount": "<string>",
  "currency": "An example name",
  "settlementConfig": {
    "settlements": [
      {
        "tokenAddress": "An example name",
        "chainId": "An example name",
        "symbol": "An example name",
        "tokenDecimals": 18,
        "isNative": true
      }
    ]
  },
  "quoteVersion": 123,
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "destinationConfig": {
    "destinations": [
      {
        "type": "address",
        "identifier": "An example name"
      }
    ]
  },
  "memo": {},
  "userId": "95b11417-f18f-457f-8804-68e361f9164f",
  "fromAddress": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
  "fromChainId": "An example name",
  "fromToken": "An example name",
  "toAddress": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
  "toChainId": "An example name",
  "toToken": "An example name",
  "quote": {
    "version": 123,
    "fromAmount": "<string>",
    "toAmount": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "expiresAt": "2023-11-07T05:31:56Z",
    "fees": {
      "totalFeeUsd": "<string>",
      "gasEstimate": {
        "usdValue": "<string>",
        "nativeValue": "<string>",
        "nativeSymbol": "<string>"
      }
    },
    "estimatedTimeSec": 123,
    "rawQuote": {},
    "signingPayload": {
      "chainId": "<string>",
      "evmTransaction": {
        "to": "<string>",
        "data": "<string>",
        "value": "<string>",
        "gasLimit": "<string>",
        "gasPrice": "<string>",
        "maxFeePerGas": "<string>",
        "maxPriorityFeePerGas": "<string>",
        "nonce": 123
      },
      "evmApproval": {
        "tokenAddress": "<string>",
        "spenderAddress": "<string>",
        "amount": "<string>"
      },
      "serializedTransaction": "<string>",
      "psbt": "<string>",
      "tronTransaction": {
        "rawDataHex": "<string>",
        "to": "<string>",
        "value": "<string>"
      }
    }
  },
  "txHash": "<string>",
  "broadcastedAt": "2023-11-07T05:31:56Z",
  "sourceConfirmedAt": "2023-11-07T05:31:56Z",
  "confirmations": 123,
  "settlement": {
    "toChainId": "An example name",
    "toToken": "An example name",
    "toAddress": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
    "completedAt": "2023-11-07T05:31:56Z"
  },
  "completedAt": "2023-11-07T05:31:56Z",
  "failure": {
    "code": "An example name",
    "message": "<string>",
    "category": "An example name",
    "stage": "An example name",
    "retryable": true,
    "details": {}
  },
  "expiresAt": "2023-11-07T05:31:56Z",
  "exchangeSource": {
    "exchangeId": "95b11417-f18f-457f-8804-68e361f9164f",
    "metadata": {}
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Dynamic-Flow-Session-Token
string
required

Flow session token issued at source attachment. Format: dft_.

Path Parameters

environmentId
string
required

ID of the environment

Required string length: 36
Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Example:

"95b11417-f18f-457f-8804-68e361f9164f"

flowId
string
required

UUID of the flow

Required string length: 36
Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Example:

"95b11417-f18f-457f-8804-68e361f9164f"

Body

application/json

Request body for fetching a quote on a flow.

fromTokenAddress
string

Optional token address the source funds will originate from for this quote. When omitted, defaults to the canonical native-token sentinel for the previously-attached fromChainName (e.g. the zero address for EVM, So11111111111111111111111111111111111111112 for Solana, 0x2::sui::SUI for Sui, 'bitcoin' for BTC).

Maximum string length: 255
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
Example:

"An example name"

fromChainId
string

Optional chain identifier the source funds will originate from. When provided, overrides the fromChainId recorded at source time. The chain family (fromChainName) and source address (fromAddress) are locked at source time and cannot be changed here.

Maximum string length: 50
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
Example:

"An example name"

slippage
number

Slippage tolerance (e.g. 0.005 for 0.5%)

Response

Quote fetched and stored successfully

A single payment, deposit, or withdraw flow. Collapses the former Checkout and CheckoutTransaction into one resource.

id
string
required
Required string length: 36
Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Example:

"95b11417-f18f-457f-8804-68e361f9164f"

mode
enum<string>
required

The lifecycle a flow follows — payment, deposit, or withdraw.

Available options:
payment,
deposit,
withdraw
amount
string
required

Amount in the specified currency. Set once at create by the API-key caller and immutable thereafter.

currency
string
required
Maximum string length: 50
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
Example:

"An example name"

settlementConfig
object
required
executionState
enum<string>
required

Execution axis of a flow's state machine.

Available options:
initiated,
source_attached,
quoted,
signing,
broadcasted,
source_confirmed,
cancelled,
expired,
failed
settlementState
enum<string>
required

Settlement axis of a flow's state machine.

Available options:
none,
routing,
bridging,
swapping,
settling,
completed,
failed
riskState
enum<string>
required

Risk-screening axis of a flow's state machine.

Available options:
unknown,
pending,
cleared,
blocked,
review
quoteVersion
integer
required

Version number of the quote used for this flow

createdAt
string<date-time>
required

ISO 8601 timestamp of when the flow was created

updatedAt
string<date-time>
required

ISO 8601 timestamp of when the flow was last updated

destinationConfig
object
memo
object

Arbitrary metadata attached to the flow

userId
string
Required string length: 36
Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Example:

"95b11417-f18f-457f-8804-68e361f9164f"

sourceType
enum<string>

How a flow is funded — a connected wallet, a CEX, or a deposit address.

Available options:
wallet,
exchange,
deposit_address
fromAddress
string

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)

Maximum string length: 255
Pattern: ^[A-Za-z0-9_-]{18,100}$
Example:

"0xbF394748301603f18d953C90F0b087CBEC0E1834"

fromChainId
string
Maximum string length: 50
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
Example:

"An example name"

fromChainName
enum<string>
Available options:
ETH,
EVM,
FLOW,
SOL,
ALGO,
STARK,
COSMOS,
BTC,
ECLIPSE,
SUI,
SPARK,
TRON,
APTOS,
TON,
STELLAR,
ALEO,
TEMPO,
MIDNIGHT
fromToken
string
Maximum string length: 50
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
Example:

"An example name"

toAddress
string

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)

Maximum string length: 255
Pattern: ^[A-Za-z0-9_-]{18,100}$
Example:

"0xbF394748301603f18d953C90F0b087CBEC0E1834"

toChainId
string
Maximum string length: 50
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
Example:

"An example name"

toChainName
enum<string>
Available options:
ETH,
EVM,
FLOW,
SOL,
ALGO,
STARK,
COSMOS,
BTC,
ECLIPSE,
SUI,
SPARK,
TRON,
APTOS,
TON,
STELLAR,
ALEO,
TEMPO,
MIDNIGHT
toToken
string
Maximum string length: 50
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
Example:

"An example name"

quote
object

A versioned quote snapshot stored on a flow.

txHash
string

A string with a max length of 4096 characters

Maximum string length: 4096
broadcastedAt
string<date-time>

ISO 8601 timestamp of when the flow was broadcast to the network

sourceConfirmedAt
string<date-time>

ISO 8601 timestamp of when the source chain confirmed the transaction

confirmations
integer

Number of blockchain confirmations received

settlement
object

Resolved settlement destination and completion time for a flow.

completedAt
string<date-time>

ISO 8601 timestamp of when the flow was completed

failure
object

Structured failure detail recorded on a flow when an operation fails.

expiresAt
string<date-time>

ISO 8601 timestamp of when the flow expires

exchangeSource
object

Exchange source for a flow. Present when sourceType is 'exchange'. Contains the exchange reference and provider-specific metadata (e.g. buyUrl for Coinbase).