PayHook Docs & Sandbox Docs & Sandbox
GitHub
PayHook Developer

Alternatif Payment Gateway GratisFree Payment Gateway Alternative

Ubah notifikasi pembayaran dari e-wallet & mobile banking menjadi webhook otomatis ke server Anda. Tanpa biaya transaksi, tanpa registrasi payment gateway. Turn payment notifications from e-wallets & mobile banking into automatic webhooks to your server. No transaction fees, no payment gateway registration.

๐Ÿ’ธ 0% Biaya0% Fees ๐Ÿ”’ 100% LokalLocal โšก Real-time Webhook ๐Ÿ‡ฎ๐Ÿ‡ฉ 30+ AplikasiApps

Tentang PayHookAbout PayHook

PayHook adalah aplikasi Android yang membaca notifikasi pembayaran masuk dari aplikasi e-wallet dan mobile banking, lalu mengirimkannya sebagai webhook JSON ke endpoint server yang Anda tentukan. Cocok untuk UMKM, toko online, aplikasi SaaS, dan sistem pencatatan keuangan yang butuh notifikasi pembayaran otomatis tanpa biaya payment gateway. PayHook is an Android app that reads incoming payment notifications from e-wallet and mobile banking apps, then delivers them as JSON webhooks to your server endpoint. Perfect for small businesses, online stores, SaaS apps, and bookkeeping systems that need automatic payment notifications without payment gateway fees.

Real-timeReal-time

Notifikasi ditangkap & diteruskan seketika saat dana masuk.Notifications captured & forwarded the moment funds arrive.

Privasi PenuhFull Privacy

Semua data disimpan lokal (SQLite). Tidak ada server perantara.All data stored locally (SQLite). No intermediary server.

Gratis SelamanyaFree Forever

Tanpa biaya transaksi, tanpa langganan. Dana langsung ke rekening Anda.No transaction fees, no subscription. Funds go straight to your account.

Bagaimana dana diterima?How are funds received? Pembayaran tetap masuk langsung ke rekening bank / e-wallet Anda seperti biasa. PayHook hanya membaca notifikasi dari aplikasi tersebut dan meneruskan datanya โ€” PayHook tidak menyentuh atau menahan dana Anda. Payments still go directly into your bank / e-wallet account as usual. PayHook only reads the notification from those apps and forwards the data โ€” PayHook never touches or holds your funds.

Alur KerjaHow It Works

Empat langkah dari pembayaran pelanggan hingga notifikasi diterima aplikasi Anda. Four steps from a customer payment to a notification landing in your app.

1. Pelanggan bayar QRIS / transfer 2. App bank/e-wallet notifikasi "dana masuk" 3. PayHook baca + ekstrak nominal 4. Server Anda webhook JSON (POST)
  1. Pelanggan melakukan pembayaranCustomer makes a payment ke QRIS / nomor rekening / e-wallet Anda seperti biasa. to your QRIS / bank account / e-wallet as usual.
  2. Aplikasi bank / e-wallet menampilkan notifikasiThe bank / e-wallet app shows a notification seperti “Rp 300.000 sudah masuk ke rekening Anda”. such as “Rp 300,000 has been credited to your account”.
  3. PayHook membaca notifikasiPayHook reads the notification , mencocokkan kata kunci pembayaran masuk, dan mengekstrak nominal beserta mata uangnya. , matches incoming-payment keywords, and extracts the amount and its currency.
  4. PayHook mengirim webhookPayHook sends a webhook berupa JSON via HTTP POST ke semua endpoint aktif secara paralel. as JSON via HTTP POST to all active endpoints in parallel.

Instalasi & PenggunaanInstall & Usage

Siapkan PayHook dalam beberapa menit. Set up PayHook in a few minutes.

  1. Pasang aplikasi PayHookInstall the PayHook app di perangkat Android (min. Android 8.0 / API 26) yang menerima notifikasi pembayaran Anda. Unduh dari Google Play (PayHook - Payment Webhook). on the Android device (min. Android 8.0 / API 26) that receives your payment notifications. Download it from Google Play (PayHook - Payment Webhook).
  2. Beri izin Akses NotifikasiGrant Notification Access saat diminta. Izin ini wajib agar PayHook dapat membaca notifikasi. when prompted. This permission is required for PayHook to read notifications.
  3. Pilih Aplikasi yang DipantauChoose Monitored Apps โ€” aktifkan e-wallet / bank yang ingin dipantau dari daftar aplikasi terpasang. โ€” enable the e-wallets / banks you want to monitor from your installed apps.
  4. Tambahkan WebhookAdd a Webhook dengan URL endpoint, tipe autentikasi, dan token (lihat bagian Konfigurasi). with your endpoint URL, auth type, and token (see the Configuration section).
  5. Uji dengan tombol TestTest with the Test button , atau gunakan Simulator di halaman ini, lalu lakukan transaksi kecil untuk verifikasi. , or use the Simulator on this page, then run a small transaction to verify.
Tips agar layanan tetap berjalanTips to keep the service running Nonaktifkan optimisasi baterai untuk PayHook dan izinkan berjalan di latar belakang, agar notifikasi tidak terlewat saat layar mati. Disable battery optimization for PayHook and allow background activity, so notifications are not missed when the screen is off.

Konfigurasi WebhookWebhook Configuration

Setiap webhook memiliki pengaturan berikut. Anda dapat menambahkan lebih dari satu endpoint โ€” semuanya menerima data secara bersamaan. Each webhook has the settings below. You can add more than one endpoint โ€” all of them receive data simultaneously.

