Getting Started
Generate beautiful invoice PDFs with a single API call.
1. Get Your API Key
Sign up at kagyz.com to get your API key. It looks like:
bash
kg_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
Save this key securely. It's only shown once.
2. Make Your First Request
bash
curl -X POST https://api.kagyz.com/v1/invoice \-H "Authorization: Bearer YOUR_API_KEY" \-H "Content-Type: application/json" \-d '{"invoice_number": "INV-001","issue_date": "Feb 18, 2026","from": {"name": "Your Company","email": "billing@yourcompany.com"},"to": {"name": "Client Name","email": "client@example.com"},"items": [{"description": "Consulting Services","quantity": 10,"unit_price": 150}]}' \--output invoice.pdf
javascript
const response = await fetch('https://api.kagyz.com/v1/invoice', {method: 'POST',headers: {'Authorization': 'Bearer YOUR_API_KEY','Content-Type': 'application/json'},body: JSON.stringify({invoice_number: 'INV-001',issue_date: 'Feb 18, 2026',from: {name: 'Your Company',email: 'billing@yourcompany.com'},to: {name: 'Client Name',email: 'client@example.com'},items: [{ description: 'Consulting Services', quantity: 10, unit_price: 150 }]})});const blob = await response.blob();// Save or send the PDF
3. Response
The API returns a PDF binary directly. Set your Content-Type header appropriately when serving to users.
| Status | Description |
|---|---|
200 | Success with application/pdf |
401 | Invalid API key |
429 | Over usage limit |
400 | Invalid request |