back

Vibe Invoice API Documentation

Introduction

The Vibe Invoice API allows you to programmatically generate invoices by sending client, item, and tax information to our endpoint. This guide provides a complete overview of how to use the API effectively.

Endpoint

POST https://www.vibeinvoice.com/api/invoice/generate-invoice

Authentication

Include your API key in the request header using the x-api-key field. You can generate your API key from Company tab

"Content-Type": "application/json", "x-api-key": "replace-with-your-api-key"

Request Body

Send a JSON object with the following structure:

{
  "clientName": "string",
  "clientEmail": "string",
  "clientAddress": "string",
  "clientPhone": "string",
  "clientTaxId": "string",
  "items": [
    { "description": "string", "quantity": number, "rate": number }
  ],
  "additions": [
    { "description": "string", "percent": number }
  ],
  "deductions": [
    { "description": "string", "percent": number }
  ],
  "status": "string",
  "notes": "string"
}

Items

The items array contains all the goods or services being billed. Each item must have adescription, quantity, and rate (unit price). The total is calculated as quantity × rate.

"items": [
  { "description": "Bulk Sugar Order", "quantity": 100, "rate": 42 },
  { "description": "Jaggery Packs", "quantity": 50, "rate": 55 }
  ]

Additions

Use the additions array to add extra charges like taxes or packaging. You can specify either apercent (percentage of subtotal) or a fixed amount.

"additions": [
  { "description": "GST @5%", "percent": 5 },
  { "description": "Packaging Charges", "amount": 20 }
]

Deductions

Use the deductions array to apply discounts to the invoice. You can specify either apercent (percentage of subtotal) or a fixed amount.

"deductions": [
  { "description": "Usual Discount", "percent": 3 }
  { "description": "Seasonal Discount", "amount": 300 }
]

Response

On success, the API returns a JSON object with the generated invoice link:

"success": true, "invoiceUrl": "https://vibeinvoice.com/view/1234"

Error Handling

In case of errors, you'll receive a JSON response with an error message:

"success": false, "error": "Invalid API key"

Support

For questions, reach out to me atabhishek@vibeinvoice.com