KolomField KeteranganDescription
name Label webhook, mis. “Server Produksi”.Webhook label, e.g. “Production Server”.
url URL endpoint HTTPS yang menerima POST.HTTPS endpoint URL that receives the POST.
authType bearer ยท api_key ยท basic ยท none
authHeaderName Nama header untuk mode api_key (default X-API-Key).Header name for api_key mode (default X-API-Key).
token Token / kunci rahasia. Tersedia generator token di aplikasi.Token / secret key. A token generator is built into the app.
secretKey Opsional. Jika diisi, aktifkan tanda tangan HMAC-SHA256 (header X-Payhook-Signature). Lihat bagian Signature.Optional. If set, enables HMAC-SHA256 signing (X-Payhook-Signature header). See the Signature section.
isEnabled Aktif / nonaktif tanpa menghapus.Enable / disable without deleting.
Endpoint harus menggunakan HTTPS. PayHook menolak lalu lintas cleartext (HTTP biasa). Endpoints must use HTTPS. PayHook rejects cleartext (plain HTTP) traffic.

Aplikasi DidukungSupported Apps

PayHook dapat memantau notifikasi aplikasi apa pun yang Anda pilih. Berikut daftar yang umum digunakan & teruji. PayHook can monitor notifications from any app you choose. Below are the commonly used & tested ones.

E-Wallet

AplikasiApp Package Default
DANA com.dana.id AktifActive
GoPay (Gojek) com.gojek.app AktifActive
ShopeePay com.shopee.id AktifActive
OVO id.co.ovo.app AktifActive
LinkAja com.linkaja AktifActive
i.saku id.co.isaku AktifActive

Bank / Mobile Banking

AplikasiApp Package Default
BCA Mobile com.bca AktifActive
myBCA com.bca.myBCA AktifActive
BRImo id.co.bri.brimo AktifActive
BNI Mobile com.bni.mobilebanking AktifActive
wondr by BNI id.co.bni.wondr AktifActive
Livin' by Mandiri id.bmri.livin AktifActive
BSI Mobile com.bsi.universalbanking AktifActive
Jenius (BTPN) com.btpn.dc AktifActive
CIMB Niaga id.co.cimbniaga.mobile.android AktifActive
Bank Jago id.co.bankjago.app AktifActive
SeaBank id.co.seabank.app AktifActive
Bank Sumut id.mbank.sumut NonaktifInactive

Fitur v1.11Features (v1.11) GratisFree

Ringkasan semua fitur PayHook sampai versi 1.11. Semua gratis. Payload webhook kompatibel ke belakang: sejak v1.8 hanya bertambah field, tidak ada yang diubah atau dihapus, sehingga integrasi lama (termasuk payhook-laravel) tetap berjalan. A summary of every PayHook feature up to version 1.11. All free. The webhook payload is backward compatible: since v1.8 fields have only been added, never changed or removed, so existing integrations (including payhook-laravel) keep working.

Baru di v1.11New in v1.11

FiturFeature KegunaanWhat it does Lokasi di aplikasiWhere in the app
Mode SoundboxSoundbox Mode HP mengumumkan setiap uang masuk dengan suara ("Pembayaran diterima, dua puluh lima ribu rupiah") memakai text-to-speech bawaan Android, tanpa internet. Halaman Soundbox menampilkan layar LUNAS besar, total hari ini, dan layar tetap menyala. Bisa memilih aplikasi yang diumumkan dan nada sebelum suara. Nonaktif secara default; tetap bersuara walau aplikasi ditutup. Hanya uang masuk; notifikasi lebih dari 3 menit tidak diumumkan. Tidak membutuhkan webhook atau Telegram.The phone announces every incoming payment out loud ("Payment received, twenty five thousand rupiah") using Android's built-in text-to-speech, offline. The Soundbox page shows a big PAID screen, today's total, and keeps the screen on. Choose which apps are announced and a chime before the voice. Off by default; keeps speaking even when the app is closed. Incoming money only; notifications older than 3 minutes are not announced. No webhook or Telegram needed. Beranda โ†’ SoundboxHome โ†’ Soundbox
Peringatan kegagalanFailure alerts Tujuan Telegram dapat menerima peringatan โš ๏ธ saat webhook ke server gagal permanen (mis. 401/404) atau batas percobaan ulang habis: nama tujuan, nominal, error, waktu, dan ID event. Token bot disamarkan.A Telegram destination can receive a โš ๏ธ alert when a webhook to your server fails permanently (e.g. 401/404) or runs out of retries: destination name, amount, error, time, and event ID. The bot token is masked. Webhook โ†’ Edit tujuan Telegram โ†’ Peringatan kegagalanWebhook โ†’ Edit Telegram destination โ†’ Failure alerts
Tujuan paralel lebih amanSafer parallel destinations Jenis tujuan (Webhook/Telegram) dikunci saat edit agar konfigurasi tidak tertimpa. Untuk server dan Telegram sekaligus, buat dua tujuan; semua tujuan aktif dikirim paralel. Ada tombol Tambah Telegram di daftar dan Duplikat di layar edit (salinan dibuat nonaktif).The destination type (Webhook/Telegram) is locked while editing so settings are not overwritten. For a server and Telegram, create two destinations; all active destinations are sent in parallel. There is an Add Telegram button in the list and Duplicate on the edit screen (copies start disabled). WebhookWebhook

Pengiriman & tujuanDelivery & destinations

Routing & filterRouting & filters Pilih aplikasi sumber per tujuan (mis. BNI โ†’ HMS, DANA โ†’ POS), batas nominal min/maks (dalam mata uang buku kas), dan opsi teruskan uang keluar.Pick source apps per destination (e.g. BNI โ†’ HMS, DANA โ†’ POS), min/max amount (in the book currency), and optionally forward outgoing money. Webhook โ†’ Edit โ†’ Aturan PengirimanWebhook โ†’ Edit โ†’ Delivery Rules
Telegram Pesan pembayaran ke grup/chat Telegram tanpa server, dalam bahasa aplikasi.Payment messages to a Telegram group/chat without a server, in the app language. Lihat panduanSee guide
Kirim Test LiveSend Live Test Kirim hasil Uji Parser ke tujuan sungguhan dengan "is_test": true, lalu lihat kode HTTP, waktu respons, dan balasan server. Tidak dicatat ke Arus Kas maupun Log Aktivitas.Send a Parser Tester result to a real destination with "is_test": true and see the HTTP code, response time, and server reply. Not recorded in Cash Flow or the Activity Log. Pengaturan โ†’ Uji ParserSettings โ†’ Parser Tester
Multi heartbeatMultiple heartbeats Pantau beberapa server dari satu HP.Monitor several servers from one phone. Heartbeat MonitoringHeartbeat Monitoring

