xendit docs

Fixed Virtual Accounts

Deskripsi

Akun virtual tetap memungkinkan Anda membuat nomor rekening virtual 'tetap' yang unik untuk semua pengguna Anda. Ini sangat berguna bagi pengguna yang perlu mengirim dana secara sering, seperti pengguna dengan langganan berulang, karena mereka dapat mengirim dana ke nomor akun yang sama dan masih unik diidentifikasi oleh Xendit.

Jika Anda memilih untuk memiliki akun virtual yang ditugaskan kepada pengguna, maka pengguna tertentu akan diberikan virtual account yang dikhususkan untuk perusahaan anda dan dapat digunakan seterusnya. Misalnya, Bob akan selalu memiliki akun virtual BCA 02938-1234-567890 dan akan selalu menampilkan nama Bob ketika ia mencoba membayar akun virtual tersebut. Anda memiliki kontrol penuh atas nama yang muncul di akun saat pengguna mentransfer uang.

Nomor akun virtual adalah nomor akun 15 digit yang dihasilkan dari rentang yang ditentukan (mis. 02938-1001-111111). Xendit mendukung akun virtual untuk BCA, Mandiri, BRI, dan BNI. Kami menawarkan pelanggan baru 999,999 nomor rekening virtual untuk memulai. Jika Anda membutuhkan lebih banyak, silakan hubungi kami!

Pelanggan Anda dapat membayar akun virtual melalui ATM, mobile banking , dan internet banking . Xendit mengirim callback setiap kali akun virtual tetap ini dibayar, sehingga sistem Anda dapat diperingatkan secara otomatis.

Coba Sekarang

Cobalah Xendit API dalam hitungan detik di bawah ini. Buat invoice pertama Anda dan lihat bagaimana Anda dapat dengan mudah mendapatkan bayaran.

FIXED VIRTUAL ACCOUNT
PAYMENT
SUCCESS

Buat fixed virtual accounts (Create fixed virtual account)

Kami akan memulai dengan membuat fixed virtual account di BCA untuk Rika Sutanto.

Mari mulai dengan menjalankan permintaan curl di terminal Anda.

We will start by creating a fixed virtual account at BCA for Rika Sutanto.

Let’s start by running the curl request in your terminal.

 curl https://api.xendit.co/callback_virtual_accounts -X POST \
	 -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \
	 -d external_id=demo-1531960397051 \
	 -d bank_code=BCA \
     -d name='Rika Sutanto' 

Proses fixed virtual account

Penerapan fixed virtual account

Ikuti langkah-langkah di bawah ini untuk menerapkan API invoice kami.

Go to Dashboard -> Settings -> Configurations -> Fixed Virtual Account, klik Tombol Aktifkan yang tersedia untuk setiap Bank. Setelah Anda mengkliknya, Anda akan mendapatkan Rangkaian Fixed Virtual Account

Anda harus melakukan POST request untuk tahap ini. Ini akan membuat fixed virtual accounts yang dapat didanai pengguna kapan saja. Pelajari lebih lanjut tentang parameter dalam dokumen referensi API kami.

  • Curl
  • PHP
curl https://api.xendit.co/callback_virtual_accounts -X POST \
	 -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \
	 -d external_id=demo_virtual_account_1475459775872 \
	 -d bank_code=BCA \
     -d name='Rika Sutanto'

Kami telah memenuhi contoh di atas dengan contoh kunci API. Jika Anda telah login , Anda akan melihat kunci tes khusus Anda. Hanya Anda yang dapat melihat kunci ini.

Fixed virtual account API mengembalikan response , di bawah ini kami akan menjelaskan isi response nya

Response: 200

{
   "updated":"2016-10-07T01:35:46.658Z",
   "created":"2016-10-07T01:35:46.658Z",
   "owner_id":"57b4e5181473eeb61c11f9b9",
   "external_id":"demo-1475804036622",
   "bank_code":"BCA",
   "merchant_code":"02938",
   "name":"Rika Sutanto",
   "account_number":"029382548",
   "id":"57f6fbf26b9f064272622aa6"
}
PARAMETER DESKRIPSI
id

ID unik kami untuk fixed virtual account

owner_id

ID pengguna Anda

external_id

ID pilihan Anda yang kami tambahkan ke semua transaksi. Seringkali ID unik Anda seperti nomor telepon, email, atau ID transaksi.

