# Pay invoice with balance

`POST /v1/invoice/@id/credit` · scope `billing:write`

Use the account's credit balance to pay the invoice.

## HTTP request

| Item | Value |
| --- | --- |
| URL | `https://api.tino.vn/v1/invoice/@id/credit` |
| 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 |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Invoice ID |
| `amount` | body | string | no | — |

## Example request

```bash
curl -X POST "https://api.tino.vn/v1/invoice/300001/credit" \
  -H "Authorization: Bearer $TINO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": "short"
}'
```

`$TINO_TOKEN` is a token with the scope `billing:write`. Path parameters in the example are sample values.

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

## Example response

No live sample: the route changes real data or the test account has no data for it. The answer is a JSON object; errors follow the common shape in [Calling the Tino API](/en/docs/api#errors).
