Reseller API Documentation

πŸ‡»πŸ‡³ TiαΊΏng ViệtπŸ‡¬πŸ‡§ English

Reseller API for the bot's public services, wallet and order history.

Base URL: /api/v1

Authentication

Send X-API-Key on every request. API access must be enabled manually by the administrator before use. Use HTTPS only; never put the key in URLs, public frontend code or logs.

curl -H "X-API-Key: YOUR_BOT_API_KEY" https://YOUR_DOMAIN/api/v1/me

Conventions

{
  "ok": true,
  "code": "SUCCESS"
}
{
  "ok": false,
  "code": "INSUFFICIENT_BALANCE",
  "error": "Insufficient balance."
}

Use one clientOrderId/shopOrderId per order and reuse it when resending a create request. Reusing an ID with a different payload returns 409 IDEMPOTENCY_CONFLICT.

Account, wallet and history

MethodEndpointDescription
GET/meProfile, tier, Point balance and referrals
GET/balanceCanonical Point balance and display equivalents
GET/purchases?limit=50Bot purchase history
GET/deposits?limit=50Deposit history
GET/referralsReferral statistics
{
  "ok": true,
  "success": true,
  "code": "SUCCESS",
  "shopId": "TG123",
  "wallet": {
    "point": 1.5,
    "usd": 1.5,
    "vnd": 39000,
    "credit": 2
  }
}

Point is the single wallet unit: 1 Point = 1 USD = 26,000 VND. Telegram Stars are only used to top up Point in the bot; wallet.usd and wallet.vnd are display equivalents.

Shop products

MethodEndpointDescription
GET/products?page=1&limit=50Products, prices and stock
POST/ordersBuy by productId or code
POST/products/{id}/buyBuy by ID
GET/orders?limit=50Shop API orders
GET/orders/{orderCode}Order details
POST /orders

{
  "productId": 123,
  "qty": 1,
  "currency": "point",
  "shopOrderId": "shop-001"
}
{
  "ok": true,
  "order": {
    "orderCode": "ORDER123",
    "shopOrderId": "shop-001",
    "qty": 1,
    "total": 1.5,
    "currency": "point",
    "status": "completed",
    "accounts": [
      "delivered-content"
    ]
  }
}

Gemini Student Pro

MethodEndpointDescription
GET/sheerid/service_infoPrice and availability
POST/sheerid/verifyCreate verification with a SheerID URL
GET/sheerid/jobsList jobs
GET/sheerid/jobs/{job_id}Progress and result
POST /sheerid/verify

{
  "sheerid_url": "https://services.sheerid.com/verify/...",
  "client_order_id": "student-001",
  "discount_code": "API5"
}
{
  "job": {
    "job_id": "SJ123",
    "client_order_id": "student-001",
    "status": "pending",
    "progress": 0,
    "result_link": null
  }
}

Gemini Pro Xiaomi 3 months

MethodEndpointDescription
GET/xiaomi3/servicesXiaomi Full price and availability
POST/xiaomi3/ordersCreate a 1–200 account batch
GET/xiaomi3/ordersOrder list
GET/xiaomi3/orders/{id}Details/result

Xiaomi Full is the only mode. Each account becomes an independent order for tracking and refunds. By default, reseller pricing uses wallet-equivalent tiers: 5% off from 30 USD and 10% off from 60 USD. If an administrator assigns a reseller-specific price, that fixed price takes priority and tier discounts do not apply. The price is locked when the order is created.

GET /xiaomi3/services

Read availability, base price, effective price and the current pricing tier before creating an order. customPrice=true means this API account is using a reseller-specific fixed price.

{
  "ok": true,
  "pricingTiers": [
    {
      "minimumUsd": 0,
      "discountPercent": 0
    },
    {
      "minimumUsd": 30,
      "discountPercent": 5
    },
    {
      "minimumUsd": 60,
      "discountPercent": 10
    }
  ],
  "services": [
    {
      "taskType": "default",
      "name": "Xiaomi Full",
      "basePriceUsd": 2,
      "basePriceVnd": 50000,
      "priceUsd": 1.7,
      "priceVnd": 43000,
      "discountPercent": 0,
      "customPrice": true,
      "walletEquivalentUsd": 35,
      "enabled": true
    }
  ]
}

POST /xiaomi3/orders

FieldTypeRequirements / Meaning
taskTypestringRequired: only default is accepted.
currencystringRecommended: point. Legacy usd/vnd are accepted and converted to Point.
clientOrderIdstringRequired, 8–80 letters, digits, underscores or hyphens. Reuse the same value after a timeout.
accountsstring[]Required, 1–200 lines. Each line uses an exact 32-character Base32 2FA secret or one 8-digit backup code.
POST /xiaomi3/orders
Content-Type: application/json
X-API-Key: YOUR_BOT_API_KEY