Deteksi notifikasiNotification detection

Mata uang & format angkaCurrency & number formats Mata uang dibaca otomatis dari kode ISO 4217 (USD, KES, โ€ฆ), simbol ($, โ‚ฌ, โ‚น, โ€ฆ), dan nama lokal (Ksh, Rs., เธšเธฒเธ—, โ€ฆ). Mendukung 1,234.56, 1.234,56, 1 234,56, 1,25,000, termasuk Rp 1,000 ala BNI, serta angka Arab/Thai/Devanagari. Nominal saldo dan biaya dilewati; tanpa penanda dipakai mata uang buku kas.Currency is detected from ISO 4217 codes (USD, KES, โ€ฆ), symbols ($, โ‚ฌ, โ‚น, โ€ฆ) and local names (Ksh, Rs., เธšเธฒเธ—, โ€ฆ). Supports 1,234.56, 1.234,56, 1 234,56, 1,25,000, BNI-style Rp 1,000, and Arabic/Thai/Devanagari digits. Balance and fee amounts are skipped; without a marker the book currency is used. OtomatisAutomatic
Kata kunci & penandaKeywords & markers Atur kata kunci uang masuk/keluar dan tambahkan penanda mata uang sendiri (mis. TSh โ†’ TZS). Format titik/koma bisa dipaksa per aplikasi.Edit incoming/outgoing keywords and add your own currency markers (e.g. TSh โ†’ TZS). Dot/comma format can be forced per app. Pengaturan โ†’ Kata Kunci Deteksi / Aplikasi TerpantauSettings โ†’ Detection Keywords / Monitored Apps
Uji ParserParser Tester Tempel teks notifikasi untuk melihat arah, nominal, mata uang (beserta penandanya), pengirim, dan tujuan yang akan menerima.Paste a notification to see direction, amount, currency (with its marker), sender, and which destinations would receive it. Pengaturan โ†’ Uji ParserSettings โ†’ Parser Tester
Log DiagnostikDiagnostics log Setiap notifikasi dari aplikasi terpantau tercatat beserta hasilnya (diproses / diabaikan + alasan), plus aplikasi belum terpantau yang mengirim nominal. Lokal, 7 hari; isi bernada OTP tidak disimpan.Every notification from monitored apps is logged with its outcome (processed / ignored + reason), plus unmonitored apps that send amounts. Local, 7 days; OTP-like content is not stored. Pengaturan โ†’ Log Diagnostik NotifikasiSettings โ†’ Notification Diagnostics Log

Buku kasCash book

Arus KasCash Flow Laporan uang masuk/keluar per hari/minggu/bulan. Akun & dompet (tunai, bank, e-wallet) dengan saldo berjalan, transfer antar akun, kategori berikon, cari & filter. Total dihitung dalam mata uang buku kas. Data hanya di HP dan tidak dihapus otomatis.Income/expense report by day/week/month. Accounts & wallets (cash, bank, e-wallet) with running balances, transfers between accounts, icon categories, search & filters. Totals use the book currency. Data stays on the phone and is not auto-deleted. Beranda โ†’ Arus kasHome โ†’ Cash flow
Ekspor ExcelExcel export File .xlsx dengan sheet Transaksi (termasuk kolom Mata Uang, baris total, header beku & filter) dan sheet Ringkasan. Header ikut bahasa aplikasi.An .xlsx file with a Transactions sheet (including a Currency column, totals row, frozen header & filters) and a Summary sheet. Headers follow the app language. Arus Kas โ†’ โ‹ฎ โ†’ EksporCash Flow โ†’ โ‹ฎ โ†’ Export
Rekap harianDaily recap Notifikasi ringkasan harian pada jam & menit pilihan (opsional).Daily summary notification at a chosen hour & minute (opt-in). Pengaturan โ†’ Rekap harianSettings โ†’ Daily recap

Keandalan, keamanan & tampilanReliability, security & display

Kesehatan perangkatDevice health Cek akses notifikasi, status listener nyata (Listener Terputus), optimasi baterai, penghemat data, autostart, serta panduan khusus Xiaomi, Oppo/Realme/OnePlus, Vivo, Infinix/Tecno.Checks notification access, real listener status (Listener Disconnected), battery optimization, data saver, autostart, plus brand guides for Xiaomi, Oppo/Realme/OnePlus, Vivo, Infinix/Tecno. Beranda โ†’ Cek HPHome โ†’ Check
Backup & pindah HPBackup & device transfer Konfigurasi, akun, kategori, dan pengaturan Soundbox dienkripsi AES-256 (password) ke file atau QR.Configuration, accounts, categories, and Soundbox settings encrypted with AES-256 (password) to a file or QR code. Pengaturan โ†’ Backup & Pindah HPSettings โ†’ Backup & Transfer
Widget & kunci aplikasiWidget & app lock Widget status + transaksi terakhir; kunci aplikasi dengan PIN/sidik jari.Status + last transaction widget; lock the app with PIN/biometrics. Pengaturan โ†’ Privasi & KunciSettings โ†’ Privacy & Lock
Dua bahasaTwo languages Indonesia dan English, default mengikuti bahasa HP. Notifikasi, widget, rekap, pesan Telegram, suara Soundbox, dan Excel ikut bahasa aplikasi.Indonesian and English, defaulting to the phone language. Notifications, widget, recap, Telegram messages, Soundbox voice, and Excel follow the app language. Pengaturan โ†’ BahasaSettings โ†’ Language
Untuk server: v1.11 tidak mengubah payload. amount tetap bilangan bulat; untuk mata uang selain Rupiah atau nominal bersen, baca currency dan amount_decimal (v1.10+). Field payer/recipient tersedia sejak v1.8. Lihat Format Payload; paket payhook-laravel v1.1 menyediakan $payment->currency dan $payment->amountDecimal. For servers: v1.11 does not change the payload. amount stays an integer; for non-Rupiah currencies or amounts with cents, read currency and amount_decimal (v1.10+). payer/recipient fields exist since v1.8. See Payload Format; the payhook-laravel v1.1 package exposes $payment->currency and $payment->amountDecimal.

