Media
PDF Generation API
Generate professional PDF documents — invoices, receipts, and reports — via API. Built with pdf-lib featuring styled headers, line-item tables, automatic tax calculations, and A4 formatting.
Endpoint:
/v1/pdf/generateMethod:POST
Latency:~150ms
Try it out
POST
/v1/pdf/generateParameters
Code
curl
curl -X POST "https://khaleejiapi.dev/api/v1/pdf/generate?type=invoice&title=Invoice¤cy=AED&taxRate=5" \ -H "X-API-Key: your_api_key"Invoice / Receipt Fields
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | Required | "invoice" or "receipt" |
| title | string | Optional | Document title (auto-generated if omitted) |
| invoiceNumber | string | Optional | Invoice/receipt number (auto-generated if omitted) |
| from | object | Optional | Sender: name, address, email |
| to | object | Optional | Recipient: name, address, email |
| items | array | Required | Line items (1–50): description, quantity, unitPrice |
| currency | string | Optional | Currency code (default: AED) |
| taxRate | number | Optional | Tax percentage (default: 0) |
| notes | string | Optional | Footer notes |
Report Fields
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | Required | "report" |
| title | string | Optional | Report title |
| sections | array | Required | Report sections (1–20): heading, content |
Rate Limits
| Plan | Requests/Month | Rate Limit |
|---|---|---|
| Free | 500 | 5 req/min |
| Starter | 5,000 | 30 req/min |
| Professional | 50,000 | 120 req/min |
| Business | 250,000 | 500 req/min |