merchant_code

Merchant Code akan menjadi awalan untuk nomor virtual account , misalnya 01234 nama_Anda

account_number

Ini adalah nomor virtual account lengkap (termasuk awalannya). Ini berfungsi seperti rekening bank dan apa yang pengguna perlu masukkan di internet banking / ATM untuk mengirim dana.

bank_code

Kode bank untuk bank yang relevan, mis. BCA

Setelah pembayaran terpenuhi, kami mengirimkan callback untuk memberitahu Anda tentang keberhasilan pembayaran. Anda harus memberi kami URL callback . Di bawah ini kami mencantumkan contoh tentang bagaimana callback client mungkin terlihat dari sisi Anda.

  • PHP
<?php
    if ($_SERVER["REQUEST_METHOD"] === "POST") {
        $data = file_get_contents("php://input");

        print_r("\n\$data contains the payment data \n\n");
        print_r($data);
        print_r("\n\nUpdate your database with the payment information \n\n");
    } else {
        print_r("Cannot ".$_SERVER["REQUEST_METHOD"]." ".$_SERVER["SCRIPT_NAME"]);
    }
?>

Verifikasi callback virtual account

Untuk memverifikasi apakah callback yang Anda terima berasal dari kami, Anda bisa GET request ini.

  • Curl
curl https://api.xendit.co/callback_virtual_account_payments/payment_id={payment_id} -X GET \
	 -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \

Anda bisa mendapatkan payment_id Anda dari callback yang dikirim oleh Xendit. Xendit kemudian akan mengembalikan response di bawah ini.

Response: 200

{
    "id": "598d91b1191029596846047f",
    "payment_id": "1502450097080",
    "callback_virtual_account_id": "598d5f71bf64853820c49a18",
    "external_id": "demo-1502437214715",
    "merchant_code": "77517",
    "account_number": "1000016980",
    "bank_code": "BCA",
    "amount": 5000,
    "transaction_timestamp": "2017-08-11T11:14:57.080Z"
}
PARAMETER DESCRIPTION
id

ID callback pembayaran virtual account

payment_id

ID pembayaran sistem internal kami

callback_virtual_account_id

ID callback pembayaran virtual account yang sudah di bayar

external_id

External ID callback pembayaran virtual account

merchant_code

5 digit awal kode merchant virtual account lengkap

account_number

Nomor akun virtual account

bank_code

Kode Bank untuk nomer virtual account

amount

Jumlah yang dibayarkan ke pembayaran virtual account ini

transaction_timestamp

Tanggal waktu bahwa virtual account callback dibayar

Selamat! Itu saja - Anda sekarang siap menggunakan akun virtual tetap dengan Xendit.

Langkah selanjutnya

Pertanyaan?

Masih ada lebih banyak pertanyaan? Kami selalu senang membantu sebisa kami. Kirimkan kami email atau chat dengan kami di live chat .

Fixed Virtual Accounts

Description

Fixed virtual accounts allow you to create unique 'fixed' virtual account numbers for all your users. This is particularly useful for users who need to send funds on a frequent basis, such as users with recurring subscriptions, as they can send funds to the same account number and still be unique identified by Xendit.

If you choose to have virtual accounts assigned to a user, then a specific user will be given a lasting virtual account dedicated for your company. For example, Bob will always retain a BCA virtual account 02938-1234-567890 and it will always show Bob’s name when he tries to pay that virtual account. You have full control over the name that appears on the account when your users transfer money in.

Virtual account numbers are 15-digit account numbers that are generated from a defined range (ex. 02938-1001-111111). Xendit supports virtual accounts for BCA, Mandiri, BRI, and BNI. We offer new customers 999,999 virtual account numbers to start. If you need more, please contact us!

Your customers can pay virtual accounts via ATM, mobile banking, and internet banking. Xendit sends a callback each time this fixed virtual account is paid, so that your systems can be alerted automatically.

Try it now

Try out the Xendit API in seconds below. Create your first invoice and see how you can easily get paid.

FIXED VIRTUAL ACCOUNT
PAYMENT
SUCCESS

Buat fixed virtual accounts (Create fixed virtual account)

Kami akan memulai dengan membuat fixed virtual account di BCA untuk Rika Sutanto.

Mari mulai dengan menjalankan permintaan curl di terminal Anda.

