# Top up

`POST /v1/addfunds` · scope `billing:write`

Create a top-up invoice for the account; take `gateway` from `GET /v1/addfunds`.

## HTTP request

| Item | Value |
| --- | --- |
| URL | `https://api.tino.vn/v1/addfunds` |
| Method | `POST` |
| Scope | `billing:write` |
| Header | `Authorization: Bearer <token>` |
| Content-Type | `application/json` |
| Tokens that can call it | app tokens (`tinoat_`), personal API tokens (`tinopat_`) |

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `amount` | body | number | no | Amount to add to account |
| `gateway` | body | number | no | Payment gateway ID, use `GET /addfunds` to list available gateways |

## Example request

```bash
curl -X POST "https://api.tino.vn/v1/addfunds" \
  -H "Authorization: Bearer $TINO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": "100.00",
  "gateway": "<gateway>"
}'
```

`$TINO_TOKEN` is a token with the scope `billing:write`.

SDK ([SDK & examples](/en/docs/sdk)): Python `client.billing.add_funds_legacy(amount=...)`, Node.js `await client.billing.addFundsLegacy({ amount: ... });`, PHP `$client->billing->addFundsLegacy(['amount' => ...]);`.

## Example response

```json
{
 "success": true,
 "invoice_id": 1201937
}
```

Live sample from a test account with personal data masked; long arrays and strings are trimmed (`… N more item(s)`, `… N more line(s)`).
