Overview
Broadcasts the fully-signed buy transaction to Solana and returns the on-chain signature. This is a pure passthrough — GRAIL calls sendRawTransaction and returns the signature. No database row is written here.
The Trade row is written asynchronously by the indexer after the transaction confirms on-chain, typically 10–15 seconds on devnet. Until then, Get Trade returns 404.
You may also broadcast the signed transaction directly to any Solana RPC without calling this endpoint. The indexer picks up the confirmed transaction regardless of who broadcasts it.
GRAIL’s submit endpoint runs Solana’s pre-flight simulation. If you want a transaction to actually land and revert on-chain (e.g., for failure-path testing), broadcast yourself with skipPreflight: true.
A valid PARTNER scope key.
Path Parameters
Trade identifier (prefixed trd_) returned by Quote Buy.
Request Body
Base64-encoded, fully-signed Solana transaction. Starts from the partially_signed_transaction returned by the quote, with partner and user signatures added.
Response
Echo of the path parameter.
Solana transaction signature (base58). The on-chain identifier of the broadcasted transaction.
Errors
| HTTP | error | When |
|---|
| 400 | invalid_request | Missing or non-string signed_tx |
| 400 | broadcast_failed | Solana RPC rejected the transaction. Message carries the reason (expired blockhash, slippage, insufficient funds, missing signature, etc.) |
curl -X POST \
https://grail-stack-dev.onrender.com/v1/buy/trd_4e7a1b8f-9c32-4a91-b3e6-7f12a8d4c5e9/submit \
-H "x-api-key: grail_partner_<hex>" \
-H "Content-Type: application/json" \
-d '{
"signed_tx": "AQAAAAABAAEC...<base64>..."
}'
{
"trade_id": "trd_4e7a1b8f-9c32-4a91-b3e6-7f12a8d4c5e9",
"tx_hash": "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp...base58"
}