Skip to main content
POST
/
sdk
/
{environmentId}
/
transactions
/
{transactionId}
/
prepare
Prepare a checkout transaction for signing
curl --request POST \
  --url https://app.dynamicauth.com/api/v0/sdk/{environmentId}/transactions/{transactionId}/prepare \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Dynamic-Checkout-Session-Token: <x-dynamic-checkout-session-token>' \
  --data '
{
  "assertBalanceForGasCost": false,
  "assertBalanceForTransferAmount": false
}
'
{
  "id": "95b11417-f18f-457f-8804-68e361f9164f",
  "checkoutId": "95b11417-f18f-457f-8804-68e361f9164f",
  "amount": "<string>",
  "currency": "An example name",
  "executionState": "initiated",
  "settlementState": "none",
  "riskState": "unknown",
  "quoteVersion": 123,
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "memo": {},
  "userId": "95b11417-f18f-457f-8804-68e361f9164f",
  "destinationAddresses": [
    {
      "address": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
      "chainName": "ETH"
    }
  ],
  "sourceType": "wallet",
  "fromAddress": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
  "fromChainId": "An example name",
  "fromChainName": "ETH",
  "fromToken": "An example name",
  "toAddress": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
  "toChainId": "An example name",
  "toChainName": "ETH",
  "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": {
      "chainName": "ETH",
      "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>"
    }
  },
  "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": {}
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

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

Headers

X-Dynamic-Checkout-Session-Token
string
required

Checkout session token issued at transaction creation. Format: dct_.

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"

transactionId
string
required

UUID of the deposit transaction

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
assertBalanceForGasCost
boolean
default:false

Whether to assert if wallet has enough balance to pay for the gas cost. If true, the request will fail if the wallet does not have enough balance to pay for the gas cost.

assertBalanceForTransferAmount
boolean
default:false

Whether to assert if wallet has enough balance to pay for the transfer amount (not including gas cost). If true, the request will fail if the wallet does not have enough balance to pay for the transfer amount (not including gas cost).

Response

Transaction prepared for signing

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"

checkoutId
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"

amount
string
required

Payment/Deposit amount in the specified currency

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

"An example name"

executionState
enum<string>
required
Available options:
initiated,
source_attached,
quoted,
signing,
broadcasted,
source_confirmed,
cancelled,
expired,
failed
settlementState
enum<string>
required
Available options:
none,
routing,
bridging,
swapping,
settling,
completed,
failed
riskState
enum<string>
required
Available options:
unknown,
pending,
cleared,
blocked,
review
quoteVersion
integer
required

Version number of the quote used for this transaction

createdAt
string<date-time>
required

ISO 8601 timestamp of when the transaction was created

updatedAt
string<date-time>
required

ISO 8601 timestamp of when the transaction was last updated

memo
object

Arbitrary metadata attached to the transaction

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"

destinationAddresses
object[]

List of destination wallet addresses for fund delivery

sourceType
enum<string>
Available options:
wallet,
exchange
fromAddress
string

Valid blockchain wallet address, must be an alphanumeric string (underscores allowed for chains like Midnight)

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)

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
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 transaction 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
completedAt
string<date-time>

ISO 8601 timestamp of when the transaction was completed

failure
object
expiresAt
string<date-time>

ISO 8601 timestamp of when the transaction expires

exchangeSource
object

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