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

# POST /route

> Generate the transaction payload for signing. Creates a Trustware intent record that can be tracked through to completion.

`POST https://api.trustware.io/api/v1/routes/route`

Builds the full transaction payload for signing and broadcasting. Call this after the user confirms the quote. Trustware creates an intent record internally so the transaction can be tracked from receipt submission through final settlement.

Pass a `metadata` object with any fields you need echoed back in all subsequent status responses — user ID, withdrawal ID, fiat destination, or any other reference data.

## Request

```json theme={null}
{
  "fromChain": "43114",
  "toChain": "137",
  "fromToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
  "toToken": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
  "fromAmount": "215124226346059100",
  "fromAmountUSD": "2",
  "fromAddress": "0xeb212fe20f26243ec4d4df2dd49c8aa9fa75a201",
  "toAddress": "0xeb212fe20f26243ec4d4df2dd49c8aa9fa75a201",
  "slippage": 1,
  "slippageBps": 100,
  "metadata": {
    "userId": "usr_abc123",
    "withdrawalId": "wdl_xyz789"
  }
}
```

| Field           | Required | Description                                                                          |
| --------------- | -------- | ------------------------------------------------------------------------------------ |
| `fromChain`     | Yes      | Source chain ID as a string.                                                         |
| `toChain`       | Yes      | Destination chain ID as a string. Use `"stellar"` for Stellar.                       |
| `fromToken`     | Yes      | Source token contract address. Use `"0xeeee...eeee"` for the native token.           |
| `toToken`       | Yes      | Destination token contract address.                                                  |
| `fromAmount`    | Yes      | Amount in the smallest unit of the source token.                                     |
| `fromAmountUSD` | No       | USD equivalent of `fromAmount`. Used for display and analytics.                      |
| `fromAddress`   | Yes      | Sender wallet address.                                                               |
| `toAddress`     | Yes      | Recipient wallet address.                                                            |
| `slippage`      | No       | Slippage tolerance as a percentage. Defaults to `1`.                                 |
| `slippageBps`   | No       | Slippage in basis points. Equivalent to `slippage * 100`.                            |
| `metadata`      | No       | Arbitrary key-value object echoed in all status responses. Use for user attribution. |

## Response

```json theme={null}
{
  "data": {
    "intentId": "32c423a8-0531-453e-80b6-c318625cba4d",
    "route": {
      "estimate": {
        "fromAmount": "215124226346059100",
        "toAmount": "1994795",
        "toAmountMin": "1974049",
        "toAmountUsd": "1.99",
        "totalFeesUsd": "0.050017",
        "fees": [...]
      },
      "execution": {
        "transaction": {
          "to": "0xce16F69375520ab01377ce7B88f5BA8C48F8D666",
          "data": "0x84…ed56",
          "value": "219426580165239030",
          "gasLimit": "682400",
          "gasPrice": "12900585",
          "maxFeePerGas": "26170938",
          "maxPriorityFeePerGas": "1000",
          "type": "ON_CHAIN_EXECUTION"
        }
      },
      "provider": "squid",
      "requestId": "b17a041c3f5633e3d46e9eb44041ed56",
      "reliabilityScore": 1
    }
  }
}
```

| Field                               | Description                                                                                                                                               |
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `intentId`                          | Unique identifier for this intent. Pass this to `/receipt` and `/status`.                                                                                 |
| `route.estimate`                    | Fee and amount estimates (same structure as the `/quote` response).                                                                                       |
| `route.execution.transaction`       | The transaction object to sign and broadcast. Pass this to your signing infrastructure.                                                                   |
| `route.execution.transaction.to`    | Spender for this route — the provider contract (Squid, LiFi, etc.) the transaction is sent to. Changes when the selected provider changes between quotes. |
| `route.execution.transaction.data`  | Encoded calldata for the route transaction.                                                                                                               |
| `route.execution.transaction.value` | Native token value to send with the transaction (in wei).                                                                                                 |
| `route.provider`                    | The bridge/swap provider selected for this route (e.g. `"squid"`, `"lifi"`).                                                                              |
| `route.requestId`                   | Provider-level request ID for debugging.                                                                                                                  |
| `route.reliabilityScore`            | Provider reliability score for this route (0–1).                                                                                                          |

## Token approvals

If the source token is an ERC-20, the user must approve the route's spender before broadcasting. The spender is `route.execution.transaction.to` — a provider contract (Squid, LiFi, etc.), not a Trustware contract.

Re-quoting can change the selected provider, which changes the spender. In that case the user will need a fresh approval. Check current allowance against the latest `to` address with [`GET /allowance`](/api-reference/allowance) before broadcasting.
