Reseller API Documentation

Semua request memerlukan header X-API-Key

🔐 Authentication

GET /api/auth/me - Get profile

curl -X GET "https://reseller.sapimu.cloud/api/auth/me" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678"

POST /api/auth/reset-key - Reset API key

curl -X POST "https://reseller.sapimu.cloud/api/auth/reset-key" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678"

📦 Products

GET /api/products - List products dengan harga reseller

curl -X GET "https://reseller.sapimu.cloud/api/products" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678"

🎟️ Codes

POST /api/codes/buy - Beli kode redeem

curl -X POST "https://reseller.sapimu.cloud/api/codes/buy" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678" \
  -H "Content-Type: application/json" \
  -d '{"product_id": "basic", "qty": 1}'

GET /api/codes - List kode milik reseller

curl -X GET "https://reseller.sapimu.cloud/api/codes?limit=20&offset=0" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678"

GET /api/codes/:code - Detail kode

curl -X GET "https://reseller.sapimu.cloud/api/codes/ABC123XYZ" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678"

💳 Topup

GET /api/topup/options - Opsi nominal topup

curl -X GET "https://reseller.sapimu.cloud/api/topup/options" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678"

POST /api/topup - Buat topup QRIS (kelipatan 5000)

curl -X POST "https://reseller.sapimu.cloud/api/topup" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678" \
  -H "Content-Type: application/json" \
  -d '{"amount": 50000}'

GET /api/topup/:id - Cek status topup

curl -X GET "https://reseller.sapimu.cloud/api/topup/tp_abc123" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678"

📜 Transactions

GET /api/transactions - Riwayat transaksi

curl -X GET "https://reseller.sapimu.cloud/api/transactions?limit=20&offset=0" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678"

🔑 Tokens

GET /api/tokens - List token milik reseller

curl -X GET "https://reseller.sapimu.cloud/api/tokens?limit=20&offset=0" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678"

POST /api/tokens/buy - Beli token untuk user

curl -X POST "https://reseller.sapimu.cloud/api/tokens/buy" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678" \
  -H "Content-Type: application/json" \
  -d '{"product_id": "basic", "telegram_id": "123456789"}'

GET /api/tokens/:token - Detail & stats token

curl -X GET "https://reseller.sapimu.cloud/api/tokens/abc123def456..." \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678"

POST /api/tokens/:token/refresh - Generate token baru

curl -X POST "https://reseller.sapimu.cloud/api/tokens/abc123def456.../refresh" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678"

POST /api/tokens/:token/revoke - Revoke token

curl -X POST "https://reseller.sapimu.cloud/api/tokens/abc123def456.../revoke" \
  -H "X-API-Key: rsl_a3f8c2e1b9d4567890abcdef12345678"

API Key didapat dari Telegram Bot setelah menjadi reseller