Tujuan TelegramTelegram Destination

Tidak punya server? PayHook bisa langsung mengirim pesan ke grup atau chat Telegram setiap ada pembayaran masuk. Cocok untuk pemilik usaha yang ingin tahu pembayaran di kasir dari mana saja. No server? PayHook can message a Telegram group or chat for every incoming payment โ€” handy for owners who want to see cashier payments from anywhere.

  1. Di Telegram, chat @BotFather โ†’ /newbot โ†’ salin token bot.In Telegram, chat @BotFather โ†’ /newbot โ†’ copy the bot token.
  2. Tambahkan bot ke grup usaha Anda (atau chat bot langsung), lalu kirim pesan apa saja.Add the bot to your business group (or chat it directly), then send any message.
  3. Buka https://api.telegram.org/bot<TOKEN>/getUpdates di browser dan salin nilai "chat":{"id":โ€ฆ}. ID grup biasanya diawali tanda minus.Open https://api.telegram.org/bot<TOKEN>/getUpdates and copy "chat":{"id":โ€ฆ}. Group IDs usually start with a minus sign.
  4. Di PayHook: Webhook โ†’ Tambah โ†’ Jenis Tujuan: Telegram, isi token & Chat ID, tekan Kirim Pesan Tes.In PayHook: Webhook โ†’ Add โ†’ Destination: Telegram, fill token & Chat ID, tap Send Test Message.

Server dan Telegram sekaligus: satu tujuan hanya satu jenis. Buat tujuan Webhook untuk server dan tujuan Telegram terpisah; semua tujuan aktif menerima setiap pembayaran secara paralel. Telegram juga bisa dipakai sendiri tanpa server. Server and Telegram together: each destination has one type. Create a Webhook destination for your server and a separate Telegram destination; every active destination receives each payment in parallel. Telegram also works on its own without a server.

Peringatan kegagalan (v1.11): aktifkan pada tujuan Telegram agar menerima pesan โš ๏ธ bila webhook ke server gagal permanen atau batas percobaan ulang habis. Failure alerts (v1.11): enable on a Telegram destination to get a โš ๏ธ message when a webhook to your server fails permanently or runs out of retries.

๐Ÿ’ฐ Pembayaran Masuk
Rp 25.000
Dari: GOPAY
Sumber: BNI Merchant
Waktu: 30/10/2026 18:24
ID: evt_1793359440000_a1b2c3
PrivasiPrivacy Pesan dikirim sebagai teks biasa lewat server Telegram. Isi notifikasi lengkap tidak ikut dikirim โ€” hanya nominal, pengirim, sumber, waktu, dan ID. Token bot disamarkan di log aplikasi. Telegram ikut antrean retry yang sama dengan webhook. Messages are sent as plain text via Telegram servers. The full notification text is not included โ€” only amount, sender, source, time, and ID. The bot token is masked in the app logs. Telegram uses the same retry queue as webhooks.

Format PayloadPayload Format

PayHook mengirim HTTP POST dengan body JSON berikut ke endpoint Anda. PayHook sends an HTTP POST with the following JSON body to your endpoint.

Request Headers

POST /your-endpoint HTTP/1.1
Content-Type: application/json
Accept: application/json
User-Agent: PayHook-Android/1.10.0
Authorization: Bearer <token>          # tergantung tipe auth / depends on auth type
X-Payhook-Timestamp: 1752300000         # jika HMAC diaktifkan / if HMAC enabled
X-Payhook-Nonce: 9f2c...                 # jika HMAC diaktifkan / if HMAC enabled
X-Payhook-Signature: sha256=<hmac>   # jika HMAC diaktifkan / if HMAC enabled

Body (JSON)

{
  "event_id": "evt_1752300000000_a1b2c3",
  "event_type": "payment.incoming",
  "direction": "in",
  "amount": 300000,
  "source": "BCA Mobile",
  "payer": "JOHN",
  "reference": "PH-1711425600000",
  "timestamp": "2026-03-26 10:26:00",
  "timestamp_ms": 1774495560000,
  "package_name": "com.bca",
  "notification_title": "Uang masuk dari John",
  "notification_text": "Rp 300.000,00 sudah masuk dari JOHN ke rekening Anda",
  "sent_by": "PayHook",
  "currency": "IDR",
  "amount_decimal": 300000
}

Sejak v1.8, uang keluar dapat ikut diteruskan (opsional per webhook, menu Teruskan juga uang keluar). Bentuknya sama dengan event_type payment.outgoing dan field recipient menggantikan payer: Since v1.8, outgoing money can optionally be forwarded too (per webhook, Also forward outgoing money). Same shape with event_type payment.outgoing, and recipient instead of payer:

