Integrasikan pembuatan invoice QRIS dinamis dan penerimaan callback otomatis di berbagai framework
1. Base URL API
https://nirvapay.dasrams.biz.id
2. Header Autentikasi
Authorization: Bearer sec_live_xxxx
Contoh Request Buat Invoice (cURL)
curl -X POST https://nirvapay.dasrams.biz.id/api/v1/invoices \
-H "Authorization: Bearer sec_live_nirva_e3b829c7140f912b" \
-H "Content-Type: application/json" \
-d '{
"amount": 25000,
"customer_name": "Budi Santoso",
"description": "Topup Saldo Akun #1024",
"merchant_ref": "ORDER-1024",
"payment_channel": "QRIS"
}'
Contoh Integrasi Python (httpx / requests)
import httpx
async def create_qris(order_id: str, amount: int):
url = "https://nirvapay.dasrams.biz.id/api/v1/invoices"
headers = {"Authorization": "Bearer sec_live_nirva_e3b829c7140f912b"}
payload = {
"amount": amount,
"merchant_ref": order_id,
"customer_name": "Pembeli Digital",
"description": f"Pesanan #{order_id}"
}
async with httpx.AsyncClient() as client:
res = await client.post(url, json=payload, headers=headers)
data = res.json()
return data["invoice"]["payment_url"], data["invoice"]["qris_payload"]
Contoh Integrasi Node.js (Axios / Fetch)
const axios = require('axios');
async function createPayment(orderId, amount) {
const response = await axios.post('https://nirvapay.dasrams.biz.id/api/v1/invoices', {
amount: amount,
merchant_ref: orderId,
customer_name: 'Customer Store',
description: `Order #${orderId}`
}, {
headers: { 'Authorization': 'Bearer sec_live_nirva_e3b829c7140f912b' }
});
return response.data.invoice;
}
Contoh Integrasi PHP / Laravel Http Client
use Illuminate\Support\Facades\Http;
$response = Http::withToken('sec_live_nirva_e3b829c7140f912b')
->post('https://nirvapay.dasrams.biz.id/api/v1/invoices', [
'amount' => 25000,
'merchant_ref' => 'INV-001',
'customer_name' => 'Budi Santoso',
'description' => 'Pembelian Item Game'
]);
$invoice = $response->json()['invoice'];
return redirect($invoice['payment_url']);