Create a flow (payment, deposit, or withdraw) for the environment.
curl --request POST \
--url https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "<string>",
"currency": "An example name",
"settlementConfig": {
"settlements": [
{
"tokenAddress": "An example name",
"chainId": "An example name",
"symbol": "An example name",
"tokenDecimals": 18,
"isNative": true
}
]
},
"destinationConfig": {
"destinations": [
{
"type": "address",
"identifier": "An example name"
}
]
},
"memo": {},
"expiresIn": 123,
"pegStablecoins": true
}
'import requests
url = "https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode}"
payload = {
"amount": "<string>",
"currency": "An example name",
"settlementConfig": { "settlements": [
{
"tokenAddress": "An example name",
"chainId": "An example name",
"symbol": "An example name",
"tokenDecimals": 18,
"isNative": True
}
] },
"destinationConfig": { "destinations": [
{
"type": "address",
"identifier": "An example name"
}
] },
"memo": {},
"expiresIn": 123,
"pegStablecoins": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '<string>',
currency: 'An example name',
settlementConfig: {
settlements: [
{
tokenAddress: 'An example name',
chainId: 'An example name',
symbol: 'An example name',
tokenDecimals: 18,
isNative: true
}
]
},
destinationConfig: {destinations: [{type: 'address', identifier: 'An example name'}]},
memo: {},
expiresIn: 123,
pegStablecoins: true
})
};
fetch('https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => '<string>',
'currency' => 'An example name',
'settlementConfig' => [
'settlements' => [
[
'tokenAddress' => 'An example name',
'chainId' => 'An example name',
'symbol' => 'An example name',
'tokenDecimals' => 18,
'isNative' => true
]
]
],
'destinationConfig' => [
'destinations' => [
[
'type' => 'address',
'identifier' => 'An example name'
]
]
],
'memo' => [
],
'expiresIn' => 123,
'pegStablecoins' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode}"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"currency\": \"An example name\",\n \"settlementConfig\": {\n \"settlements\": [\n {\n \"tokenAddress\": \"An example name\",\n \"chainId\": \"An example name\",\n \"symbol\": \"An example name\",\n \"tokenDecimals\": 18,\n \"isNative\": true\n }\n ]\n },\n \"destinationConfig\": {\n \"destinations\": [\n {\n \"type\": \"address\",\n \"identifier\": \"An example name\"\n }\n ]\n },\n \"memo\": {},\n \"expiresIn\": 123,\n \"pegStablecoins\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"currency\": \"An example name\",\n \"settlementConfig\": {\n \"settlements\": [\n {\n \"tokenAddress\": \"An example name\",\n \"chainId\": \"An example name\",\n \"symbol\": \"An example name\",\n \"tokenDecimals\": 18,\n \"isNative\": true\n }\n ]\n },\n \"destinationConfig\": {\n \"destinations\": [\n {\n \"type\": \"address\",\n \"identifier\": \"An example name\"\n }\n ]\n },\n \"memo\": {},\n \"expiresIn\": 123,\n \"pegStablecoins\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"<string>\",\n \"currency\": \"An example name\",\n \"settlementConfig\": {\n \"settlements\": [\n {\n \"tokenAddress\": \"An example name\",\n \"chainId\": \"An example name\",\n \"symbol\": \"An example name\",\n \"tokenDecimals\": 18,\n \"isNative\": true\n }\n ]\n },\n \"destinationConfig\": {\n \"destinations\": [\n {\n \"type\": \"address\",\n \"identifier\": \"An example name\"\n }\n ]\n },\n \"memo\": {},\n \"expiresIn\": 123,\n \"pegStablecoins\": true\n}"
response = http.request(request)
puts response.read_body{
"flow": {
"id": "95b11417-f18f-457f-8804-68e361f9164f",
"amount": "<string>",
"currency": "An example name",
"quoteVersion": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"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,
"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",
"depositAddress": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
"exchangeSource": {
"exchangeId": "95b11417-f18f-457f-8804-68e361f9164f",
"metadata": {}
},
"pegStablecoins": true,
"settlementConfig": {
"settlements": [
{
"tokenAddress": "An example name",
"chainId": "An example name",
"symbol": "An example name",
"tokenDecimals": 18,
"isNative": true
}
]
},
"destinationConfig": {
"destinations": [
{
"type": "address",
"identifier": "An example name"
}
]
}
}
}{
"error": "<string>"
}{
"error": "No jwt provided!"
}{
"error": "Internal Server Error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the environment
36^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"95b11417-f18f-457f-8804-68e361f9164f"
The flow mode — determines which lifecycle the flow follows. The lifecycle a flow follows — payment, deposit, or withdraw.
payment, deposit, withdraw Body
Create-time payload for a flow. amount, currency, settlementConfig and destinationConfig are written once here (by a trusted API-key caller) and are accepted by no later endpoint. mode is supplied in the URL path.
Amount in the specified currency
50^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$"An example name"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Arbitrary metadata attached to the flow
Fee collection configuration specifying recipients and their shares.
Show child attributes
Show child attributes
Seconds until the flow expires (default 3600, clamped server-side)
When true, known stablecoins (USDC, USDT, DAI, etc.) in the settlement config are pegged 1:1 to the flow currency at quote time, skipping market-price lookup. Defaults to false.
Response
Flow created
Response returned when a flow is created.
A single payment, deposit, or withdraw flow. Collapses the former Checkout and CheckoutTransaction into one resource.
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "<string>",
"currency": "An example name",
"settlementConfig": {
"settlements": [
{
"tokenAddress": "An example name",
"chainId": "An example name",
"symbol": "An example name",
"tokenDecimals": 18,
"isNative": true
}
]
},
"destinationConfig": {
"destinations": [
{
"type": "address",
"identifier": "An example name"
}
]
},
"memo": {},
"expiresIn": 123,
"pegStablecoins": true
}
'import requests
url = "https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode}"
payload = {
"amount": "<string>",
"currency": "An example name",
"settlementConfig": { "settlements": [
{
"tokenAddress": "An example name",
"chainId": "An example name",
"symbol": "An example name",
"tokenDecimals": 18,
"isNative": True
}
] },
"destinationConfig": { "destinations": [
{
"type": "address",
"identifier": "An example name"
}
] },
"memo": {},
"expiresIn": 123,
"pegStablecoins": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '<string>',
currency: 'An example name',
settlementConfig: {
settlements: [
{
tokenAddress: 'An example name',
chainId: 'An example name',
symbol: 'An example name',
tokenDecimals: 18,
isNative: true
}
]
},
destinationConfig: {destinations: [{type: 'address', identifier: 'An example name'}]},
memo: {},
expiresIn: 123,
pegStablecoins: true
})
};
fetch('https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => '<string>',
'currency' => 'An example name',
'settlementConfig' => [
'settlements' => [
[
'tokenAddress' => 'An example name',
'chainId' => 'An example name',
'symbol' => 'An example name',
'tokenDecimals' => 18,
'isNative' => true
]
]
],
'destinationConfig' => [
'destinations' => [
[
'type' => 'address',
'identifier' => 'An example name'
]
]
],
'memo' => [
],
'expiresIn' => 123,
'pegStablecoins' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode}"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"currency\": \"An example name\",\n \"settlementConfig\": {\n \"settlements\": [\n {\n \"tokenAddress\": \"An example name\",\n \"chainId\": \"An example name\",\n \"symbol\": \"An example name\",\n \"tokenDecimals\": 18,\n \"isNative\": true\n }\n ]\n },\n \"destinationConfig\": {\n \"destinations\": [\n {\n \"type\": \"address\",\n \"identifier\": \"An example name\"\n }\n ]\n },\n \"memo\": {},\n \"expiresIn\": 123,\n \"pegStablecoins\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"currency\": \"An example name\",\n \"settlementConfig\": {\n \"settlements\": [\n {\n \"tokenAddress\": \"An example name\",\n \"chainId\": \"An example name\",\n \"symbol\": \"An example name\",\n \"tokenDecimals\": 18,\n \"isNative\": true\n }\n ]\n },\n \"destinationConfig\": {\n \"destinations\": [\n {\n \"type\": \"address\",\n \"identifier\": \"An example name\"\n }\n ]\n },\n \"memo\": {},\n \"expiresIn\": 123,\n \"pegStablecoins\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dynamicauth.com/api/v0/server/{environmentId}/flow/{mode}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"<string>\",\n \"currency\": \"An example name\",\n \"settlementConfig\": {\n \"settlements\": [\n {\n \"tokenAddress\": \"An example name\",\n \"chainId\": \"An example name\",\n \"symbol\": \"An example name\",\n \"tokenDecimals\": 18,\n \"isNative\": true\n }\n ]\n },\n \"destinationConfig\": {\n \"destinations\": [\n {\n \"type\": \"address\",\n \"identifier\": \"An example name\"\n }\n ]\n },\n \"memo\": {},\n \"expiresIn\": 123,\n \"pegStablecoins\": true\n}"
response = http.request(request)
puts response.read_body{
"flow": {
"id": "95b11417-f18f-457f-8804-68e361f9164f",
"amount": "<string>",
"currency": "An example name",
"quoteVersion": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"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,
"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",
"depositAddress": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
"exchangeSource": {
"exchangeId": "95b11417-f18f-457f-8804-68e361f9164f",
"metadata": {}
},
"pegStablecoins": true,
"settlementConfig": {
"settlements": [
{
"tokenAddress": "An example name",
"chainId": "An example name",
"symbol": "An example name",
"tokenDecimals": 18,
"isNative": true
}
]
},
"destinationConfig": {
"destinations": [
{
"type": "address",
"identifier": "An example name"
}
]
}
}
}{
"error": "<string>"
}{
"error": "No jwt provided!"
}{
"error": "Internal Server Error"
}