{
  "event_id": "evt_1752300100000_d4e5f6",
  "event_type": "payment.outgoing",
  "direction": "out",
  "amount": 150000,
  "source": "BCA Mobile",
  "recipient": "PLN PRABAYAR",
  ...
}
Field Type KeteranganDescription
event_id string ID unik & stabil per event. Pakai sebagai idempotency key (upsert) agar transaksi tidak dobel walau webhook dikirim ulang.Unique & stable per event. Use it as an idempotency key (upsert) so retries never create duplicates.
event_type string Jenis event, mis. payment.incoming.Event type, e.g. payment.incoming.
direction string in (uang masuk) atau out (uang keluar). v1.8+in (incoming) or out (outgoing). v1.8+
amount number (long) Nominal, bilangan bulat tanpa desimal (bagian bulat; $12.50 โ†’ 12). Sebelum v1.10 selalu Rupiah.Amount as an integer without decimals (whole part; $12.50 โ†’ 12). Always Rupiah before v1.10.
source string Nama aplikasi sumber, mis. “BCA Mobile”.Source app name, e.g. “BCA Mobile”.
payer / recipient string Pengirim (uang masuk) atau penerima (uang keluar) yang dibaca dari teks notifikasi, mis. “GOPAY”. Best effort โ€” bisa kosong. v1.8+Sender (incoming) or recipient (outgoing) read from the notification text, e.g. “GOPAY”. Best effort โ€” may be empty. v1.8+
reference string ID unik format PH-{epoch_millis}.Unique ID in PH-{epoch_millis} format.
timestamp string Waktu deteksi, format yyyy-MM-dd HH:mm:ss (waktu perangkat).Detection time, yyyy-MM-dd HH:mm:ss (device local time).
timestamp_ms number (long) Waktu deteksi dalam epoch milidetik (tanpa ambiguitas zona waktu). v1.8+Detection time in epoch milliseconds (no timezone ambiguity). v1.8+
package_name string Nama package Android aplikasi sumber.Android package name of the source app.
notification_title string Judul notifikasi asli.Original notification title.
notification_text string Isi teks notifikasi asli.Original notification text body.
sent_by string Selalu bernilai "PayHook".Always "PayHook".
currency string Kode mata uang ISO 4217, mis. IDR, USD, KES. Dari penanda di notifikasi; tanpa penanda = mata uang buku kas. Bila field ini tidak ada (PayHook < v1.10), anggap IDR. v1.10+ISO 4217 currency code, e.g. IDR, USD, KES. From the marker in the notification; no marker = the book currency. If the field is missing (PayHook < v1.10), assume IDR. v1.10+
amount_decimal number Nominal persis termasuk sen, mis. 12.5 untuk $12.50 (maks. 2 desimal). Untuk Rupiah sama dengan amount. Baca sebagai desimal, bukan float, bila menghitung uang. v1.10+Exact amount including cents, e.g. 12.5 for $12.50 (max. 2 decimals). Equal to amount for Rupiah. Parse it as a decimal, not a float, when doing money math. v1.10+
is_test boolean Hanya ada (bernilai true) saat tombol Test Webhook atau Kirim Test Live (Uji Parser, v1.9) ditekan. Abaikan untuk pencocokan invoice. v1.8+Only present (true) when the Test Webhook or Send Live Test (Parser Tester, v1.9) button is used. Ignore it for invoice matching. v1.8+
Respons yang diharapkanExpected response Balas dengan status 2xx agar dianggap sukses. Status lain (4xx/5xx) atau timeout (>15 detik) dicatat sebagai gagal di log aktivitas aplikasi. Reply with a 2xx status to be counted as success. Other statuses (4xx/5xx) or a timeout (>15s) are logged as failed in the app's activity log.
Retry & redirectRetry & redirect 5xx, 429, dan gangguan jaringan dicoba ulang otomatis (backoff hingga 8 kali) dengan event_id yang sama. 4xx lainnya dianggap gagal permanen. Sejak v1.8 PayHook tidak mengikuti redirect (3xx) agar token tidak terkirim ke host lain โ€” gunakan URL final (mis. tanpa redirect http→https atau garis miring). 5xx, 429, and network errors are retried automatically (backoff up to 8 times) with the same event_id. Other 4xx are permanent failures. Since v1.8 PayHook does not follow redirects (3xx) so tokens never leak to another host โ€” use the final URL.

Autentikasi & VerifikasiAuth & Verification

PayHook mendukung 4 tipe autentikasi yang dikirim sebagai header HTTP. PayHook supports 4 authentication types, sent as HTTP headers.

authType Header ContohExample
bearer Authorization Bearer <token>
api_key X-API-Key (atau kustom)(or custom) <token>
basic Authorization Basic base64(<token>)
none โ€” Tanpa autentikasiNo authentication
Verifikasi di sisi serverVerify on your server Selalu validasi header autentikasi pada setiap request masuk dan tolak jika token tidak cocok. Gunakan HTTPS dan jangan pernah menaruh token di URL. Always validate the auth header on every incoming request and reject mismatched tokens. Use HTTPS and never put the token in the URL.

Signature (HMAC)Signature (HMAC)

Untuk keamanan tingkat produksi, isi Secret Key pada webhook di aplikasi PayHook. Jika diisi, PayHook menandatangani setiap request dengan HMAC-SHA256 sehingga server Anda bisa memastikan request benar-benar dari PayHook (anti-spoofing) dan bukan kiriman ulang lama (anti-replay). For production-grade security, set a Secret Key on the webhook in the PayHook app. When set, PayHook signs every request with HMAC-SHA256 so your server can verify the request truly comes from PayHook (anti-spoofing) and is not an old replay (anti-replay).

Header KeteranganDescription
X-Payhook-Timestamp Epoch detik saat request dibuat.Epoch seconds when the request was created.
X-Payhook-Nonce Nilai acak sekali pakai.Single-use random value.
X-Payhook-Signature sha256=<hex> โ€” HMAC-SHA256 dariof "{timestamp}.{raw_body}"
Nilai yang ditandatangani adalah "{timestamp}.{body_json_mentah}". Verifikasi memakai raw body (sebelum di-parse) agar hash sama persis. The signed value is "{timestamp}.{raw_json_body}". Verify using the raw body (before parsing) so the hash matches exactly.

