# Start a send

`POST /api/send/prepare` · Optional key

Delegates the energy for the fee transfer and the first send to the sender, then returns the order.

Energy (and bandwidth if needed) for the fee transfer and the first send is delegated to the sender before this answers, or the order comes back `delegating` (the provider is still working) or `failed`. The sender's wallet then signs the fee transfer to `feeAddress` and the send. [Follow it](https://feebolt.com/developers/send-status/) until it completes.

> This endpoint buys energy before you pay, so it is limited per IP and per sender address, and the sender must hold the amount plus the fee in USDT.

## Request

Base URL: `https://feebolt.com`. Works without a key (per-IP limits). With an API key the limits are per key and higher.

### Body parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `sender` | string | yes | The wallet that holds the USDT. |
| `recipient` | string | yes | Where the USDT goes. |
| `amount` | number | yes | USDT to send. |
| `bundle` | 1 \| 3 \| 5 | no | Sends in the session. Default `1`. |
| `expectedFee` | number | no | The fee you showed (USDT). If the price rose since, you get `409 price_changed` instead of a dearer order. |

## Examples

```bash
# Optional: add -H "Authorization: Bearer $FEEBOLT_API_KEY" for per-key limits
curl -X POST https://feebolt.com/api/send/prepare \
  -H "content-type: application/json" \
  -d '{"sender":"TKHuVq1oKVruCGLvqVexFs6dawKv6fQgFs","recipient":"TJRyWwFs9wTFGZg3JbrVriFbNfCug5tDeC","amount":250,"bundle":1}'
```

```js
const res = await fetch("https://feebolt.com/api/send/prepare", {
  method: "POST",
  headers: {
    // optional: Authorization: `Bearer ${process.env.FEEBOLT_API_KEY}`,
    "content-type": "application/json",
  },
  body: JSON.stringify({
    "sender": "TKHuVq1oKVruCGLvqVexFs6dawKv6fQgFs",
    "recipient": "TJRyWwFs9wTFGZg3JbrVriFbNfCug5tDeC",
    "amount": 250,
    "bundle": 1
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data.message);
```

```python
import requests

r = requests.post(
    "https://feebolt.com/api/send/prepare",
    json={
        "sender": "TKHuVq1oKVruCGLvqVexFs6dawKv6fQgFs",
        "recipient": "TJRyWwFs9wTFGZg3JbrVriFbNfCug5tDeC",
        "amount": 250,
        "bundle": 1
    },
)
r.raise_for_status()
data = r.json()
```

## Response: 201 Created

The send order.

```json
{
  "id": "snd_8h2k4m6p1q3r5t7v9x0z",
  "status": "ready",
  "bundle": 1,
  "sender": "TKHuVq1oKVruCGLvqVexFs6dawKv6fQgFs",
  "recipient": "TJRyWwFs9wTFGZg3JbrVriFbNfCug5tDeC",
  "amount": 250,
  "fee": 1.65,
  "feeAddress": "TSeJkUh4Qv67VNFwY8LaAxERygNdy6NQZK",
  "energy": 128570,
  "expiresAt": 1795895886725,
  "delegation": {
    "state": "done",
    "energyTx": "5b02c0f8e9d1a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8091ae19c",
    "…": "…"
  },
  "feeTx": {
    "state": "none"
  },
  "sends": [],
  "…": "…"
}
```

## Errors

| HTTP | error | When |
| --- | --- | --- |
| 400 | `bad_request` | The body isn't a JSON object, or is over 4 KB. |
| 400 | `bad_sender` | The sender isn't a valid TRON address, or can't send this. |
| 400 | `bad_recipient` | recipient isn't holder or empty, or recipientAddress isn't a TRON address. |
| 400 | `bad_amount` | The amount is missing, too small, or more than the sender holds. |
| 409 | `price_changed` | The send fee rose since your quote (expectedFee). Quote again. |
| 409 | `too_soon` | The sender already has a send open. Finish or wait for it. |
| 403 | `blocked` | This sender can't use the send tool right now (too many unpaid sends). |
| 403 | `sanctioned` | The sender or recipient is on a sanctions or blacklist. |
| 503 | `send_off` | The send tool is paused. |
| 429 | `rate_limited` | Too many calls (per IP, or per key with a key). Wait for Retry-After seconds. |
| 502 / 503 | `upstream` | The TRON node didn't answer (503 when it rate-limited us). Retry in a few seconds. |

## Rate limits

- Without a key: 3 at once, then 1 every 10 minutes, per IP.
- With an API key: 15 at once, then 1 every 2 minutes, per key.

---

HTML: https://feebolt.com/developers/send-prepare/ · OpenAPI: https://feebolt.com/developers/openapi.json · All docs as one Markdown file: https://feebolt.com/developers/full.md
