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

# POST /submit-transaction

> Send a signed Solana transaction that RAVN checks first.

Only for a `TRANSACTION` from [`/execute`](/api-reference/execute) that carries
`submit: { "url": "/api/v1/submit-transaction" }`, which happens only on quotes made with
`broadcastViaRavn: true` (see [`/quote`](/api-reference/quote)). **Don't broadcast that
transaction yourself.** Sign `transaction.serialized` with the user's wallet, without sending it,
and post it here. RAVN checks it still pays Layerswap the way Layerswap matches deposits, then
sends it. Broadcast every transaction without `submit` yourself, as usual.

The check exists because Layerswap matches these payments by instructions that must stay
top-level in the transaction, such as its memo. A smart-contract wallet that wraps them in its own
program sends the same tokens with nothing Layerswap can match, and they sit at Layerswap. Nothing
is sent unless the check passes.

`/execute` simulates this payment when it builds it, so the wallet must already hold the amount
and SOL for fees, or `/execute` returns `502 BUILD_FAILED`. Sign and post promptly: the
transaction's blockhash expires about a minute after `/execute`.

## Request

<ParamField body="quoteToken" type="string" required>The `quoteToken` returned by [`/execute`](/api-reference/execute) with the transaction that carries `submit`, not the one from `/quote`.</ParamField>
<ParamField body="signedTransaction" type="string" required>That response's `transaction.serialized` after the user's wallet signed it, base64. Sign it as returned: a transaction with a different fee payer or blockhash is refused.</ParamField>

No API key required (see [Authentication](/authentication) for the optional higher-limit tiers).

```bash theme={null}
curl -s -X POST https://app.ravn.exchange/api/v1/submit-transaction \
  -H 'content-type: application/json' \
  -d '{ "quoteToken": "<from /execute>", "signedTransaction": "<base64>" }'
```

## Response

<ResponseField name="txHash" type="string">The Solana transaction signature. Poll [`/status`](/api-reference/status) with the `statusRef` from `/execute`.</ResponseField>

```json theme={null}
{ "data": { "txHash": "5igSig..." } }
```

Posting the same `signedTransaction` again is always safe: if it already landed, you get `200`
with its `txHash`, so retrying after a lost response or an error never pays twice.

## Errors

| Code | HTTP | Meaning |
| - | - | - |
| `INVALID_REQUEST` | 400 | Nothing was sent. The transaction isn't signed, isn't the one `/execute` returned with this `quoteToken`, or no longer pays Layerswap the way it matches deposits (a smart-contract wallet moved the payment into its own program: sign with a standard Solana wallet). Also returned when `quoteToken` isn't the one from the `/execute` response that carried `submit` (for example the token from `/quote`): post again with that response's `quoteToken`. Never broadcast a transaction whose `/execute` response carried `submit`. |
| `QUOTE_INVALID` | 400 | The `quoteToken` is malformed or tampered. Nothing was sent. |
| `ORDER_REJECTED` | 422 | Solana's preflight refused the transaction (for example an expired blockhash, or too little SOL), so nothing was sent. Get a fresh transaction from `/execute`, or a fresh quote once it's past `expiresAt`. |
| `BUILD_FAILED` | 502 | Solana couldn't be reached, and the transaction may already have been sent. Retry this call with the same `signedTransaction`: it returns `200` if the transaction landed. Don't sign a new transaction until a retry answers `200` or `ORDER_REJECTED`. `error.details.txHash`, when present, is the signature to look up. |

<Note>
  If the `quoteToken` came from a [sandbox](/sandbox-mode) quote, the checks run as usual but
  nothing is sent: it returns a synthetic `txHash` immediately.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.