Referensi endpoint dibuat dengan layout responsif ala Swagger. Semua contoh memakai placeholder aman dan base URL frontend agar dokumentasi tidak mengarah ke domain backend.
https://topup.ferdiananda.web.id/apiAccept: application/json
X-API-KEY: <api_key>Gunakan skema autentikasi sesuai endpoint. Jangan pernah menaruh secret atau API key asli di frontend publik.
Dipakai untuk katalog publik, pembuatan order, detail invoice, dan polling status pembayaran.
Accept: application/json
X-API-KEY: <server-api-key>{
"success": true,
"message": "Request berhasil.",
"data": {}
}{
"success": false,
"message": "Validasi gagal.",
"error_code": "VALIDATION_ERROR",
"errors": {}
}Semua endpoint direkomendasikan mengirim header Accept: application/json agar response error maupun sukses konsisten.
Endpoint untuk membaca daftar game dan route detail game yang tersedia untuk publik.
https://topup.ferdiananda.web.id/api/games| Nama | Tipe | Wajib | Deskripsi | Contoh |
|---|---|---|---|---|
| Accept | string | Ya | Gunakan application/json agar response selalu dikembalikan dalam format JSON. | application/json |
| X-API-KEY | string | Ya | API key publik yang diverifikasi oleh ApiKeyMiddleware untuk seluruh route public API. | server-api-key |
curl -X GET 'https://topup.ferdiananda.web.id/api/games' \
-H 'Accept: application/json' \
-H 'X-API-KEY: <server-api-key>'{
"success": true,
"games": [
{
"id": 11,
"image": "https://topup.ferdiananda.web.id/storage/games/mobile-legends.jpg",
"banner": "https://topup.ferdiananda.web.id/storage/banner/mobile-legends-banner.jpg",
"title": "Mobile Legends",
"developers": "Moonton",
"brand": "MLBB",
"category_id": 1,
"slug": "mobile-legends",
"description": "Top up diamond Mobile Legends.",
"status": true,
"populer": true,
"sort": 1,
"category": {
"id": 1,
"title": "MOBA"
}
}
],
"populerGames": [
{
"id": 11,
"image": "https://topup.ferdiananda.web.id/storage/games/mobile-legends.jpg",
"banner": "https://topup.ferdiananda.web.id/storage/banner/mobile-legends-banner.jpg",
"title": "Mobile Legends",
"developers": "Moonton",
"brand": "MLBB",
"category_id": 1,
"slug": "mobile-legends",
"description": "Top up diamond Mobile Legends.",
"status": true,
"populer": true,
"sort": 1
}
]
}{
"message": "Unauthorized"
}Endpoint untuk membuat transaksi dan memantau invoice pembayaran.
https://topup.ferdiananda.web.id/api/order| Nama | Tipe | Wajib | Deskripsi | Contoh |
|---|---|---|---|---|
| Accept | string | Ya | Gunakan application/json agar response selalu dikembalikan dalam format JSON. | application/json |
| X-API-KEY | string | Ya | API key publik yang diverifikasi oleh ApiKeyMiddleware untuk seluruh route public API. | server-api-key |
| Nama | Tipe | Wajib | Deskripsi | Contoh |
|---|---|---|---|---|
| id | string | Ya | User ID atau game ID target transaksi. | 12345678 |
| server | string | Tidak | Server ID bila game memerlukannya. | 2012 |
| game | string | Ya | Slug game yang aktif. | mobile-legends |
| product_id | integer | Ya | ID produk yang dipilih. | 901 |
| payment_method_id | integer | Ya | ID metode pembayaran yang dipilih. | 12 |
| string | Tidak | Email pemesan. | [email protected] | |
| string | Ya | Nomor WhatsApp pemesan. | 081234567890 | |
| nickname | string | Tidak | Nickname game bila tersedia. | FerdiML |
| promo_code | string | Tidak | Kode promo yang ingin diterapkan. | RAMADAN10 |
| quantity | integer | Tidak | Jumlah item. Default 1. | 2 |
curl -X POST 'https://topup.ferdiananda.web.id/api/order' \
-H 'Accept: application/json' \
-H 'X-API-KEY: <server-api-key>' \
-H 'Content-Type: application/json' \
-d '{"id":"12345678","server":"2012","game":"mobile-legends","product_id":901,"payment_method_id":12,"email":"[email protected]","whatsapp":"081234567890","nickname":"FerdiML","promo_code":"RAMADAN10","quantity":2}'{
"success": true,
"message": "Pesanan berhasil dibuat.",
"orderId": "INV-20260329093000-ABCDEFGH",
"data": {
"order_id": "INV-20260329093000-ABCDEFGH",
"payment_status": "UNPAID",
"buy_status": "Pending",
"payment_url": "https://gateway.example/pay/INV-20260329093000-ABCDEFGH",
"payment_code": "INV-20260329093000-ABCDEFGH",
"payment_reference": "INV-20260329093000-ABCDEFGH",
"qr_url": null,
"expired_at": "2026-03-29T10:00:00+07:00",
"quantity": 2,
"total_price": 40000,
"pricing": {
"quantity": 2,
"has_promo": true,
"promo_code": "RAMADAN10",
"unit_price_before_promo": 22000,
"unit_discount": 2000,
"unit_price_after_promo": 20000,
"subtotal_before_promo": 44000,
"promo_discount": 4000,
"subtotal_after_promo": 40000,
"payment_fee": 0,
"unique_code": 0,
"total_price": 40000
}
}
}{
"success": false,
"message": "Produk tidak sesuai dengan game yang dipilih."
}{
"message": "The id field is required. (and 2 more errors)",
"errors": {
"id": [
"The id field is required."
],
"game": [
"The game field is required."
],
"whatsapp": [
"The whatsapp field is required."
]
}
}