API Documentation

Alight Motion Bot 1 Tahun · ariepulsa

Autentikasi

Hybrid Auth — Request dari domain yang sama (misal halaman order di amth.ariepulsa.com) lewat tanpa API key. Request dari luar (server lain, Postman, script) wajib menyertakan header:
X-API-Key: YOUR_API_KEY
API key di-set di file .env bagian API_KEY=.

Rate Limit

Web form dibatasi 5 request/menit per IP. Request dengan API key valid TIDAK dibatasi.

Endpoints

POST /api/order web api-key

Buat order baru. Akun di-generate fresh (butuh ±2 menit/akun). Response 202 langsung berisi orderId untuk polling.

Body (JSON)
FieldTipeWajibDefaultKeterangan
qtynumbertidak1Jumlah akun (1-20)
notestringtidak-Catatan internal (max 200 char)
Contoh (curl)
curl -X POST https://amth.ariepulsa.com/api/order \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{"qty": 1, "note": "order dari reseller A"}'
Response 202
{
  "success": true,
  "orderId": "ord_lz0x1abc_1a2b3c4d",
  "status": "pending",
  "qty": 1,
  "message": "Order diterima...",
  "pollUrl": "/api/order/ord_lz0x1abc_1a2b3c4d",
  "pollIntervalMs": 5000,
  "docs": "/docs"
}
GET /api/order/:id web api-key

Cek status order. Polling tiap 5 detik sampai status = success atau failed.

Contoh
curl https://amth.ariepulsa.com/api/order/ord_lz0x1abc_1a2b3c4d \
  -H "X-API-Key: YOUR_API_KEY"
Response (sukses total)
{
  "success": true,
  "order": {
    "id": "ord_lz0x1abc_1a2b3c4d",
    "status": "success",
    "qty": 1,
    "progress": 1,
    "partial": false,
    "accounts": [{
      "email": "amabc123@emailqu.com",
      "password": "Ariepulsa123",
      "loginLink": "-",
      "inboxUrl": "https://emailqu.com"
    }],
    "error": null,
    "createdAt": 1700000000000,
    "startedAt": 1700000001000,
    "finishedAt": 1700000120000
  }
}
Response (gagal total)
{
  "success": true,
  "order": {
    "id": "ord_...",
    "status": "failed",
    "accounts": [],
    "error": "Kode verifikasi tidak kunjung masuk ke inbox.",
    ...
  }
}
GET /api/orders?limit=50&offset=0 api-key

List 50 order terakhir. Maksimal 100 per request.

curl https://amth.ariepulsa.com/api/orders?limit=10 \
  -H "X-API-Key: YOUR_API_KEY"
GET /api/health web

Cek status server dan antrian. Public, tidak perlu auth.

curl https://amth.ariepulsa.com/api/health
GET /api/health/services api-key

Deep check 3 layanan upstream: Emailqu, Firebase, Alight Motion. Lambat (±3 detik).

curl https://amth.ariepulsa.com/api/health/services \
  -H "X-API-Key: YOUR_API_KEY"
GET /api/stock?limit=50 api-key

List akun yang sudah ada di result.txt (database lokal). Maks 500 per request.

curl https://amth.ariepulsa.com/api/stock \
  -H "X-API-Key: YOUR_API_KEY"
GET /api/stats api-key

Statistik order: total, sukses, gagal, antrian saat ini.

curl https://amth.ariepulsa.com/api/stats \
  -H "X-API-Key: YOUR_API_KEY"

Workflow Lengkap

# 1. Submit order
curl -X POST https://amth.ariepulsa.com/api/order \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{"qty": 1}'
# Response: {"orderId": "ord_...", ...}

# 2. Polling tiap 5 detik
curl https://amth.ariepulsa.com/api/order/ord_... \
  -H "X-API-Key: YOUR_API_KEY"

# 3. Berhenti polling saat status = "success" atau "failed"
# Ambil akun dari order.accounts[0].email + .password

Status Code

CodeArti
202Order diterima, sedang diproses (async)
200OK (GET request)
401Unauthorized - API key salah/tidak ada
404Order tidak ditemukan
429Rate limit terlampaui
500Server error

Contoh Integrasi PHP

<?php
// Submit order
$ch = curl_init('https://amth.ariepulsa.com/api/order');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => [
    'Content-Type: application/json',
    'X-API-Key: YOUR_API_KEY'
  ],
  CURLOPT_POSTFIELDS => json_encode(['qty' => 1]),
  CURLOPT_RETURNTRANSFER => true
]);
$res = json_decode(curl_exec($ch), true);
$orderId = $res['orderId'];

// Polling
do {
  sleep(5);
  $ch = curl_init("https://amth.ariepulsa.com/api/order/$orderId");
  curl_setopt_array($ch, [
    CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY'],
    CURLOPT_RETURNTRANSFER => true
  ]);
  $res = json_decode(curl_exec($ch), true);
  $status = $res['order']['status'];
} while ($status === 'pending' || $status === 'processing');

if ($status === 'success') {
  $email = $res['order']['accounts'][0]['email'];
  $password = $res['order']['accounts'][0]['password'];
  echo "Akun: $email / $password";
}

Contoh Integrasi Node.js

const res = await fetch('https://amth.ariepulsa.com/api/order', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': process.env.AM_API_KEY
  },
  body: JSON.stringify({ qty: 1 })
});
const { orderId } = await res.json();

// Polling
let status = 'pending';
while (status === 'pending' || status === 'processing') {
  await new Promise(r => setTimeout(r, 5000));
  const r = await fetch(`https://amth.ariepulsa.com/api/order/${orderId}`, {
    headers: { 'X-API-Key': process.env.AM_API_KEY }
  });
  const data = await r.json();
  status = data.order.status;
  if (status === 'success') {
    console.log(data.order.accounts[0]);
  }
}