We will start by creating a fixed virtual account at BCA for Rika Sutanto.

Let’s start by running the curl request in your terminal.

 curl https://api.xendit.co/callback_virtual_accounts -X POST \
	 -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \
	 -d external_id=demo-1531960397057 \
	 -d bank_code=BCA \
	 -d name='Rika Sutanto' 

Fixed virtual account process

Implementing fixed virtual accounts

Follow the steps below to implement our invoices API.

Arahkan ke Dashboard -> Settings -> Configurations -> Fixed Virtual Account, Click on Activate Button that available for every Banks. After you click it, you will get Fixed Virtual Account Ranges.

You’ll need to POST this request. It will create a fixed virtual account which your users can fund anytime. Learn more about the parameters in our API reference docs.

  • Curl
  • PHP
curl https://api.xendit.co/callback_virtual_accounts -X POST \
	 -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \
	 -d external_id=demo_virtual_account_1475459775872 \
	 -d bank_code=BCA \
     -d name='Rika Sutanto'

We have prefilled the above example with a sample API key. If you're logged in, you'll see your specific test key. Only you can see this key.

Our fixed virtual account API will then return a response. We explain the response below

Response: 200

{
   "updated":"2016-10-07T01:35:46.658Z",
   "created":"2016-10-07T01:35:46.658Z",
   "owner_id":"57b4e5181473eeb61c11f9b9",
   "external_id":"demo-1475804036622",
   "bank_code":"BCA",
   "merchant_code":"02938",
   "name":"Rika Sutanto",
   "account_number":"029382548",
   "id":"57f6fbf26b9f064272622aa6"
}
PARAMETER DESCRIPTION
id

Our unique ID for the fixed virtual account

owner_id

Your user ID

external_id

An ID of your choice we append to all transactions. Often your unique ID like a phone number, email or transaction ID.

merchant_code

The merchant code will be the prefix for the virtual account number, e.g 01234 your_number

account_number

This is the complete virtual account number (including the prefix). This works just like a bank account and is what a user will need to enter in their internet banking /ATM to send funds.

bank_code

Bank code for the relevant bank, e.g. BCA

When a payment is detected, we initiate a callback to notify you of an inbound payment. You’ll need to provide us a callback URL. Below we’ve included an example of what a callback client may look like from your side.

  • PHP
<?php
    if ($_SERVER["REQUEST_METHOD"] === "POST") {
        $data = file_get_contents("php://input");

        print_r("\n\$data contains the payment data \n\n");
        print_r($data);
        print_r("\n\nUpdate your database with the payment information \n\n");
    } else {
        print_r("Cannot ".$_SERVER["REQUEST_METHOD"]." ".$_SERVER["SCRIPT_NAME"]);
    }
?>

Verifying the callback virtual account

To verify if the callback you received is coming from us, you can GET this request.

  • Curl
curl https://api.xendit.co/callback_virtual_account_payments/payment_id={payment_id} -X GET \
	 -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \

You can get your payment_id from the callback sent by Xendit. Xendit will then return a response below.

Response: 200

{
    "id": "598d91b1191029596846047f",
    "payment_id": "1502450097080",
    "callback_virtual_account_id": "598d5f71bf64853820c49a18",
    "external_id": "demo-1502437214715",
    "merchant_code": "77517",
    "account_number": "1000016980",
    "bank_code": "BCA",
    "amount": 5000,
    "transaction_timestamp": "2017-08-11T11:14:57.080Z"
}
PARAMETER DESCRIPTION
id

ID of the callback virtual account payment

payment_id

Our internal system’s payment ID

callback_virtual_account_id

ID of the callback virtual account payment that was paid

external_id

External ID on the callback virtual account payment

merchant_code

5-digit merchant prefix to the full virtual account number

account_number

Account number of the virtual account

bank_code

Bank code of the virtual account number

amount

Amount that was paid to this virtual account payment

transaction_timestamp

Date time that the callback virtual account was paid

Congrats! That’s it - you’re now set to use fixed virtual accounts with Xendit.

Next Steps

  • Ready to do some testing? Our testing pages walks through some testing so you can test your implementation
  • Learn more about the methods of payments: fixed or non fixed virtual accounts, cards .

Questions?

Still have more questions? We're always happy to help however we can. Shoot us an email or chat to us in live chat.