Get payout information
Last updated:
The getPayout method returns the current state of a payout you previously created with createPayout: status, settled amount, fee, currency, and timestamps. Use it to reconcile when callbacks were missed, to display payout state to operators, or to retry decisions after a network blip.
Endpoint
Send the request to https://api.unitpay.net/api. POST over TLS is required — GET is rejected to keep the secret key out of URL logs.
Required parameters
| Parameter | Type | Description |
|---|---|---|
method | string | Always getPayout. |
params[payoutId] | integer | UnitPay's payout identifier returned by createPayout. |
params[secretKey] | string | Project secret key. Send only via TLS in the POST body. |
Optional parameters
| Parameter | Type | Description |
|---|---|---|
params[merchantPayoutId] | string | Look up by your idempotency key instead of payoutId. Useful when your system stored the merchant key but lost the UnitPay ID. |
Either params[payoutId] or params[merchantPayoutId] must be present — not both.
Example request
POST https://api.unitpay.net/api
Content-Type: application/x-www-form-urlencoded
method=getPayout
¶ms[payoutId]=9871234
¶ms[secretKey]=<your-project-secret-key>
Successful response
{
"result": {
"payoutId": 9871234,
"merchantPayoutId": "settlement-9821",
"status": "success",
"sum": 1500000.00,
"fee": 5500.00,
"currency": "IDR",
"paymentType": "bank_idr",
"account": "1234567890",
"recipientBankCode": "014",
"purpose": "Marketplace settlement order #9821",
"createdDate": "2026-05-08T14:22:11+07:00",
"completedDate": "2026-05-08T14:23:47+07:00"
}
}
| Field | Description |
|---|---|
status | One of new, pending_review, in_progress, success, or error. See the table below. |
sum | Payout amount, identical to the params[sum] originally submitted. |
fee | Destination-rail fee debited from your balance, in the same currency as sum. |
account | Destination identifier, masked according to the rail's policy (cards return only the last 4 digits). |
completedDate | ISO 8601 timestamp of final state. Absent until status is success or error. |
Status values
| Status | Meaning | Terminal? |
|---|---|---|
new | Accepted by UnitPay, not yet submitted to the destination rail. Typically observed for under a minute. | No |
pending_review | Awaiting manual operator approval per project policy. Operators act in the merchant cabinet. | No |
in_progress | Submitted to the destination rail; awaiting confirmation. Card and SWIFT payouts can sit here for hours during banking-hour cutover. | No |
success | Settled to the beneficiary. Funds have left UnitPay's correspondent account. | Yes |
error | Rejected by the destination rail (closed account, insufficient KYC at the bank, blocked card). Funds are returned to your merchant balance net of any non-refundable rail fees. | Yes |
Error response
{
"error": {
"message": "Payout not found.",
"code": -32001
}
}
| code | Meaning |
|---|---|
-32000 | Invalid secret key. Rotate from Settings → Project → Secret key. |
-32001 | Payout not found. Verify the ID belongs to a payout on the project that owns this secret key. |
-32006 | Both payoutId and merchantPayoutId were sent, or neither was sent. |
Polling and event-driven retrieval
Prefer the callback handler — the same handler that receives payment lifecycle events also receives payoutStatus events for state changes (new → in_progress → success or → error). Reuse signature verification.
If you must poll, follow these limits:
- No more than once every 30 seconds per payout while
statusis non-terminal. - Stop polling as soon as
statusissuccessorerror; the result will not change. - Per-project rate limit applies to all
getPayoutcalls combined — 600 requests/min, beyond which UnitPay returns HTTP 429.
Test mode
Test-mode payouts use the project's test secret key and complete to success within seconds — useful for end-to-end validation of your reconciliation logic before going live.
Next steps
- Create a payout — the upstream method that produces the
payoutIdyou query here. - Callback handler — receive payout state changes asynchronously instead of polling.
- Look up card information by BIN — resolve a destination card's brand, type, country, and issuing bank.
Metode getPayout mengembalikan status terkini pencairan yang sebelumnya Anda buat dengan createPayout: status, jumlah yang diselesaikan, biaya, mata uang, dan cap waktu. Gunakan untuk merekonsiliasi ketika callback terlewat, untuk menampilkan status pencairan kepada operator, atau untuk keputusan retry setelah gangguan jaringan.
Endpoint
Kirim permintaan ke https://api.unitpay.net/api. POST melalui TLS wajib digunakan — GET ditolak agar kunci rahasia tidak masuk ke log URL.
Parameter wajib
| Parameter | Tipe | Deskripsi |
|---|---|---|
method | string | Selalu getPayout. |
params[payoutId] | integer | Identifikasi pencairan dari UnitPay yang dikembalikan oleh createPayout. |
params[secretKey] | string | Kunci rahasia proyek. Kirim hanya melalui TLS dalam body POST. |
Parameter opsional
| Parameter | Tipe | Deskripsi |
|---|---|---|
params[merchantPayoutId] | string | Cari berdasarkan kunci idempotensi Anda alih-alih payoutId. Berguna saat sistem Anda menyimpan kunci merchant tetapi kehilangan ID UnitPay. |
Salah satu dari params[payoutId] atau params[merchantPayoutId] harus ada — bukan keduanya.
Contoh permintaan
POST https://api.unitpay.net/api
Content-Type: application/x-www-form-urlencoded
method=getPayout
¶ms[payoutId]=9871234
¶ms[secretKey]=<your-project-secret-key>
Respons sukses
{
"result": {
"payoutId": 9871234,
"merchantPayoutId": "settlement-9821",
"status": "success",
"sum": 1500000.00,
"fee": 5500.00,
"currency": "IDR",
"paymentType": "bank_idr",
"account": "1234567890",
"recipientBankCode": "014",
"purpose": "Penyelesaian marketplace pesanan #9821",
"createdDate": "2026-05-08T14:22:11+07:00",
"completedDate": "2026-05-08T14:23:47+07:00"
}
}
| Field | Deskripsi |
|---|---|
status | Salah satu dari new, pending_review, in_progress, success, atau error. Lihat tabel di bawah. |
sum | Jumlah pencairan, identik dengan params[sum] yang awalnya dikirim. |
fee | Biaya saluran tujuan yang dipotong dari saldo Anda, dalam mata uang yang sama dengan sum. |
account | Identifikasi tujuan, disamarkan menurut kebijakan saluran (kartu hanya mengembalikan 4 digit terakhir). |
completedDate | Cap waktu ISO 8601 status final. Tidak ada hingga status menjadi success atau error. |
Nilai status
| Status | Arti | Final? |
|---|---|---|
new | Diterima oleh UnitPay, belum dikirim ke saluran tujuan. Biasanya teramati kurang dari satu menit. | Tidak |
pending_review | Menunggu persetujuan operator manual sesuai kebijakan proyek. Operator bertindak di kabinet merchant. | Tidak |
in_progress | Dikirim ke saluran tujuan; menunggu konfirmasi. Pencairan kartu dan SWIFT dapat berada di sini berjam-jam selama jam non-bank. | Tidak |
success | Diselesaikan ke penerima. Dana telah meninggalkan rekening koresponden UnitPay. | Ya |
error | Ditolak oleh saluran tujuan (rekening tertutup, KYC bank tidak cukup, kartu diblokir). Dana dikembalikan ke saldo merchant Anda setelah dikurangi biaya saluran yang tidak dapat dikembalikan. | Ya |
Respons error
{
"error": {
"message": "Pencairan tidak ditemukan.",
"code": -32001
}
}
| code | Arti |
|---|---|
-32000 | Kunci rahasia tidak valid. Lakukan rotasi dari Pengaturan → Proyek → Kunci rahasia. |
-32001 | Pencairan tidak ditemukan. Pastikan ID milik pencairan pada proyek yang memiliki kunci rahasia tersebut. |
-32006 | Baik payoutId dan merchantPayoutId dikirim bersamaan, atau tidak ada satu pun yang dikirim. |
Polling dan pengambilan berbasis event
Lebih baik gunakan handler callback — handler yang sama yang menerima event siklus pembayaran juga menerima event payoutStatus untuk perubahan status (new → in_progress → success atau → error). Gunakan kembali verifikasi tanda tangan.
Jika Anda harus melakukan polling, ikuti batasan ini:
- Tidak lebih dari sekali setiap 30 detik per pencairan selama
statusbelum final. - Hentikan polling segera setelah
statusmenjadisuccessatauerror; hasilnya tidak akan berubah. - Batas tarif per-proyek berlaku untuk gabungan semua panggilan
getPayout— 600 permintaan/menit, di luar itu UnitPay mengembalikan HTTP 429.
Mode uji
Pencairan mode uji menggunakan kunci rahasia uji proyek dan mencapai success dalam hitungan detik — berguna untuk validasi end-to-end logika rekonsiliasi Anda sebelum aktif.
Langkah selanjutnya
- Membuat pencairan dana — metode hulu yang menghasilkan
payoutIdyang Anda kueri di sini. - Penanganan callback — terima perubahan status pencairan secara asinkron alih-alih melakukan polling.
- Cari informasi kartu berdasarkan BIN — resolusi brand, tipe, negara, dan bank penerbit kartu tujuan.