Create Intent request
curl --request POST \
--url https://api.bron.org/workspaces/{workspaceId}/intents \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "kqftx9zd3g6qdp09or",
"fromAssetId": "2",
"intentId": "w2u573pjj5wl975z4a9",
"toAssetId": "5002",
"fromAmount": "120.015",
"fromTokenId": "<string>",
"toAmount": "117500.03",
"toTokenId": "<string>"
}
'import requests
url = "https://api.bron.org/workspaces/{workspaceId}/intents"
payload = {
"accountId": "kqftx9zd3g6qdp09or",
"fromAssetId": "2",
"intentId": "w2u573pjj5wl975z4a9",
"toAssetId": "5002",
"fromAmount": "120.015",
"fromTokenId": "<string>",
"toAmount": "117500.03",
"toTokenId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: 'kqftx9zd3g6qdp09or',
fromAssetId: '2',
intentId: 'w2u573pjj5wl975z4a9',
toAssetId: '5002',
fromAmount: '120.015',
fromTokenId: '<string>',
toAmount: '117500.03',
toTokenId: '<string>'
})
};
fetch('https://api.bron.org/workspaces/{workspaceId}/intents', 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://api.bron.org/workspaces/{workspaceId}/intents",
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([
'accountId' => 'kqftx9zd3g6qdp09or',
'fromAssetId' => '2',
'intentId' => 'w2u573pjj5wl975z4a9',
'toAssetId' => '5002',
'fromAmount' => '120.015',
'fromTokenId' => '<string>',
'toAmount' => '117500.03',
'toTokenId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.bron.org/workspaces/{workspaceId}/intents"
payload := strings.NewReader("{\n \"accountId\": \"kqftx9zd3g6qdp09or\",\n \"fromAssetId\": \"2\",\n \"intentId\": \"w2u573pjj5wl975z4a9\",\n \"toAssetId\": \"5002\",\n \"fromAmount\": \"120.015\",\n \"fromTokenId\": \"<string>\",\n \"toAmount\": \"117500.03\",\n \"toTokenId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.bron.org/workspaces/{workspaceId}/intents")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"kqftx9zd3g6qdp09or\",\n \"fromAssetId\": \"2\",\n \"intentId\": \"w2u573pjj5wl975z4a9\",\n \"toAssetId\": \"5002\",\n \"fromAmount\": \"120.015\",\n \"fromTokenId\": \"<string>\",\n \"toAmount\": \"117500.03\",\n \"toTokenId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bron.org/workspaces/{workspaceId}/intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"kqftx9zd3g6qdp09or\",\n \"fromAssetId\": \"2\",\n \"intentId\": \"w2u573pjj5wl975z4a9\",\n \"toAssetId\": \"5002\",\n \"fromAmount\": \"120.015\",\n \"fromTokenId\": \"<string>\",\n \"toAmount\": \"117500.03\",\n \"toTokenId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "1794678400000",
"fromAssetId": "2",
"intentId": "rzsdziq1iknnzszmmtqz",
"status": "auction-in-progress",
"toAssetId": "5002",
"updatedAt": "1794764800000",
"expiresAt": "1758188560749",
"fromAmount": "100.50",
"fromTokenId": "<string>",
"price": "101.2312",
"toAmount": "0.0025",
"toTokenId": "<string>",
"userSettlementDeadline": "1759188567456"
}{
"error": "bad-request",
"message": "<string>"
}{
"error": "forbidden",
"message": "<string>"
}{
"error": "conflict",
"message": "<string>"
}Create Intent request
Creates an intent for swaps between two assets. More details.
Answers 404 pair-not-available when the pair is not tradable through Intents.
POST
/
workspaces
/
{workspaceId}
/
intents
Create Intent request
curl --request POST \
--url https://api.bron.org/workspaces/{workspaceId}/intents \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "kqftx9zd3g6qdp09or",
"fromAssetId": "2",
"intentId": "w2u573pjj5wl975z4a9",
"toAssetId": "5002",
"fromAmount": "120.015",
"fromTokenId": "<string>",
"toAmount": "117500.03",
"toTokenId": "<string>"
}
'import requests
url = "https://api.bron.org/workspaces/{workspaceId}/intents"
payload = {
"accountId": "kqftx9zd3g6qdp09or",
"fromAssetId": "2",
"intentId": "w2u573pjj5wl975z4a9",
"toAssetId": "5002",
"fromAmount": "120.015",
"fromTokenId": "<string>",
"toAmount": "117500.03",
"toTokenId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: 'kqftx9zd3g6qdp09or',
fromAssetId: '2',
intentId: 'w2u573pjj5wl975z4a9',
toAssetId: '5002',
fromAmount: '120.015',
fromTokenId: '<string>',
toAmount: '117500.03',
toTokenId: '<string>'
})
};
fetch('https://api.bron.org/workspaces/{workspaceId}/intents', 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://api.bron.org/workspaces/{workspaceId}/intents",
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([
'accountId' => 'kqftx9zd3g6qdp09or',
'fromAssetId' => '2',
'intentId' => 'w2u573pjj5wl975z4a9',
'toAssetId' => '5002',
'fromAmount' => '120.015',
'fromTokenId' => '<string>',
'toAmount' => '117500.03',
'toTokenId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.bron.org/workspaces/{workspaceId}/intents"
payload := strings.NewReader("{\n \"accountId\": \"kqftx9zd3g6qdp09or\",\n \"fromAssetId\": \"2\",\n \"intentId\": \"w2u573pjj5wl975z4a9\",\n \"toAssetId\": \"5002\",\n \"fromAmount\": \"120.015\",\n \"fromTokenId\": \"<string>\",\n \"toAmount\": \"117500.03\",\n \"toTokenId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.bron.org/workspaces/{workspaceId}/intents")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"kqftx9zd3g6qdp09or\",\n \"fromAssetId\": \"2\",\n \"intentId\": \"w2u573pjj5wl975z4a9\",\n \"toAssetId\": \"5002\",\n \"fromAmount\": \"120.015\",\n \"fromTokenId\": \"<string>\",\n \"toAmount\": \"117500.03\",\n \"toTokenId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bron.org/workspaces/{workspaceId}/intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"kqftx9zd3g6qdp09or\",\n \"fromAssetId\": \"2\",\n \"intentId\": \"w2u573pjj5wl975z4a9\",\n \"toAssetId\": \"5002\",\n \"fromAmount\": \"120.015\",\n \"fromTokenId\": \"<string>\",\n \"toAmount\": \"117500.03\",\n \"toTokenId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "1794678400000",
"fromAssetId": "2",
"intentId": "rzsdziq1iknnzszmmtqz",
"status": "auction-in-progress",
"toAssetId": "5002",
"updatedAt": "1794764800000",
"expiresAt": "1758188560749",
"fromAmount": "100.50",
"fromTokenId": "<string>",
"price": "101.2312",
"toAmount": "0.0025",
"toTokenId": "<string>",
"userSettlementDeadline": "1759188567456"
}{
"error": "bad-request",
"message": "<string>"
}{
"error": "forbidden",
"message": "<string>"
}{
"error": "conflict",
"message": "<string>"
}Body
application/json
Response
OK
Current status of the intent order. See details
Available options:
not-exist, user-initiated, auction-in-progress, wait-for-user-tx, wait-for-oracle-confirm-user-tx, wait-for-solver-tx, wait-for-oracle-confirm-solver-tx, completed, liquidated, cancelled Example:
"auction-in-progress"
Was this page helpful?