Skip to main content
POST
/
v1
/
buy
/
{trade_id}
/
submit
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"
}

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.

Headers

x-api-key
string
required
A valid PARTNER scope key.

Path Parameters

trade_id
string
required
Trade identifier (prefixed trd_) returned by Quote Buy.

Request Body

signed_tx
string
required
Base64-encoded, fully-signed Solana transaction. Starts from the partially_signed_transaction returned by the quote, with partner and user signatures added.

Response

trade_id
string
Echo of the path parameter.
tx_hash
string
Solana transaction signature (base58). The on-chain identifier of the broadcasted transaction.

Errors

HTTPerrorWhen
400invalid_requestMissing or non-string signed_tx
400broadcast_failedSolana 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"
}