Quickstart
This quickstart takes an existing product ID and requests an invoice for a customer. The request and response are shown beside the guide.
Before you begin
Get your business ID from the Xara developer dashboard. You will also need the ID of a product that belongs to that business.
If you do not have a product yet, create one first.
1. Build the invoice items
Every invoice needs at least one product_id and its quantity.
The items property is currently sent as a JSON-encoded string:
"items": "[{\"product_id\":128,\"quantity\":1}]"
items as a normal JSON array. Encode the array before placing it in the request body.2. Request the invoice
Send the customer phone number, business ID, and encoded items to Payment/requestInvoice. This endpoint does not require an API token.
The example on the right can be switched between cURL and JavaScript.
3. Store the reference
Keep the returned reference with your order:
INV-…
You will use it to match the payment webhook to the correct customer or order.
4. Handle payment
Register a webhook URL in your business dashboard, then follow the payment webhook guide to verify the request and record the payment.

