Developers

Invoice generation by REST

Authenticate with a Bearer key, POST your invoice payload, get a PDF or JSON back. 1,000 requests/month per key included with Invoeze Pro.

Quickstart

Three steps from zero to a generated invoice.

  1. 1

    Generate an API key

    Sign in, upgrade to Pro, then create a key from the Manage keys section below. Keys are shown once at creation, so store them somewhere safe.

  2. 2

    Make your first request

    Hit the /preview endpoint to validate your payload and see the calculated totals.

    curl -X POST https://invoeze.in/api/v1/invoice/preview \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
           "invoiceNumber": "INV-001",
           "date": "2026-04-19",
           "currency": "INR",
           "sender": { "name": "Acme Studio", "gstin": "29ABCDE1234F1Z5" },
           "client": { "name": "Globex", "gstin": "27ABCDE5678G2Z9" },
           "lineItems": [
             { "description": "Logo design", "quantity": 1, "rate": 25000 }
           ],
           "tax": { "gstEnabled": true, "gstType": "igst", "gstRate": 18, "tdsEnabled": true, "tdsRate": 10 }
         }'
  3. 3

    Inspect the response

    All responses follow the same shape:

    {
      "success": true,
      "data": { ... },
      "error": null
    }

    When success is false, data is null and error is a human-readable message.

Endpoints

Base URL: https://invoeze.in/api/v1

POST/invoice/preview

Validates your payload and returns the calculated invoice totals (subtotal, taxes, TDS deduction, grand total) as JSON. Doesn't render a PDF; use this when you want your own UI.

Request

curl -X POST https://invoeze.in/api/v1/invoice/preview \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "invoiceNumber": "INV-001",
       "date": "2026-04-19",
       "currency": "INR",
       "sender": { "name": "Acme Studio", "gstin": "29ABCDE1234F1Z5" },
       "client": { "name": "Globex", "gstin": "27ABCDE5678G2Z9" },
       "lineItems": [
         { "description": "Logo design", "quantity": 1, "rate": 25000 }
       ],
       "tax": { "gstEnabled": true, "gstType": "igst", "gstRate": 18, "tdsEnabled": true, "tdsRate": 10 }
     }'

Response

{
  "success": true,
  "data": {
    "subtotal": 25000,
    "cgst": 0,
    "sgst": 0,
    "igst": 4500,
    "tdsDeduction": 2500,
    "total": 27000
  },
  "error": null
}
POST/invoice/generate

Same payload as /preview, plus returns the rendered invoice as a base64-encoded A4 PDF. The PDF is rendered server-side with a minimal layout, fine for B2B / API use cases.

Request

curl -X POST https://invoeze.in/api/v1/invoice/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d @invoice.json \
  | jq -r '.data.pdfBase64' \
  | base64 -d > invoice.pdf

Response

{
  "success": true,
  "data": {
    "filename": "invoice-INV-001-Globex.pdf",
    "mimeType": "application/pdf",
    "pdfBase64": "JVBERi0xLjQK..."
  },
  "error": null
}

Rate limits

  • 1,000 requests per month, per key, included with Invoeze Pro. Both /preview and /generate count toward the same bucket.
  • The counter is per-key and increments on every successful authenticated request. 5xx server errors do not count against your quota.
  • Every response includes X-RateLimit-Limit and X-RateLimit-Remaining headers so you can budget proactively.
  • Need a higher ceiling? Email hello@invoeze.in and we'll quote a per-month limit that fits your volume.

Errors

HTTP status codes follow the usual conventions. The body shape is identical for every error: success: false with a string error and an optional details object.

400validation_failed

The request body did not match the schema (missing required field, wrong type, out-of-range value, etc.). The `details.issues` array contains the specific Zod issues.

{
  "success": false,
  "error": "Invalid invoice payload",
  "details": {
    "issues": [
      { "path": ["lineItems", 0, "rate"], "message": "Expected number, received string" }
    ]
  }
}
401unauthorized

Missing or invalid Bearer token. Check the Authorization header. It must be exactly `Authorization: Bearer <your_key>`.

{
  "success": false,
  "error": "Missing or invalid API key"
}
429rate_limit_exceeded

Your API key has hit its monthly request ceiling (1,000 by default for Pro). Response includes `X-RateLimit-Limit` and `X-RateLimit-Remaining` headers.

{
  "success": false,
  "error": "Rate limit exceeded"
}
500server_error

Something unexpected broke on our side. The request hasn't been counted against your quota. Retry with exponential backoff; if it persists, email hello@invoeze.in.

{
  "success": false,
  "error": "Failed to generate PDF"
}

Manage keys

Use these keys in the Authorization: Bearer … header.

Need help? See plans · or email hello@invoeze.in