{"taskType":"default","currency":"point","clientOrderId":"xiaomi-001","accounts":["email@gmail.com|password|12345678","second@gmail.com|password|JBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP"]}

A new request returns HTTP 202. Replaying the same clientOrderId with the same payload returns HTTP 200 and duplicated=true without charging twice. Reusing it with different accounts or currency returns HTTP 409 IDEMPOTENCY_CONFLICT.

{
  "ok": true,
  "duplicated": false,
  "orders": [
    {
      "id": 812,
      "clientOrderId": "xiaomi-001",
      "email": "email@gmail.com",
      "taskType": "default",
      "status": "pending",
      "amount": 47500,
      "currency": "vnd",
      "resultLink": null,
      "errorCode": null,
      "errorEn": null,
      "createdAt": "2026-11-16 10:20:00",
      "updatedAt": "2026-11-16 10:20:01"
    }
  ]
}

GET /xiaomi3/orders

Returns up to the latest 50 orders for the current API key, newest first. A multi-account batch appears as separate orders sharing one clientOrderId.

{
  "ok": true,
  "orders": [
    {
      "id": 812,
      "clientOrderId": "xiaomi-001",
      "email": "email@gmail.com",
      "taskType": "default",
      "status": "running",
      "amount": 47500,
      "currency": "vnd",
      "resultLink": null,
      "errorCode": null,
      "errorEn": null,
      "createdAt": "2026-11-16 10:20:00",
      "updatedAt": "2026-11-16 10:21:10"
    }
  ]
}

GET /xiaomi3/orders/{id}

Reads one order owned by the current API key. A successful order returns resultLink when available; a failed order returns normalized errorCode and errorEn, and that order's charge is refunded automatically.

{
  "ok": true,
  "order": {
    "id": 812,
    "clientOrderId": "xiaomi-001",
    "email": "email@gmail.com",
    "taskType": "default",
    "status": "success",
    "amount": 47500,
    "currency": "vnd",
    "resultLink": "https://one.google.com/...",
    "errorCode": null,
    "errorEn": null,
    "createdAt": "2026-11-16 10:20:00",
    "updatedAt": "2026-11-16 10:23:00"
  }
}
{
  "ok": true,
  "order": {
    "id": 813,
    "clientOrderId": "xiaomi-001",
    "email": "second@gmail.com",
    "taskType": "default",
    "status": "failed",
    "amount": 47500,
    "currency": "vnd",
    "resultLink": null,
    "errorCode": "wrong_password",
    "errorEn": "Incorrect password.",
    "createdAt": "2026-11-16 10:20:00",
    "updatedAt": "2026-11-16 10:22:00"
  }
}

Order fields:

FieldTypeRequirements / Meaning
idintegerOrder ID used by the detail endpoint.
clientOrderIdstringReseller-supplied idempotency ID.
emailstringOrder account; password/2FA is never returned.
statusstringsubmitting | pending | running | success | failed | cancelled
amountnumberPoint locked for this order.
currencystringpoint
resultLinkstring|nullResult link when completed and available.
errorCodestring|nullStable machine-readable error code.
errorEnstring|nullCustomer-safe English error message.
createdAt / updatedAtstringCreation and latest update timestamps.

Status polling

Poll every 5–10 seconds. Stop on success, failed or cancelled. If the system does not return a valid task ID, the order fails and the wallet is refunded automatically.

submitting β†’ pending β†’ running β†’ success
failed, cancelled

HTTP statuses and error codes

MethodEndpointDescription
400INVALID_TASK_TYPE / INVALID_CURRENCY / INVALID_CLIENT_ORDER_ID / INVALID_ACCOUNTS / INVALID_ORDER_IDInvalid request
401MISSING_API_KEY / INVALID_API_KEYAuthentication error
402INSUFFICIENT_BALANCE / INSUFFICIENT_CREDITInsufficient funds
403API_NOT_UNLOCKED / SERVICE_DISABLEDAdmin approval is missing or the service is disabled
404ORDER_NOT_FOUND / INVALID_PRODUCTNot found
409IDEMPOTENCY_CONFLICTSame ID, different payload
410XIAOMI_LINK_DISABLEDLink mode is not available
500INTERNAL_ERRORTemporary internal error; retry with the same clientOrderId
503SERVICE_UNAVAILABLE / PRICE_UNAVAILABLETemporarily unavailable

Security

Passwords, 2FA secrets and internal task identifiers are never returned. Do not log credentials or share X-API-Key.

OpenAPI for Postman/Swagger

GET /api/v1/openapi.json