?
Available
USD
Locked
USD
Top‑up
USD
Total Spent $0.00
Account Statistics
Total Orders
Completed
Stars Bought
Referrals
Premium Subs
TON Bought
Referral Program
Invite friends, earn $1 per referral
$0.00
earned
Recent Activity
🔐 Authentication

All API requests require an API key obtained from the bot (menu → 🔑 API KEY). Include it in the Authorization header.

// Every request must include: Authorization: Bearer sk-xxxxxxxxxxxxxxxx...
💰 GET /api/v2/balance
GET/api/v2/balance

Returns available, locked, and total balance.

# Example request curl -X GET https://tg-market.store/api/v2/balance \ -H "Authorization: Bearer sk-xxx"
// 200 OK { "ok": true, "balance_usd": 25.5, "locked_usd": 2.0, "available_usd": 23.5 }
StatusErrorDescription
401missing_api_keyAuthorization header missing
401invalid_api_keyAPI key is invalid or inactive
429rate_limit_exceededToo many requests (max 10/sec)
404user_not_foundUser record not found
⭐ POST /api/v2/stars
POST/api/v2/stars

Purchase Telegram Stars for a target username. Optionally wait for completion with ?wait=true.

# Fire-and-forget (returns pending order) curl -X POST https://tg-market.store/api/v2/stars \ -H "Authorization: Bearer sk-xxx" \ -H "Content-Type: application/json" \ -d '{"username":"target","amount":100}' # Wait for completion (up to 90s) curl -X POST https://tg-market.store/api/v2/stars?wait=true \ -H "Authorization: Bearer sk-xxx" \ -H "Content-Type: application/json" \ -d '{"username":"target","amount":100}'
// 200 OK (pending) { "ok": true, "order_id": 42, "username": "target", "amount": 100, "price_usd": 1.20, "status": "pending", "message": "Order queued..." } // 200 OK (completed with ?wait=true) { "ok": true, "order_id": 42, "status": "completed", "provider_order_id": "abc123", "error_message": null }
StatusErrorDescription
400username_requiredMissing target username
400amount must be int...Invalid star amount
400insufficient_balanceNot enough funds in wallet
400reservation_failedFund reservation error
500order_creation_failedInternal order creation error
408timeoutOrder did not finish within 90s
⭐ POST /api/v2/premium
POST/api/v2/premium

Purchase Telegram Premium subscription (3, 6, or 12 months). Supports ?wait=true.

# Purchase 3-month Premium curl -X POST https://tg-market.store/api/v2/premium \ -H "Authorization: Bearer sk-xxx" \ -H "Content-Type: application/json" \ -d '{"username":"target","duration":3}'
// 200 OK { "ok": true, "order_id": 15, "username": "target", "duration_months": 3, "price_usd": 12.00, "status": "pending" }
StatusErrorDescription
400duration must be 3, 6, or 12Invalid duration value
400insufficient_balanceNot enough funds
400reservation_failedFund reservation error
500order_creation_failedInternal order creation error
🔍 GET /api/v2/order/{id}
GET/api/v2/order/{id}

Check the status of a stars order by its ID.

curl -X GET https://tg-market.store/api/v2/order/42 \ -H "Authorization: Bearer sk-xxx"
StatusErrorDescription
404order_not_foundOrder does not exist or doesn't belong to you
🔍 GET /api/v2/premium_order/{id}
GET/api/v2/premium_order/{id}

Check the status of a premium order by its ID.

curl -X GET https://tg-market.store/api/v2/premium_order/15 \ -H "Authorization: Bearer sk-xxx"
StatusErrorDescription
404order_not_foundOrder does not exist or doesn't belong to you
📋 Common Error Codes
CodeMeaningTypical Cause
400Bad RequestInvalid JSON, missing fields, insufficient balance
401UnauthorizedMissing or invalid API key
404Not FoundOrder or user not found
408TimeoutOrder did not complete within 90 seconds (wait mode)
429Too Many RequestsRate limit exceeded (10 req/s per key)
500Internal Server ErrorUnexpected server failure