Orders
Order adalah pusat alur pembayaran: semua langkah berikutnya (rate, QR, webhook, settlement) merujuk ke order_no yang Anda buat.
Buat order
POST
/merchant/fiat/orderHeader wajib: api-key.
| Field | Tipe | Wajib | Keterangan |
|---|---|---|---|
merchant_id | string | Ya | ID merchant Anda |
order_no | string | Ya | Nomor order unik dari sistem Anda |
amount | string | Ya | Nominal fiat (IDR), mis. "150000" |
name | string | Tidak | Nama pelanggan |
email | string | Tidak | Email pelanggan (untuk notifikasi) |
phone | string | Tidak | Nomor telepon pelanggan |
products | array | Tidak | [{ name, price, quantity }] untuk rincian item |
bash
curl -X POST "$HASHPAY_BASE/merchant/fiat/order" \
-H "api-key: $HASHPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"merchant_id": "10001",
"order_no": "INV-2026-0001",
"amount": "150000",
"name": "Budi Santoso",
"products": [
{ "name": "Kopi Arabika 250g", "price": 75000, "quantity": 2 }
]
}'Respons 201
{
"status_code": 201,
"message": "success",
"data": {
"request": {
"order_no": "INV-2026-0001",
"merchant_id": "10001",
"cashierID": "0",
"amount": "150000",
"currency": "IDR",
"status": "Created"
},
"url": "https://pay.hashpay.io?key=...",
"key": "...",
"expired_at": 1821387856
}
}Field penting pada respons
| Field | Keterangan |
|---|---|
url | Halaman pembayaran (webview) siap dibuka untuk order ini — lihat Payment page. |
key | Kredensial scoped 30 menit yang sudah tertanam di url. Simpan di server; jangan tampilkan ke browser. |
Ambil order
POST
/merchant/fiat/getOrderBerguna untuk polling status dan rekonsiliasi. Header wajib: api-key.
bash
curl -X POST "$HASHPAY_BASE/merchant/fiat/getOrder" \
-H "api-key: $HASHPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"merchant_id": "10001",
"order_no": "INV-2026-0001"
}'Respons 200 (field penting)
{
"status_code": 200,
"message": "success",
"data": {
"order_no": "INV-2026-0001",
"merchant_id": "10001",
"status": "Success",
"currency": "IDR",
"tokenName": "USDT",
"network": "ETHEREUM",
"paid_amount": "5.616659",
"final_amount": "5.504335",
"merchant_received_amount": "5.504335",
"tx_hash": "0x...",
"link_explorer": "https://sepolia.etherscan.io/tx/0x...",
"isSettlement": false,
"nominalDetails": {
"nominalCrypto": "5.616659",
"fee": "0.112324",
"feeIsIncluded": true,
"finalAmount": "5.504335"
}
}
}| Field | Arti |
|---|---|
paid_amount | Jumlah crypto yang benar-benar diterima (termasuk kode unik) |
final_amount / merchant_received_amount | Penerimaan bersih Anda setelah fee |
feeIsIncluded | true = fee ditanggung penjual, false = ditanggung pembeli |
tx_hash / link_explorer | Bukti transaksi on-chain |
isSettlement | true bila dana sudah disapu ke wallet settlement |