Ciparage UMKM
← Ciparage UMKM

Dokumentasi API

Developer: Ciparage Technology Team · Base URL: https://merchant.ciparage.web.id

Integrasi Casaku aktif setelah License Key, Webhook Secret, QR ID, package IDs, dan konfigurasi database diisi pada server. Status paid hanya ditetapkan berdasarkan status provider atau webhook bertanda tangan valid.

Autentikasi

Gunakan metode POST, header Content-Type: application/json dan X-API-KEY: APIKEY_ANDA. Simpan API key di backend, jangan di frontend browser.

POST /api/create_pay

{
  "merchant_id": "MERCHANT_ID_ANDA",
  "order_id": "INV-2026-001",
  "amount": 25000
}

Contoh respons

{
  "success": true,
  "data": {
    "order_id": "INV-2026-001",
    "amount": 25000,
    "status": "pending",
    "qr_string": "string-dari-provider",
    "checkout_url": null
  }
}

POST /api/cek_status

{ "merchant_id": "MERCHANT_ID_ANDA", "order_id": "INV-2026-001" }

Contoh cURL

curl -X POST 'https://merchant.ciparage.web.id/api/create_pay' \\
  -H 'Content-Type: application/json' \\
  -H 'X-API-KEY: APIKEY_ANDA' \\
  -d '{"merchant_id":"MERCHANT_ID_ANDA","order_id":"INV-2026-001","amount":25000}'

JavaScript (Node.js)

const response = await fetch('https://merchant.ciparage.web.id/api/create_pay', {
  method: 'POST',
  headers: {'Content-Type':'application/json','X-API-KEY':process.env.CIPARAGE_API_KEY},
  body: JSON.stringify({merchant_id:'MERCHANT_ID_ANDA', order_id:'INV-2026-001', amount:25000})
});
console.log(await response.json());

PHP

$ch = curl_init('https://merchant.ciparage.web.id/api/create_pay');
curl_setopt_array($ch, [CURLOPT_POST=>true, CURLOPT_RETURNTRANSFER=>true,
 CURLOPT_HTTPHEADER=>['Content-Type: application/json','X-API-KEY: '.getenv('CIPARAGE_API_KEY')],
 CURLOPT_POSTFIELDS=>json_encode(['order_id'=>'INV-2026-001','amount'=>25000])]);
$result = curl_exec($ch); curl_close($ch); echo $result;

Python

import os, requests
r = requests.post('https://merchant.ciparage.web.id/api/create_pay',
  headers={'X-API-KEY':os.environ['CIPARAGE_API_KEY']},
  json={'order_id':'INV-2026-001','amount':25000}, timeout=20)
print(r.json())

Node.js — cek status

const r = await fetch('https://merchant.ciparage.web.id/api/cek_status', {
 method:'POST', headers:{'Content-Type':'application/json','X-API-KEY':process.env.CIPARAGE_API_KEY},
 body:JSON.stringify({merchant_id:'MERCHANT_ID_ANDA',order_id:'INV-2026-001'})
}); console.log(await r.json());

PHP — cek status

$ch=curl_init('https://merchant.ciparage.web.id/api/cek_status');
curl_setopt_array($ch,[CURLOPT_POST=>true,CURLOPT_RETURNTRANSFER=>true,
 CURLOPT_HTTPHEADER=>['Content-Type: application/json','X-API-KEY: '.getenv('CIPARAGE_API_KEY')],
 CURLOPT_POSTFIELDS=>json_encode(['order_id'=>'INV-2026-001'])]);
echo curl_exec($ch); curl_close($ch);

Python — cek status

import os, requests
r=requests.post('https://merchant.ciparage.web.id/api/cek_status',
 headers={'X-API-KEY':os.environ['CIPARAGE_API_KEY']}, json={'merchant_id':'MERCHANT_ID_ANDA','order_id':'INV-2026-001'}, timeout=20)
print(r.json())

Webhook Casaku

Daftarkan URL https://merchant.ciparage.web.id/api/webhook_casaku pada dashboard Casaku. Pastikan signature HMAC-SHA256 valid dan nominal cocok. Casaku memverifikasi pembayaran QRIS; layanan ini bukan API payout, jadi penarikan dana tidak otomatis dikirim oleh integrasi ini.

Catatan: Ganti MERCHANT_ID_ANDA dengan ID Merchant yang tampil di dashboard. Jangan menaruh API key pada kode frontend publik.