> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mogalts.win/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /v1/buy

> Purchase accounts

Buy a batch of accounts from a category. Credits are deducted from your balance. Each account is ban-checked before delivery — you are only charged for accounts that pass.

<ParamField header="X-API-Key" type="string" required>
  Your API key
</ParamField>

<ParamField body="category" type="string" required>
  One of: `Hypixel Unbanned`, `Donut Unbanned`, `Hypixel Banned`
</ParamField>

<ParamField body="amount" type="integer" required>
  Number of accounts to buy. Range: 1–50
</ParamField>

## Request

```json theme={null}
{
  "category": "Hypixel Unbanned",
  "amount": 3
}
```

## Response

```json theme={null}
{
  "success": true,
  "data": {
    "formattedAccounts": "[Steve]\n\n==============================\n\n[Alex]",
    "cookies": "=== Steve ===\n<netscape cookie content>\n\n",
    "cookieFiles": {
      "Steve.txt": "# Netscape HTTP Cookie File\n.login.live.com\tTRUE\t/\tTRUE\t1700000000\t...",
      "Alex.txt": "# Netscape HTTP Cookie File\n.login.live.com\tTRUE\t/\tTRUE\t1700000000\t..."
    },
    "finalAmount": 3,
    "finalCost": 30,
    "newBalance": 220
  }
}
```

<Note>
  `finalAmount` may be less than requested if some accounts failed the ban check — you are only charged for what is actually delivered.
</Note>

<Note>
  `cookieFiles` is an object keyed by filename (`username.txt`) containing the full Netscape-format cookie file for each account. Prefer this over `cookies` for per-account access.
</Note>

<Warning>
  This endpoint has the same per-category purchase limits as the Discord bot. If your request exceeds the rolling window limit you will receive a `400` error with a retry time.
</Warning>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://mogalts.win/v1/buy \
    -H "X-API-Key: mog_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{"category":"Hypixel Unbanned","amount":1}'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://mogalts.win/v1/buy",
      headers={"X-API-Key": "mog_your_key_here"},
      json={"category": "Hypixel Unbanned", "amount": 2}
  )

  if response.json()["success"]:
      print(response.json()["data"]["formattedAccounts"])
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch("https://mogalts.win/v1/buy", {
    method: "POST",
    headers: {
      "X-API-Key": "mog_your_key_here",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ category: "Donut Unbanned", amount: 1 })
  });
  const data = await res.json();
  if (data.success) console.log(data.data.formattedAccounts);
  ```
</CodeGroup>
