Developer API v1.6

Integrasi toko dan aplikasi

Buat API key per aplikasi dari Admin → Aplikasi & API. API key hanya boleh dipakai dari backend server.

Jangan menyimpan API key atau webhook secret di JavaScript publik, repository, atau log.

Autentikasi

Gunakan Bearer token dan Idempotency-Key unik untuk setiap pembuatan invoice.

Authorization: Bearer akp_live_xxxxxxxxx Idempotency-Key: order-KSK-001-attempt-1 Content-Type: application/json

Create Invoice v1

Membuat invoice tanpa harus menyimpan produk di AutoKuy Pay.

POST
POST https://gopay.kuskuskuy.my.id/api/v1/create-invoice.php { "order_id": "KSK-001", "amount": 50000, "customer_name": "Budi", "customer_phone": "628123456789", "description": "Pembelian produk digital" }

Respons berisi invoice_id, total + kode unik, payment_url, status_url, dan expiry.

Invoice Status

Membaca invoice milik aplikasi yang sama.

GET
GET https://gopay.kuskuskuy.my.id/api/v1/invoice-status.php?invoice_id=AKP-20260721-XXXXXXX Authorization: Bearer akp_live_xxxxxxxxx

Webhook callback pembayaran

AutoKuy Pay mengirim event PAID, EXPIRED, FAILED, atau CANCELLED ke URL aplikasi.

HMAC
X-AutoKuy-Event: payment.paid X-AutoKuy-Event-Id: evt_xxxxxxxxx X-AutoKuy-Timestamp: 1784626200 X-AutoKuy-Signature: HMAC_SHA256(timestamp + "." + raw_body, webhook_secret) { "event": "payment.paid", "event_id": "evt_xxxxxxxxx", "invoice_id": "AKP-20260721-XXXXXXX", "order_id": "KSK-001", "amount": 50127, "base_amount": 50000, "unique_code": 127, "status": "PAID", "paid_at": "2026-07-21 14:30:00" }

Penerima wajib memverifikasi signature, timestamp, event_id, dan menerapkan idempotency.

Android Listener lama

Endpoint lama tetap dipertahankan agar fungsi yang sudah berjalan tidak berubah.

POST
POST https://gopay.kuskuskuy.my.id/api/webhook.php X-Signature: HMAC_SHA256(raw_json, config webhook_secret)

Queue workers

Jalankan via Task Scheduler/cron untuk retry otomatis.

POST https://gopay.kuskuskuy.my.id/api/process-whatsapp.php?limit=10 X-API-Key: LEGACY_API_KEY POST https://gopay.kuskuskuy.my.id/api/process-webhooks.php?limit=10 X-API-Key: LEGACY_API_KEY