English
API ReferenceSign In

Create an Invoice

Last updated 10/27/2021


You can create invoices via Xendit Dashboard or API, depending on your business needs.

Invoice Creation PlatformBenefitsTrade-offs
Dashboard- Does not require coding experience or technical integration

- Easily create invoices directly on your Xendit dashboard

- Step-by-step invoice creation is easy to understand
Invoice creation is done manually (not automated)
API- Invoice creation is automated via API

- User Interface can be fully customized based on your business needs
Requires developer resources for technical integration

Create Invoice via Dashboard

To create an invoice via dashboard, you Account User should have at least EDIT permission. Follow these steps to create an invoice via Xendit dashboard:

  1. Login to your Xendit dashboard
  2. Go to Accept Payments > Invoices
  3. Click "Create" to create an invoice and use the information below as your guide


Required Fields

FieldWhat to Fill
External IDUnique identifier of an invoice in your system. There are no character restrictions for External ID.

Sample: Invoice-Payment-10/01/2021
Total Amount DueThe total amount your customer will pay for a specific invoice (can be in IDR, PHP or USD) without basket items.

Note: If you choose Total Amount due, you do not have to input the items basket (List of Order Items) for the invoice
List of Order ItemsBreakdown of the items the invoice is billing for. Requires Item Name, Quantity, and Unit Price.

Note: If you choose List of Order Items, you do not have to input Total Amount Due because we automatically calculate the total amount based on your inputted item quantities and unit prices.

Optional Fields

FieldWhat to Fill
Admin FeeA flat fee that will apply to the entire invoice, regardless of the payment method and channel your customer uses to pay. The admin fee is automatically added towards the total invoice amount.
NameName of the customer you want to bill.
EmailEmail address of the customer you want to bill. You can send the invoice and a reminder via email by clicking “email” in the Invoice Reminder and Notification section.
Mobile NumberMobile number of the customer you want to bill. You can send the invoice and a reminder via SMS or WhatsApp to this number by clicking “SMS” and/or “WhatsApp” in the Invoice Reminder and Notification section.
DescriptionShort description for your end customer to know what the invoice is for. You can use this free field to type notes or describe the purpose of the invoice.

Sample: October 2021 electricity bill payment for Apartment Unit #1A
Invoice DueThe date and time you want the invoice to expire. Click Edit > Calendar icon to select the invoice expiry date. Click on the clock icon to set the invoice expiry time within the date you specified.
Invoice ReminderRemind your customer to pay for the invoice through email, SMS and/or WhatsApp. Choose to send a reminder from a minimum of one hour before the invoice expires to 30 days (1 month) before the invoice expires. Leave the reminder field empty if you do not want to send a reminder to your customer.
Set Due ReminderThe time you want to remind your customer to pay for the invoice via email, SMS and/or WhatsApp. You can send a reminder at least an hour before to up to 30 days (1 month) before an invoice is due.


Create Invoice via Dashboard Tutorial

Create Invoice via API

Follow these steps to create an invoice via API:

  1. Follow the instructions on the Create Invoice section of the Xendit API Reference to start creating your invoice via API
  2. Setup your Invoice Callback URLs in Xendit Dashboard (for invoices paid and expired)

Example of Create Invoice via API

<?php

  use Xendit\Xendit;
  require 'vendor/autoload.php';

  Xendit::setApiKey('xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==');

  $params = [ 
    'external_id' => 'demo_1475801962607',
    'payer_email' => 'alfina@xendit.co',
    'description' => 'Trip to Bali',
    'amount' => 50000
  ];

  $createInvoice = \Xendit\Invoice::create($params);
  var_dump($createInvoice);

?>
const x = new require('xendit-node')({ secretKey: 'xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==' });

const { Invoice } = x;
const invoiceSpecificOptions = {};
const i = new Invoice(invoiceSpecificOptions);

const resp = await i.createInvoice({
  externalID: 'demo_1475801962607',
  amount: 230000,
  payerEmail: 'sample_email@xendit.co',
  description: 'Trip to Bali',
});
console.log(resp);
Xendit.apiKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw==";
try {
  Map<String, Object> params = new HashMap<>();
  params.put("external_id", "demo_1475801962607");
  params.put("amount", 50000);
  params.put("payer_email", "customer@domain.com");
  params.put("description", "Trip to Bali");

  Invoice invoice = Invoice.create(params);
} catch (XenditException e) {
  e.printStackTrace();
}
xendit.Opt.SecretKey = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="

data := invoice.CreateParams{
  ExternalID:  "demo_1475801962607",
  Amount:      50000,
  PayerEmail:  "alfina@xendit.co",
  Description: "Trip to Bali",
}

resp, err := invoice.Create(&data)
if err != nil {
  log.Fatal(err)
}

fmt.Printf("created invoice: %+v\n", resp)
from xendit import Xendit

api_key = "xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw=="
xendit_instance = Xendit(api_key=api_key)
Invoice = xendit_instance.Invoice

invoice = Invoice.create(
    external_id="invoice-1593684000",
    amount=20000,
    payer_email="customer@domain.com",
    description="Invoice Demo #123",
)
print(invoice)

For more sample codes and library, visit our Demo Store or this library.

Testing Invoice Payment

Test Xendit integrations without moving real money. Simulations will result in your invoice status appearing as Paid/Settled in your Dashboard. We also initiate a callback to your Callback URL.

Test Invoice Payment via Invoice UI

Test invoice payment via Invoice UI by following these steps:

  1. Create an invoice
  2. Open the Invoice URL link
  3. Choose your desired payment channel
  4. Click the “Click here to simulate your payment with [your payment channel]” button at the red banner above the invoice UI
  5. Invoice is successfully Paid/Settled

Test Invoice Payment via Amount

Test invoice payment using a preset amount by following these steps:

  1. Create an invoice with the amount of IDR 3,000,000
  2. Go to your Invoice Tab in Xendit dashboard
  3. Invoice is successfully Paid/Settled

Test Invoice Payment via Cards

Test invoice payment via Cards payment by following these steps:

  1. Create an invoice with Credit Card as an available payment method
  2. Open the invoice URL link
  3. Choose Credit / Debit Card in the payment method
  4. Fill the card number with 4000 0000 0000 0002, any CVV and future expiry date (to test cards installments on invoice, please see the test card numbers here)
  5. Input "1234" in the 3DS authorization page
  6. Invoice is successfully Paid/Settled