POST /api/v1/buy
POST https://su-persim.uz/api/v1/buy
Purchases an account from the store. The price is deducted from your wallet balance and an account is reserved for you.
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
country_id |
integer | yes | The country id from GET /stock. |
account_type |
string | yes | Either "ready" (ready-to-use logged-in account) or "session" (session file you download and log in yourself). |
Idempotency
Section titled “Idempotency”To make purchases safe against retries, pass an Idempotency-Key header. If a request with the same key (for the same user) has already succeeded, the original order is returned and your balance is not charged again.
Purchase a ready account
Section titled “Purchase a ready account”import requests
resp = requests.post( "https://su-persim.uz/api/v1/buy", headers={ "X-API-Key": "supersim_YOUR_API_KEY", "Idempotency-Key": "order-abc-123", }, json={"country_id": 1, "account_type": "ready"},)data = resp.json()print(data["order_id"])print(data["phone_number"])print(data["password_2fa"])<?php
$ch = curl_init("https://su-persim.uz/api/v1/buy");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [ "X-API-Key: supersim_YOUR_API_KEY", "Content-Type: application/json", "Idempotency-Key: order-abc-123",]);curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ "country_id" => 1, "account_type" => "ready",]));$data = json_decode(curl_exec($ch), true);curl_close($ch);
echo $data["order_id"] . PHP_EOL;echo $data["phone_number"] . PHP_EOL;echo $data["password_2fa"] . PHP_EOL;const res = await fetch("https://su-persim.uz/api/v1/buy", {method: "POST",headers: { "Content-Type": "application/json", "X-API-Key": "supersim_YOUR_API_KEY", "Idempotency-Key": "order-abc-123",},body: JSON.stringify({ country_id: 1, account_type: "ready" }),});const data = await res.json();console.log(data.order_id, data.phone_number, data.password_2fa);{ "order_id": 42, "phone_number": "+393791700000", "country_name": "Italy", "account_type": "ready", "price": 1.5, "password_2fa": "7z6yxsr", "message": "Account purchased successfully. Use /api/v1/otp/{order_id} to fetch login code."}Purchase a session file
Section titled “Purchase a session file”For session orders the phone number and password are returned, and the actual session files are available for download:
import requests
# 1. Buybuy = requests.post( "https://su-persim.uz/api/v1/buy", headers={"X-API-Key": "supersim_YOUR_API_KEY"}, json={"country_id": 2, "account_type": "session"},).json()order_id = buy["order_id"]
# 2. Download the session ZIPfiles = requests.get( f"https://su-persim.uz/api/v1/orders/{order_id}/download", headers={"X-API-Key": "supersim_YOUR_API_KEY"},)open(f"order_{order_id}.zip", "wb").write(files.content)<?php
// 1. Buy$ch = curl_init("https://su-persim.uz/api/v1/buy");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [ "X-API-Key: supersim_YOUR_API_KEY", "Content-Type: application/json",]);curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ "country_id" => 2, "account_type" => "session",]));$buy = json_decode(curl_exec($ch), true);curl_close($ch);$orderId = $buy["order_id"];
// 2. Download the session ZIP$ch = curl_init( "https://su-persim.uz/api/v1/orders/{$orderId}/download");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-API-Key: supersim_YOUR_API_KEY"]);file_put_contents("order_{$orderId}.zip", curl_exec($ch));curl_close($ch);// 1. Buyconst buyRes = await fetch("https://su-persim.uz/api/v1/buy", {method: "POST",headers: { "Content-Type": "application/json", "X-API-Key": "supersim_YOUR_API_KEY" },body: JSON.stringify({ country_id: 2, account_type: "session" }),});const buy = await buyRes.json();const orderId = buy.order_id;
// 2. Download the session ZIPconst files = await fetch(`https://su-persim.uz/api/v1/orders/${orderId}/download`,{ headers: { "X-API-Key": "supersim_YOUR_API_KEY" } });const blob = await files.blob();const a = document.createElement("a");a.href = URL.createObjectURL(blob);a.download = `order_${orderId}.zip`;a.click();Complete lifecycle
Section titled “Complete lifecycle”-
Buy
POST /buyreserves the account and returnsorder_id. -
Get the OTP
For ready accounts,
GET /api/v1/otp/{order_id}returns the Telegram login code. With a webhook configured, the code is pushed to you automatically. -
Log in & finalize
Log in to Telegram with
phone_number+password_2fa+ OTP, then callPOST /api/v1/logout/{order_id}. The order status becomescompleted.
Errors
Section titled “Errors”| HTTP code | Scenario |
|---|---|
400 |
Invalid account_type or insufficient balance. |
404 |
Country not found/inactive, or no stock available. |
422 |
Validation error (e.g. missing country_id). |
429 |
Rate limit exceeded. |
If you believe a purchased account is broken, run
POST /api/v1/orders/{order_id}/validateand contact support with theorder_id.