There are two ways in creating an Invoice. They are:
Creating invoices using Xendit Dashboard is very simple. Every Xendit Invoices created will be on the dashboard with it's status and details. First, go to the dashboard invoice tab where you can find a “+ Create invoice” button there. When you click it, it will open a pop-up where you can fill:
|Parameter||What to fill|
|External ID||Unique code for you to reconcile. e.g.: HOUSE.AP/INV/XXV/341293TPR0004XJEDBDIEFDJIAGDY|
|Email of your customer (the one you want to bill). You can choose whether Xendit sends an email to your customer.|
|Invoice due time||Click on calendar icon to choose the date and then inside calendar, click clock icon to set the time|
|Amount||Invoice total amount in Rupiah|
|Description||Short description for your end customer to read. (e.g., Payment for apartment electricity bill unit #0521G)|
After you create an invoice, you get a link to your invoice. If you choose “Send invoice to this email”, Xendit will automatically send an email to your customer. You can also copy the link and send it directly to your customer. The end customer can pay the invoice by choosing the payment options and following the given payment instructions.
If you choose to use the Xendit invoice UI, you can use invoice link from our response and redirect your customers however you'd like. Alternatively, if you want to create your own UI, our response will return data that you can use for your own UI.
Let’s try to create an invoice which we will then pay so you can see how our invoice flow works. You can follow the steps below to implement our invoices API. You’ll need to POST this request. It will create an invoice which your customers can pay with the methods you have configured within the dashboard.
<?php require 'vendor/autoload.php'; $options['secret_api_key'] = 'xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg=='; $xenditPHPClient = new XenditClient\XenditPHPClient($options); $external_id = 'demo_1475801962607'; $payer_email = 'email@example.com'; $description = 'Trip to Bali'; $amount = 13000; $response = $xenditPHPClient->createInvoice($external_id, $amount, $payer_email, $description); print_r($response); ?>
We have prefilled the above example with a sample API key and other filled parameter. You need to change the content of the parameter above with your desired parameter. You can also add optional parameters such as a redirection link page, invoice duration and payment methods. More detailed descriptions of these parameters can be found in the invoice API docs.