> ## Documentation Index
> Fetch the complete documentation index at: https://docs.grail.oro.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit Buy

> Broadcasts the fully-signed buy transaction to Solana. Pure passthrough — no database write.

## 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](/api-reference/trades/get-trade) returns `404`.

<Tip>
  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.
</Tip>

<Note>
  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`.
</Note>

## Headers

<ParamField header="x-api-key" type="string" required>
  A valid `PARTNER` scope key.
</ParamField>

## Path Parameters

<ParamField path="trade_id" type="string" required>
  Trade identifier (prefixed `trd_`) returned by [Quote Buy](/api-reference/trades/quote-buy).
</ParamField>

## Request Body

<ParamField body="signed_tx" type="string" required>
  Base64-encoded, fully-signed Solana transaction. Starts from the `partially_signed_transaction` returned by the quote, with partner and user signatures added.
</ParamField>

## Response

<ResponseField name="trade_id" type="string">
  Echo of the path parameter.
</ResponseField>

<ResponseField name="tx_hash" type="string">
  Solana transaction signature (base58). The on-chain identifier of the broadcasted transaction.
</ResponseField>

## 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.) |

<RequestExample>
  ```bash cURL theme={null}
  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>..."
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "trade_id": "trd_4e7a1b8f-9c32-4a91-b3e6-7f12a8d4c5e9",
    "tx_hash": "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp...base58"
  }
  ```
</ResponseExample>