Contoh VerifikasiVerification Example

<?php
$secret = 'YOUR_SECRET_KEY';
$raw = file_get_contents('php://input');
$ts  = $_SERVER['HTTP_X_PAYHOOK_TIMESTAMP'] ?? '';
$sig = $_SERVER['HTTP_X_PAYHOOK_SIGNATURE'] ?? '';

// Tolak jika timestamp terlalu lama (anti-replay), mis. > 5 menit
if (abs(time() - (int)$ts) > 300) { http_response_code(408); exit; }

$expected = 'sha256=' . hash_hmac('sha256', $ts . '.' . $raw, $secret);
if (!hash_equals($expected, $sig)) { http_response_code(401); exit; }

$data = json_decode($raw, true);
// upsert berdasarkan $data['event_id'] (idempoten)
http_response_code(200);
const crypto = require('crypto');
// Pakai raw body: app.use(express.raw({ type: 'application/json' }))
app.post('/payhook', (req, res) => {
  const secret = process.env.PAYHOOK_SECRET;
  const ts  = req.header('X-Payhook-Timestamp') || '';
  const sig = req.header('X-Payhook-Signature') || '';
  const raw = req.body.toString('utf8');

  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300)
    return res.sendStatus(408); // anti-replay

  const expected = 'sha256=' +
    crypto.createHmac('sha256', secret).update(ts + '.' + raw).digest('hex');
  const ok = sig.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected));
  if (!ok) return res.sendStatus(401);

  const data = JSON.parse(raw);
  // upsert by data.event_id (idempotent)
  res.sendStatus(200);
});
Idempotency & RetryIdempotency & Retry Bila pengiriman gagal karena jaringan/timeout/5xx, PayHook menyimpannya di antrean lokal dan mengirim ulang otomatis (exponential backoff). Karena event_id tetap sama pada retry, gunakan sebagai kunci upsert agar tidak ada transaksi ganda. If delivery fails due to network/timeout/5xx, PayHook stores it in a local queue and retries automatically (exponential backoff). Since the event_id stays the same across retries, use it as an upsert key to avoid duplicate transactions.

Heartbeat MonitoringHeartbeat Monitoring OpsionalOptional

Deteksi otomatis saat HP PayHook mati / offline / kuota habis, sebelum ada komplain pelanggan. Automatically detect when the PayHook phone is off / offline / out of data, before customers complain.

PayHook dapat mengirim ping status berkala ke endpoint monitoring terpisah milik Anda. Jika backend tidak menerima heartbeat dalam batas waktu tertentu, tandai perangkat sebagai offline dan kirim peringatan (WhatsApp/Telegram/email). Fitur ini opsional โ€” atur di aplikasi: Pengaturan โ†’ Heartbeat Monitoring. Jika tidak diisi, alur webhook transaksi tetap berjalan seperti biasa (kompatibel mundur). PayHook can send a periodic status ping to a separate monitoring endpoint you own. If your backend does not receive a heartbeat within a threshold, mark the device offline and send an alert (WhatsApp/Telegram/email). This feature is optional โ€” configure it in the app under Settings โ†’ Heartbeat Monitoring. If left empty, the transaction webhook flow keeps working as before (backward compatible).

Multi heartbeat (v1.8)Multiple heartbeats (v1.8) Satu HP PayHook kini dapat mengirim heartbeat ke beberapa server sekaligus (mis. HMS dan POS), masing-masing dengan URL, token, secret, dan interval sendiri. Jika satu server tidak merespons 2x berturut, aplikasi menampilkan peringatan khusus untuk server tersebut. Pengaturan lama otomatis dipindahkan menjadi tujuan “Heartbeat Utama”. One PayHook phone can now send heartbeats to several servers at once (e.g. HMS and POS), each with its own URL, token, secret, and interval. If a server fails twice in a row, the app shows an alert for that server only. The old setting is migrated to a “Heartbeat Utama” target automatically.

Contoh Payload HeartbeatHeartbeat Payload Example

POST /payhook/heartbeat
Content-Type: application/json
Authorization: Bearer <token>      # jika token diisi / if token set
X-Payhook-Timestamp: 1752300000        # jika secret diisi / if secret set
X-Payhook-Nonce: 9f2c...               # jika secret diisi / if secret set (v1.8+)
X-Payhook-Signature: sha256=<hmac>  # jika secret diisi / if secret set

{
  "type": "heartbeat",
  "device_id": "ph-a1b2c3d4e5f6",
  "app_version": "1.10.0",
  "listener_connected": true,
  "battery_optimized": false,
  "last_event_at": 1752299880000,
  "sent_at": 1752300000000
}
Field KeteranganDescription
device_id ID unik perangkat.Unique device id.
app_version Versi aplikasi PayHook.PayHook app version.
listener_connected Status listener notifikasi.Notification listener status.
battery_optimized true = optimisasi baterai masih aktif (berisiko).true = battery optimization still on (risky).
last_event_at Epoch ms pembayaran terakhir terdeteksi.Epoch ms of last detected payment.
sent_at Epoch ms saat heartbeat dikirim.Epoch ms when heartbeat was sent.
Aturan monitoring yang disarankanSuggested monitoring rules Interval kirim 60โ€“300 detik. Jika tidak ada heartbeat > 2โ€“3ร— interval, anggap offline. Gunakan grace period โ€” jangan alert hanya dari satu heartbeat yang meleset โ€” untuk menghindari false alarm. Send every 60โ€“300s. If no heartbeat arrives for > 2โ€“3ร— the interval, treat it as offline. Use a grace period โ€” do not alert on a single missed heartbeat โ€” to avoid false alarms.

Contoh IntegrasiIntegration Examples

Contoh menerima & memverifikasi webhook PayHook di berbagai bahasa. Examples of receiving & verifying a PayHook webhook in several languages.

