Transactions
Submit a Transaction Asynchronously
This endpoint submits transactions to the Stellar network asynchronously. It is designed to allow users to submit transactions without blocking them while waiting for a response from Horizon. At the same time, it also provides clear response status codes from stellar-core to help understand the status of the submitted transaction. You can then use Horizon’s GET transaction endpoint to wait for the transaction to be included in a ledger and ingested by Horizon.
POST
/
transactions_async
Submit a Transaction Asynchronously
curl --request POST \
--url https://horizon-testnet.stellar.org/transactions_asyncimport requests
url = "https://horizon-testnet.stellar.org/transactions_async"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://horizon-testnet.stellar.org/transactions_async', 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://horizon-testnet.stellar.org/transactions_async",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://horizon-testnet.stellar.org/transactions_async"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://horizon-testnet.stellar.org/transactions_async")
.asString();require 'uri'
require 'net/http'
url = URI("https://horizon-testnet.stellar.org/transactions_async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"tx_status": "PENDING",
"hash": "6cbb7f714bd08cea7c30cab7818a35c510cbbfc0a6aa06172a1e94146ecf0165"
}
Query Parameters
The base64-encoded XDR of the transaction.
Response
Transaction has been received by core and is in pending status.
Submit a Transaction Asynchronously
curl --request POST \
--url https://horizon-testnet.stellar.org/transactions_asyncimport requests
url = "https://horizon-testnet.stellar.org/transactions_async"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://horizon-testnet.stellar.org/transactions_async', 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://horizon-testnet.stellar.org/transactions_async",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://horizon-testnet.stellar.org/transactions_async"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://horizon-testnet.stellar.org/transactions_async")
.asString();require 'uri'
require 'net/http'
url = URI("https://horizon-testnet.stellar.org/transactions_async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"tx_status": "PENDING",
"hash": "6cbb7f714bd08cea7c30cab7818a35c510cbbfc0a6aa06172a1e94146ecf0165"
}