Send Transaction
Most Trustless Work endpoints return an unsigned transaction in XDR format. This endpoint is used to sign such unsigned transactions and send them to the Stellar network.
What it does
This endpoint submits a signed Stellar transaction to the network.
Typical flow:
Call an endpoint that returns
unsignedTransaction.Sign that XDR with the user wallet.
Submit the signed XDR here.
Headers
Content-Type
application/json
x-api-key
<token>
API reference
Forwards the signed transaction to Horizon, then polls the Soroban RPC to enrich the response with on-chain metadata. The response has three mutually-exclusive shapes:
Plain contract call (fund, release, approve, dispute, etc.):
{ txHash, ledger, code: "STELLAR_TX_SUBMITTED", message }.Factory deploy (success):
{ txHash, ledger, contractId, escrow }with the freshly-indexed snapshot — nocode/message.Factory deploy (indexer lagging):
{ txHash, ledger, code: "STELLAR_TX_SUBMITTED_INDEXER_LAGGING", message }— the tx is in the ledger; retrygetTransaction(txHash)shortly to recover the contract address.
Clients should branch on code when present, otherwise on the existence of contractId. The code is stable; the message is free text and subject to change.
Base64-encoded signed Soroban / Stellar XDR. Produced by the client wallet after signing the unsigned XDR returned by an escrow build endpoint.
AAAAAgAAAACkqj...truncated...AAAAAAAAAAAAAAAAAAAATransaction accepted by the network. Inspect code (plain or indexer-lagging) or contractId / escrow (factory deploy success) to know which variant you received.
SHA-256 hash of the submitted transaction (hex).
a3f1c9...0e2Ledger sequence number where the transaction was included.
12345678Address of the freshly-deployed escrow contract. Present only when the transaction was a factory deploy and the network confirmed it before the indexer timeout.
CDHAZ2RTE2MDHYQQ7NATF5IVKIFVGLX6FHJ66OPK6MUXBSTRRXFXJ6QBStable, machine-readable result code. Present on plain submits and on factory deploys whose Soroban return value did not arrive in time. Absent on successful factory deploys (the caller branches on contractId / escrow instead).
STELLAR_TX_SUBMITTEDPossible values: Human-readable companion to code. Free text — subject to change. Clients that need control-flow decisions must read code, not this.
Transaction submitted to the Stellar network.Request body or query params fail schema validation (wrong type, missing required field, unknown property).
Missing, malformed, expired, revoked or invalid API key.
API key is valid but does not have the role required for this operation.
Payload is well-formed but a business rule rejects it (e.g. amount out of range, role not allowed for this user).
Unexpected server-side failure. Use the traceId to look up the incident in server logs or contact support.
POST /stellar/send-transaction HTTP/1.1
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 65
{
"signedXdr": "AAAAAgAAAACkqj...truncated...AAAAAAAAAAAAAAAAAAAA"
}{
"txHash": "a3f1c9...0e2",
"ledger": 12345678,
"contractId": "CDHAZ2RTE2MDHYQQ7NATF5IVKIFVGLX6FHJ66OPK6MUXBSTRRXFXJ6QB",
"escrow": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"code": "STELLAR_TX_SUBMITTED",
"message": "Transaction submitted to the Stellar network."
}Response
This endpoint returns the submitted transaction result from the Stellar network.
Example
Notes
Pass the signed XDR in the
signedXdrfield.Use the same network passphrase used to build the transaction.
This step usually comes right after a create, update, fund, or release call.
Last updated