<?php
// webhook.php โ€” endpoint penerima PayHook
$expected = 'YOUR_SECRET_TOKEN';
$auth = $_SERVER['HTTP_AUTHORIZATION'] ?? '';

if ($auth !== 'Bearer ' . $expected) {
    http_response_code(401);
    exit(json_encode(['error' => 'Unauthorized']));
}

$payload = json_decode(file_get_contents('php://input'), true);
if (!$payload) { http_response_code(400); exit; }

// Idempotent upsert by event_id
$eventId = $payload['event_id'] ?? '';
if ($eventId === '') { http_response_code(422); exit(json_encode(['error' => 'Missing event_id'])); }

// Simpan pembayaran
file_put_contents('payments.log',
    sprintf("[%s] %s Rp%s event_id=%s ref=%s\n",
        $payload['timestamp'], $payload['source'],
        number_format($payload['amount'], 0, ',', '.'),
        $eventId,
        $payload['reference']
    ), FILE_APPEND);

http_response_code(200);
echo json_encode(['status' => 'ok']);

Lebih praktis: gunakan paket resmi darmariduan/payhook-laravel yang sudah menangani HMAC, anti-replay, dan idempotensi. Contoh manual:Easier: use the official darmariduan/payhook-laravel package, which already handles HMAC, anti-replay, and idempotency. Manual example:

// routes/api.php
Route::post('/payhook', function (Illuminate\Http\Request $request) {
    if ($request->bearerToken() !== config('services.payhook.token')) {
        return response()->json(['error' => 'Unauthorized'], 401);
    }

    $data = $request->validate([
        'event_id'  => 'required|string',
        'amount'    => 'required|integer',
        'source'    => 'required|string',
        'reference' => 'required|string',
        'timestamp' => 'required|string',
    ]);

    Payment::updateOrCreate(
        ['event_id' => $data['event_id']], // idempoten
        ['amount' => $data['amount'], 'source' => $data['source'], 'reference' => $data['reference']]
    );

    return response()->json(['status' => 'ok']);
});
// server.js โ€” Express
const express = require('express');
const app = express();
app.use(express.json());

const TOKEN = process.env.PAYHOOK_TOKEN;

app.post('/payhook', (req, res) => {
  if (req.headers.authorization !== `Bearer ${TOKEN}`) {
    return res.status(401).json({ error: 'Unauthorized' });
  }

    const { event_id, amount, source, reference, timestamp } = req.body;
    console.log(`[${timestamp}] ${source} Rp${amount} event_id=${event_id} ref=${reference}`);

    // TODO: simpan ke database (idempoten berdasarkan event_id)
  res.json({ status: 'ok' });
});

app.listen(3000, () => console.log('PayHook listener on :3000'));
# app.py โ€” Flask
import os
from flask import Flask, request, jsonify

app = Flask(__name__)
TOKEN = os.environ["PAYHOOK_TOKEN"]

@app.post("/payhook")
def payhook():
    if request.headers.get("Authorization") != f"Bearer {TOKEN}":
        return jsonify(error="Unauthorized"), 401

        data = request.get_json(silent=True) or {}
    print(f"[{data.get('timestamp')}] {data.get('source')} "
            f"Rp{data.get('amount')} event_id={data.get('event_id')} "
            f"ref={data.get('reference')}")

    # TODO: simpan ke DB (idempoten berdasarkan event_id)
    return jsonify(status="ok")

if __name__ == "__main__":
    app.run(port=3000)

Paket LaravelLaravel Package

darmariduan/payhook-laravel menangani seluruh sisi server: verifikasi token & HMAC, anti-replay, idempotensi event_id, dan event Laravel yang siap pakai. darmariduan/payhook-laravel handles the whole server side: token & HMAC verification, anti-replay, event_id idempotency, and ready-to-use Laravel events.

composer require darmariduan/payhook-laravel

# .env โ€” sama dengan pengaturan webhook di aplikasi / same as the app webhook settings
PAYHOOK_TOKEN=token-bearer
PAYHOOK_SECRET=secret-hmac

URL webhook di aplikasi: https://domain-anda.com/payhook/webhook, heartbeat: https://domain-anda.com/payhook/heartbeat. Webhook URL in the app: https://your-domain.com/payhook/webhook, heartbeat: https://your-domain.com/payhook/heartbeat.

use Illuminate\Support\Facades\Event;
use PayHook\Laravel\Events\PaymentReceived;
use PayHook\Laravel\Facades\PayHook;

// Buat invoice dengan nominal unik / create an invoice with a unique amount
$total = PayHook::uniqueAmount(100000, fn (int $a) =>
    Invoice::where('unique_total', $a)->where('status', 'unpaid')->exists());

// Dipanggil sekali per event_id, aman untuk retry / called once per event_id
// Tombol "Test Webhook" tidak memicu event (default) / test webhooks are ignored by default
Event::listen(function (PaymentReceived $e) {
    Invoice::where('unique_total', $e->payment->amount)
        ->where('status', 'unpaid')->first()?->update(['status' => 'paid']);

    // v1.1: $e->payment->currency ("IDR", "USD", โ€ฆ), $e->payment->amountDecimal ("12.5")
});

PayHook::isOnline('ph-a1b2c3d4e5f6'); // status heartbeat perangkat
CatatanNotes Heartbeat di aplikasi selalu memakai Bearer token โ€” isi token di tujuan heartbeat (atau atur PAYHOOK_HEARTBEAT_TOKEN bila webhook memakai API Key/Basic). Beri unique index pada kolom nominal unik invoice yang belum dibayar agar dua invoice tidak mendapat nominal yang sama. Heartbeats from the app always use a Bearer token โ€” fill the token on the heartbeat target (or set PAYHOOK_HEARTBEAT_TOKEN if your webhook uses API Key/Basic). Add a unique index on the unique-amount column of unpaid invoices so two invoices never share an amount.

