The Invoice Object

Invoices are statements of amounts owed by a customer. Vylot automatically calculates all CGST, SGST, and IGST based on the customer's state code vs your business state code.

POST/v1/invoices

Create an invoice

Creates a new tax-compliant invoice. You must provide a valid customer ID and an array of items.

Parameters

customer_idstringRequired
The ID of an existing customer.
itemsarrayRequired
A list of line items.
items[].product_idstring
The ID of an existing product.
items[].namestring
Required if product_id is omitted.
items[].unit_pricenumber
Required if product_id is omitted.
items[].qtyintegerRequired
The quantity being sold.
items[].gst_ratenumber
Required if product_id is omitted. Total tax rate %.
payment_statusstring
Set to 'PAID' or 'UNPAID'.
curl -X POST https://api.vylot.workers.dev/v1/invoices -H "Authorization: Bearer vk_live_abc123..." -H "Content-Type: application/json" -d '{"customer_id": "cust_828f2", "items": [{"product_id": "prod_1a2b3", "quantity": 2}]}'
Response
{ "success": true, "data": { "id": "inv_9b24cd", "invoice_number": "INV-2026-0001", "status": "UNPAID", "total": 1416.00 } }
GET/v1/invoices

List all invoices

Returns a paginated list of your invoices.

curl -X GET https://api.vylot.workers.dev/v1/invoices -H "Authorization: Bearer vk_live_abc123..."
Response
{ "success": true, "data": [ { "id": "inv_9b24cd", "total": 1416.00 } ] }
GET/v1/invoices/:id

Retrieve an invoice

Retrieves the details of an existing invoice, including its line items.

curl -X GET https://api.vylot.workers.dev/v1/invoices/inv_9b24cd -H "Authorization: Bearer vk_live_abc123..."
Response
{ "success": true, "data": { "id": "inv_9b24cd", "items": [...] } }
PATCH/v1/invoices/:id/status

Update invoice status

Updates the status of an invoice.

Parameters

statusstringRequired
Allowed values: 'DRAFT', 'SENT', 'PAID', 'OVERDUE', 'VOID'.
curl -X PATCH https://api.vylot.workers.dev/v1/invoices/inv_9b24cd/status -H "Authorization: Bearer vk_live_abc123..." -H "Content-Type: application/json" -d '{"status": "PAID"}'
Response
{ "success": true }
DELETE/v1/invoices/:id

Delete an invoice

Deletes a draft invoice.

curl -X DELETE https://api.vylot.workers.dev/v1/invoices/inv_9b24cd -H "Authorization: Bearer vk_live_abc123..."
Response
{ "success": true }