API Documentation
Integrasikan payment system InvoiceKu ke dalam aplikasi, website, atau bot Anda. API kami dirancang RESTful, mudah digunakan, dan mendukung instant QRIS generation.
Use Case:
- Bot Telegram/WhatsApp otomatis kirim QR tagihan.
- Integrasi website donasi sederhana.
- Checkout di sistem e-commerce custom.
Authentication
Gunakan Bearer Token Authentication. Dapatkan API Key Anda di Dashboard > Settings > Developer.
Header HTTP:
Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxx
Create Payment Link
POST
/api/v1/payment-links
Buat link pembayaran baru secara programatik.
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Nama Payment Link. |
| amount | Integer | Yes | Nominal pembayaran. Min Rp 100. |
| description | String | No | Deskripsi tambahan. |
| project_slug | String | No | Slug project. Default: Project pertama. |
| single_use | Boolean | No | Jika true, link akan expire setelah 1x pemakaian. |
Example Response
{
"status": "success",
"data": {
"id": 123,
"name": "E-Book Premium",
"amount": 100000,
"unique_code": 123,
"payment_url": "https://invoiceku.net/p/my-project/EBOOK-123",
"type": "forever"
}
}
Create Invoice
Generate link pembayaran dan QRIS string secara instan.
POST
/api/v1/invoice
Request Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
| amount | Integer | Yes | Nominal tagihan. Min Rp 100. |
| project_slug | String | No | Slug project. Default: Project pertama user. |
| item_name | String | No | Nama produk/layanan (untuk referensi). |
| customer_name | String | No | Nama customer. Default: "Guest User". |
Example Request
curl -X POST https://invoiceku.net/api/v1/invoice \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"amount": 50000,
"item_name": "Premium Upgrade",
"customer_name": "John Doe"
}'
Example Response
{
"status": "success",
"data": {
"invoice_id": "INV-A1B2-5555",
"amount_original": 50000,
"amount_total": 50123,
"fee_bearer": "buyer",
"qris_string": "00020101021226590013ID.CO.QRIS...",
"qris_image_url": "https://api.qrserver.com/...",
"payment_url": "https://invoiceku.net/invoice/INV-A1B2-5555",
"expired_at": "2026-01-24 10:00:00"
}
}
Notes:
amount_totalsudah termasuk Kode Unik (jika ada).qris_stringbisa dirender menjadi QR Code library pilihan Anda.
Check Status
GET
/api/v1/invoice/{invoice_code}
Cek status pembayaran real-time.
Rate Limit: 1000 request / menit
Example Response
{
"status": "success",
"data": {
"invoice_id": "INV-A1B2-5555",
"status": "paid", // pending, paid, failed, expired
"amount_total": 50123,
"paid_at": "2026-01-23 15:30:00"
}
}
Cancel Invoice
POST
/api/v1/invoice/{invoice_code}/cancel
Membatalkan invoice yang masih pending.
Example Response
{
"status": "success",
"message": "Invoice cancelled successfully",
"data": {
"invoice_id": "INV-A1B2-5555",
"status": "failed"
}
}
Error Codes
- 401 Unauthorized API Key tidak valid atau tidak ditemukan.
- 400 Bad Request Input tidak valid (misal: amount kurang).
- 404 Not Found Project tidak ditemukan.
- 503 Service Unavailable Gagal generate QRIS (sistem busy).