Generate a payment link
Last updated:
A payment link is a hosted URL that opens the UnitPay payment form pre-filled with an amount, currency, and description. Customers pay through the same hosted experience as the API-driven flow; you receive the result through the same callback handler. Two ways to generate one:
- From the merchant cabinet — add a product, copy the link, share it. No code required.
- Programmatically — call
initPaymentfrom your server and reuse the returnedredirectUrlas a one-time payment link.
Option 1 — create a link from the merchant cabinet
Use this when you sell a fixed catalogue of items, accept donations, or need a quick reusable link without integrating the API.
- Sign in to the merchant cabinet and open Settings → Products for your project.
- Click + Add product and fill in the fields:
- Name — shown on the payment form and the receipt.
- Price and Currency —
IDR,USD, orEUR. - Description — optional details displayed alongside the product name.
- Quantity policy — fixed price, customer-entered amount, or limited stock.
- Locale — the form language,
enorid.
- Save. The cabinet generates the payment link and a printable QR code that resolves to the same URL.
- Share the link by email, WhatsApp, or any other channel; embed the QR on a printed receipt or in-store sign.
You can edit, deactivate, or delete a product at any time. Deactivating an existing link prevents new payments but does not cancel pending or completed transactions.
Option 2 — reuse the redirectUrl from initPayment
Use this when each link must carry an order-specific amount, customer reference, or short expiry. Call initPayment with the order details, then deliver the redirectUrl from the response to the customer:
POST https://api.unitpay.net/api
Content-Type: application/x-www-form-urlencoded
method=initPayment
¶ms[paymentType]=card
¶ms[projectId]=123456
¶ms[sum]=150000.00
¶ms[currency]=IDR
¶ms[account]=invoice-2026-0184
¶ms[desc]=Invoice%20%232026-0184
¶ms[signature]=<sha256-hex-digest>
The response carries the hosted URL:
{
"result": {
"type": "redirect",
"paymentId": 1231231234,
"redirectUrl": "https://pay.unitpay.net/123456-1fc2f/card?..."
}
}
Send the redirectUrl to the customer in your invoice email, ticketing system, or chatbot reply. The link is single-payment and expires when the payment is completed, abandoned, or after the project's payment-window timeout (15 minutes by default).
Choosing between the two options
| Need | Recommended option |
|---|---|
| Fixed price catalogue, social-media checkout, donation page | Cabinet product link |
| Per-invoice amount, server-generated reference, short expiry | initPayment + redirectUrl |
| Print on a physical receipt with QR code | Cabinet product link |
| Embed in transactional email triggered by your backend | initPayment + redirectUrl |
What you receive after a payment
Both options notify your callback handler the same way: a signed CHECK request followed by a signed PAY request, both verifiable using your project secret key. See Callback handler. The account field in the callback echoes the customer or order identifier you set on the link, so you can reconcile the payment to the originating order.
Limitations
- Cabinet product links use the project's primary currency by default; multi-currency catalogue items require one product entry per currency.
redirectUrlvalues are not designed to be re-shared after the customer has used them — generate a fresh link per invoice.- Link domains are fixed to
pay.unitpay.net. Custom domains are on the roadmap; ask onboarding for the current status.
Next steps
- Create a payment via API — full reference for
initPayment. - Callback handler — verify the result on your server.
- Refund a payment — reverse a charge made through any link type.
Tautan pembayaran adalah URL terhosting yang membuka formulir pembayaran UnitPay dengan jumlah, mata uang, dan deskripsi yang sudah terisi. Pelanggan membayar melalui pengalaman terhosting yang sama seperti alur berbasis API; Anda menerima hasilnya melalui callback handler yang sama. Ada dua cara untuk membuatnya:
- Dari kabinet merchant — tambahkan produk, salin tautan, lalu bagikan. Tidak perlu kode.
- Secara programatik — panggil
initPaymentdari server Anda dan gunakan kembaliredirectUrlyang dikembalikan sebagai tautan pembayaran sekali pakai.
Opsi 1 — buat tautan dari kabinet merchant
Gunakan opsi ini bila Anda menjual katalog item yang harganya tetap, menerima donasi, atau membutuhkan tautan cepat yang dapat digunakan ulang tanpa integrasi API.
- Masuk ke kabinet merchant dan buka Pengaturan → Produk untuk proyek Anda.
- Klik + Tambah produk dan isi field-nya:
- Nama — ditampilkan pada formulir pembayaran dan kuitansi.
- Harga dan Mata uang —
IDR,USD, atauEUR. - Deskripsi — detail opsional yang ditampilkan di samping nama produk.
- Kebijakan kuantitas — harga tetap, jumlah yang dimasukkan pelanggan, atau stok terbatas.
- Locale — bahasa formulir,
enatauid.
- Simpan. Kabinet akan membuat tautan pembayaran dan kode QR siap-cetak yang menuju ke URL yang sama.
- Bagikan tautan via email, WhatsApp, atau saluran lainnya; tempelkan QR pada kuitansi cetak atau papan petunjuk di toko.
Anda dapat mengubah, menonaktifkan, atau menghapus produk kapan saja. Menonaktifkan tautan yang sudah ada akan mencegah pembayaran baru tetapi tidak membatalkan transaksi yang tertunda atau telah selesai.
Opsi 2 — gunakan kembali redirectUrl dari initPayment
Gunakan opsi ini bila setiap tautan harus membawa jumlah spesifik per pesanan, referensi pelanggan, atau masa berlaku singkat. Panggil initPayment dengan detail pesanan, lalu kirim redirectUrl dari respons kepada pelanggan:
POST https://api.unitpay.net/api
Content-Type: application/x-www-form-urlencoded
method=initPayment
¶ms[paymentType]=card
¶ms[projectId]=123456
¶ms[sum]=150000.00
¶ms[currency]=IDR
¶ms[account]=invoice-2026-0184
¶ms[desc]=Invoice%20%232026-0184
¶ms[signature]=<sha256-hex-digest>
Respons memuat URL terhosting:
{
"result": {
"type": "redirect",
"paymentId": 1231231234,
"redirectUrl": "https://pay.unitpay.net/123456-1fc2f/card?..."
}
}
Kirimkan redirectUrl kepada pelanggan melalui email faktur, sistem tiket, atau balasan chatbot. Tautan ini hanya untuk satu kali pembayaran dan kedaluwarsa setelah pembayaran selesai, ditinggalkan, atau melewati waktu tunggu pembayaran proyek (default 15 menit).
Memilih antara kedua opsi
| Kebutuhan | Opsi yang disarankan |
|---|---|
| Katalog harga tetap, checkout media sosial, halaman donasi | Tautan produk kabinet |
| Jumlah per faktur, referensi yang dihasilkan server, masa berlaku singkat | initPayment + redirectUrl |
| Cetak pada kuitansi fisik dengan kode QR | Tautan produk kabinet |
| Sertakan dalam email transaksional yang dipicu backend Anda | initPayment + redirectUrl |
Yang Anda terima setelah pembayaran
Kedua opsi memberi tahu callback handler Anda dengan cara yang sama: permintaan CHECK bertanda tangan diikuti permintaan PAY bertanda tangan, keduanya dapat diverifikasi dengan kunci rahasia proyek Anda. Lihat Penanganan callback. Field account pada callback mengembalikan identifikasi pelanggan atau pesanan yang Anda atur pada tautan, sehingga Anda dapat merekonsiliasi pembayaran dengan pesanan asli.
Batasan
- Tautan produk kabinet menggunakan mata uang utama proyek secara default; item katalog multi-mata uang memerlukan satu entri produk per mata uang.
- Nilai
redirectUrltidak dirancang untuk dibagikan ulang setelah dipakai pelanggan — buat tautan baru per faktur. - Domain tautan tetap pada
pay.unitpay.net. Domain kustom ada di roadmap; tanyakan ke onboarding untuk status terkini.
Langkah selanjutnya
- Membuat pembayaran melalui API — referensi lengkap untuk
initPayment. - Penanganan callback — verifikasi hasil pada server Anda.
- Pengembalian dana pembayaran — balik transaksi yang dilakukan melalui jenis tautan apa pun.