Dokumentasi lengkap & kode sumber: Full documentation & source code: github.com/darmariduan/payhook-laravel ยท Packagist

Simulator / SandboxSimulator / Sandbox

Susun payload PayHook (payment/heartbeat), salin sebagai cURL/kode, atau kirim uji coba langsung ke endpoint Anda โ€” tanpa perlu transaksi sungguhan. Build PayHook payloads (payment/heartbeat), copy them as cURL/code, or send a live test to your endpoint โ€” without any real transaction.

Otomatis terisi sesuai sumber & nominal. Bisa Anda ubah.Auto-filled from source & amount. You can edit it.

Jika diisi, simulator menambahkan header X-Payhook-Timestamp, X-Payhook-Nonce, dan X-Payhook-Signature.If set, simulator adds X-Payhook-Timestamp, X-Payhook-Nonce, and X-Payhook-Signature headers.
B
Uang masuk dari John
Rp 300.000,00 sudah masuk ke rekening Anda
BCA Mobile

Payload JSONJSON Payload

// klik "Buat Payload"
Tentang mode “Kirim Test (Live)”About “Send Test (Live)” mode Simulator akan mencoba kirim langsung dari browser terlebih dulu. Jika endpoint Anda memblokir CORS, gunakan relay serverless (isi PAYHOOK_RELAY_URL di bawah) atau tombol Salin cURL. The simulator first tries direct browser delivery. If your endpoint blocks CORS, use the serverless relay (set PAYHOOK_RELAY_URL below) or use Copy cURL.

FAQ & Pemecahan MasalahTroubleshooting

Webhook tidak terkirim, kenapa?Webhook not being sent, why?

Pastikan izin Akses Notifikasi aktif, aplikasi sumber ada di daftar dipantau, optimisasi baterai dinonaktifkan, dan URL endpoint menggunakan HTTPS yang valid. Cek log aktivitas di aplikasi untuk kode HTTP respons. Ensure Notification Access is granted, the source app is in the monitored list, battery optimization is disabled, and the endpoint URL is valid HTTPS. Check the in-app activity log for the response HTTP code.

Pembayaran muncul di notifikasi HP tapi tidak tertangkap?Payment shows in the phone's notifications but isn't captured?

Buka Pengaturan โ†’ Log Diagnostik Notifikasi (v1.9): Open Settings โ†’ Notification Diagnostics Log (v1.9):

  • Notifikasi tidak ada di log sama sekali โ†’ PayHook tidak menerimanya dari sistem. Matikan lalu nyalakan lagi Akses notifikasi PayHook, izinkan autostart & tanpa batasan baterai (lihat panduan merek HP di Kesehatan Perangkat), dan kunci PayHook di Recent Apps. Umum terjadi di Realme/Oppo/Vivo/Xiaomi. Not in the log at all โ†’ PayHook never received it from the system. Toggle PayHook's Notification access off and on, allow autostart and unrestricted battery (see the brand guide in Device Health), and lock PayHook in Recent Apps. Common on Realme/Oppo/Vivo/Xiaomi.
  • Tercatat "Belum dipantau" โ†’ aplikasi pengirim berbeda dari yang Anda pantau (mis. aplikasi Shopee untuk penjual/merchant โ‰  aplikasi Shopee biasa). Tambahkan aplikasi tersebut di Aplikasi Terpantau. Logged as "Not monitored" โ†’ the sending app differs from the one you monitor (e.g. Shopee's seller/merchant app โ‰  the regular Shopee app). Add that app in Monitored Apps.
  • Tercatat "Diabaikan" โ†’ baca alasannya (kata kunci / nominal tidak ditemukan), lalu tekan Uji di Parser untuk mencoba kata kunci atau format nominal. Logged as "Ignored" โ†’ read the reason (no keyword / no amount), then tap Test in Parser to try keywords or the number format.
  • Aplikasi kloning (App Clone / Dual Apps / Ruang Kedua) tidak dapat dibaca dari profil utama โ€” gunakan aplikasi bank/e-wallet versi utama di HP yang menjalankan PayHook. Cloned apps (App Clone / Dual Apps / Second Space) cannot be read from the main profile โ€” use the primary bank/e-wallet app on the phone running PayHook.

Nominal terbaca salah / kosong?Amount parsed wrong / empty?

PayHook mengekstrak angka dari teks notifikasi (mis. Rp 300.000, Rp 1,000, IDR 300,000.00). Gunakan Pengaturan โ†’ Uji Parser untuk melihat hasilnya. Jika nominal salah, atur Format nominal aplikasi tersebut di Aplikasi Terpantau. Jika notifikasi diabaikan, tambahkan kata kunci di Kata Kunci Deteksi. Pengguna BNI Merchant: perbarui ke v1.8 (perbaikan Rp 1,000 terbaca Rp 1). PayHook extracts numbers from the notification text (e.g. Rp 300.000, Rp 1,000, IDR 300,000.00). Use Settings โ†’ Parser Tester to see the result. If the amount is wrong, set the app's Number format in Monitored Apps. If the notification is ignored, add a keyword in Detection Keywords. BNI Merchant users: update to v1.8 (fixes Rp 1,000 read as Rp 1).

Bagaimana menghindari data ganda?How to avoid duplicate data?

Gunakan field event_id sebagai kunci idempoten saat menyimpan ke database. Nilai ini tetap sama saat retry, sehingga aman untuk mekanisme upsert dan mencegah transaksi ganda. Use the event_id field as your idempotency key when saving to the database. It stays stable across retries, making upsert safe and preventing duplicates.

Apakah aman untuk produksi?Is it production-safe?

PayHook cocok untuk volume kecilโ€“menengah. Untuk keandalan tinggi, gunakan perangkat khusus yang selalu online, dan verifikasi pembayaran penting secara manual atau via mutasi rekening. PayHook suits smallโ€“medium volume. For high reliability, use a dedicated always-online device, and verify important payments manually or via account statements.