API Reference

One endpoint. Send JSON, receive a PDF. Authenticate with a Bearer key from your dashboard. Responses include X-Usage-Used and X-Usage-Quota headers.

Create a document

POST https://slipstack.dev/api/v1/pdf
Authorization: Bearer psk_live_xxx
Content-Type: application/json

{
  "template": "invoice",          // "invoice" | "receipt"
  "options": { "format": "A4" },  // "A4" | "LETTER"
  "data": {
    "from": { "name": "Acme Inc", "address": "1 Market St", "email": "billing@acme.com", "logoUrl": "https://.../logo.png" },
    "to":   { "name": "Globex LLC", "email": "ap@globex.com" },
    "number": "INV-1024",
    "date": "2026-06-09",
    "dueDate": "2026-07-01",
    "currency": "USD",
    "items": [
      { "description": "Consulting", "quantity": 10, "unitPrice": 150 }
    ],
    "taxRate": 8.5,
    "discount": 100,
    "notes": "Thank you for your business.",
    "accentColor": "#1f5be0"
  }
}

Node.js

const res = await fetch("https://slipstack.dev/api/v1/pdf", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SLIPSTACK_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ template: "invoice", data: invoice }),
});
const pdf = Buffer.from(await res.arrayBuffer()); // application/pdf

JSON response mode

// Add ?format=base64 or 'Accept: application/json' to get JSON instead of binary:
{
  "pdf_base64": "JVBERi0xLjc...",
  "bytes": 18234,
  "template": "invoice",
  "usage": { "used": 42, "quota": 1000, "plan": "starter" }
}

Errors

StatusCodeMeaning
401missing/invalid_api_keyKey absent or unknown
422invalid_requestPayload failed validation (message says why)
429quota_exceededMonthly quota reached — upgrade
500render_failedRendering error