Dokumentasi API
Integrasi pembayaran ke aplikasi Anda
Langkah pertama yang harus kamu lakukan adalah mendaftar dan login ke dashboard. Setelah itu, dapatkan API Key kamu di menu Profil untuk mulai mengintegrasikan sistem pembayaran ke aplikasi kamu.
Simpan API Key Anda di tempat yang aman. Jangan bagikan ke siapa pun. Jika bocor, segera generate ulang di menu Profil.
| Nama | Tipe |
|---|---|
| apikey | string |
const baseUrl = 'BASE_URL';
const apiKey = 'YOUR_API_KEY';
const res = await fetch(`${baseUrl}/api/profile?apikey=${apiKey}`);
const data = await res.json();
console.log(data);
// Contoh Response (200 OK):
// {
// "username": "your_username",
// "email": "[email protected]",
// "balance": 150000,
// "pending_balance": 100000
// }
| Nama | Tipe |
|---|---|
| apikey | string |
| amount | integer |
const baseUrl = 'BASE_URL';
const apiKey = 'YOUR_API_KEY';
const res = await fetch(
`${baseUrl}/api/createinvoice?apikey=${apiKey}&amount=50000`
);
const data = await res.json();
console.log(data);
// Contoh Response (200 OK):
// {
// "success": true,
// "invoice_id": "64c8d9e...",
// "amount": 50000,
// "fee": 500,
// "total": 50500,
// "qris_image": "https://...",
// "payment_link": "https://...",
// "expired_at": "2025-01-01 12:00:00"
// }
Gunakan nilai payment_link atau qris_image untuk menampilkan halaman pembayaran kepada customer.
| Nama | Tipe |
|---|---|
| apikey | string |
| id | string |
const baseUrl = 'BASE_URL';
const apiKey = 'YOUR_API_KEY';
const invoiceId = 'YOUR_INVOICE_ID';
const res = await fetch(
`${baseUrl}/api/checkinvoice?apikey=${apiKey}&id=${invoiceId}`
);
const data = await res.json();
console.log(data);
// Contoh Response (200 OK):
// {
// "invoice_id": "64c8d9e...",
// "amount": 50000,
// "fee": 500,
// "total": 50500,
// "status": "paid",
// "qris_image": "https://...",
// "payment_link": "https://...",
// "expired_at": "2025-01-01 12:00:00",
// "created_at": "2025-01-01 11:30:00",
// "balance_after": 500000,
// "completed_at": "2025-01-01 11:35:00"
// }
Parameter id juga bisa dikirim dengan nama invoice_id untuk kompatibilitas.
Webhook memungkinkan sistem Anda menerima notifikasi real-time ketika ada transaksi deposit yang berhasil dibayar (status paid) — tanpa perlu melakukan polling ke API kami.
POST <URL webhook Anda>
Content-Type: application/json
X-Webhook-Event: deposit.paid
X-Webhook-Id: <log_id>
X-Webhook-Attempt: 1
User-Agent: PixPayz-Webhook/1.0
{
"event": "deposit.paid",
"created_at": "2025-01-01T12:00:00.000Z",
"data": {
"id": "TRX...",
"reference": "TRX...",
"type": "deposit",
"amount": 10000,
"fee": 123,
"total": 10123,
"status": "paid",
"qris_image": "https://...",
"created_at": "2025-01-01T11:55:00.000Z",
"completed_at": "2025-01-01T12:00:00.000Z",
"balance_after": 10123
}
}
HTTP 2xx → dianggap sukses, selesai
Selain 2xx atau timeout (15 detik) → otomatis retry
Total 5 percobaan dengan jeda bertingkat:
1 menit → 5 menit → 15 menit → 1 jam → 6 jam.
Anda juga bisa melakukan retry manual dari halaman Riwayat Webhook.
Pastikan endpoint Anda selalu membalas HTTP 2xx secepat mungkin (idealnya < 5 detik). Jika butuh proses lama, simpan payload dulu lalu proses di background (queue) agar tidak timeout.