# Cancel a top-up

Cancels a top-up.

```http
POST https://api.pozy.ai/v1/balance/top-ups/{topupId}/cancel
```

- Area: Creators / Treasury
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `topupId` (string, required)

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/balance/top-ups/661baaf62e351f4bf7700103/cancel" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/balance/top-ups/661baaf62e351f4bf7700103/cancel", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/balance/top-ups/661baaf62e351f4bf7700103/cancel",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `id`, string
- `method`, string: One of `card`, `bank_transfer`
- `purpose`, string: One of `balance`, `payout_batch`
- `payoutBatch`, object: Can be null
  - `id`, string
  - `campaignId`, string: Can be null
- `feeCoveredByPozy`, boolean
- `amountCents`, integer
- `stripeFeeCents`, integer: Can be null
- `netCents`, integer: Can be null
- `status`, string: One of `pending`, `succeeded`, `failed`, `expired`
- `createdAt`, string (date-time)
- `succeededAt`, string (date-time): Can be null

```json
{
  "id": "6bfebd43ddc270f6d2c56fc5",
  "method": "card",
  "purpose": "balance",
  "payoutBatch": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "campaignId": "65a3737dd8b11ea61f199e6e"
  },
  "feeCoveredByPozy": true,
  "amountCents": 1,
  "stripeFeeCents": 1,
  "netCents": 1,
  "status": "pending",
  "createdAt": "2026-10-02T09:00:00.000Z",
  "succeededAt": "2026-10-02T09:00:00.000Z"
}
```
