# Top up the credit

> A Stripe payment page for a top-up. The credit goes up when Stripe tells Shako that it is paid.

`POST /v1/tenants/{tenant}/credit/top-up`

```bash curl
curl -X POST "https://api.shako.dev/v1/tenants/acme/credit/top-up" \
  -H "Authorization: Bearer $SHAKO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":10}'
```

```python Python
import os

import requests

response = requests.post(
    "https://api.shako.dev/v1/tenants/acme/credit/top-up",
    headers={"Authorization": f"Bearer {os.environ['SHAKO_API_KEY']}"},
    json={
        "amount": 10,
    },
)
response.raise_for_status()
print(response.json())
```

```javascript JavaScript
const response = await fetch("https://api.shako.dev/v1/tenants/acme/credit/top-up", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.SHAKO_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "amount": 10
  }),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
```

```json 201 (excerpt)
{
  "url": "https://checkout.stripe.com/c/pay/cs_live_...",
  "amount": "10.00"
}
```

Authenticate with `Authorization: Bearer <API key>` on `https://api.shako.dev`. Role: owner.

## Path parameters

**tenant** `string` *required*

The tenant's name, from GET /v1/tenants.

## Request body

**amount** `integer, 5 to 50` *required*

The US dollars to add: 5, 10, 25, 50.

## Response

201 with [the top-up object](https://shako.dev/api/objects/credit-top-up.md).

The errors: https://shako.dev/api/errors.md. All the endpoints of Billing: https://shako.dev/api/billing.md.
