SDKs & Integration

Everything you need to integrate PDFModule into your application. We recommend starting with CURL for testing.

CURL - The Fastest Way to Get Started

No installation required. Test our API directly from your terminal in seconds. CURL works everywhere and is the best way to understand our API before integrating with SDKs.

0s

Zero Setup

Already installed on Mac/Linux

*

Universal

Works with any language

>

Scriptable

Easy to automate

!

Debug Friendly

See raw requests/responses

Render a PDF with CURL
# Generate a PDF - it's this simple!
curl -X POST https://api.pdfmodule.com/v1/render \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "invoice",
    "data": {
      "invoice_number": "INV-2024-001",
      "customer_name": "Acme Corporation",
      "items": [
        {"description": "Professional Services", "quantity": 10, "unit_price": 150.00}
      ],
      "total": 1500.00
    }
  }'

Download Official SDKs

Py

Python SDK

Full-featured Python client with type hints, dataclasses, and comprehensive error handling. Works with Python 3.7+.

JS

Node.js SDK

Modern async/await JavaScript client. Works with Node.js 14+ and supports both CommonJS and ES modules.

PHP

PHP SDK

Clean PHP 7.4+ client using cURL. No external dependencies required. Perfect for Laravel, Symfony, or vanilla PHP.

Go

Go SDK

Idiomatic Go client with full type safety. Supports Go 1.18+ with generics and context support.

Complete CURL Reference

POST /v1/render - Generate a PDF
# Basic render request
curl -X POST https://api.pdfmodule.com/v1/render \
  -H "Authorization: Bearer pm_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "invoice",
    "data": {
      "invoice_number": "INV-2024-001",
      "customer_name": "Acme Corp",
      "items": [{"description": "Widget", "qty": 10, "price": 29.99}],
      "total": 299.90
    }
  }'

# Render with specific version
curl -X POST https://api.pdfmodule.com/v1/render \
  -H "Authorization: Bearer pm_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{"template": "invoice", "version": 3, "data": {...}}'

# Download PDF directly (pipe to file)
curl -X POST https://api.pdfmodule.com/v1/render \
  -H "Authorization: Bearer pm_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{"template": "invoice", "data": {...}}' \
  | jq -r '.url' | xargs curl -o invoice.pdf
POST /v1/validate - Validate Before Rendering
# Validate data without rendering (saves API calls)
curl -X POST https://api.pdfmodule.com/v1/validate \
  -H "Authorization: Bearer pm_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "invoice",
    "data": {
      "customer_name": "Test"
    }
  }'

# Response shows missing fields
# {
#   "valid": false,
#   "errors": ["Missing required field: invoice_number"],
#   "warnings": ["Field 'items' is empty"]
# }
Template Management
# List all templates
curl -X GET https://api.pdfmodule.com/v1/templates \
  -H "Authorization: Bearer pm_live_xxxxx"

# Get single template
curl -X GET https://api.pdfmodule.com/v1/templates/invoice \
  -H "Authorization: Bearer pm_live_xxxxx"

# Create new template
curl -X POST https://api.pdfmodule.com/v1/templates \
  -H "Authorization: Bearer pm_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Invoice Template",
    "slug": "invoice",
    "body_html": "

Invoice {{invoice_number}}

...", "page_size": "A4" }'
# Lock template (makes it immutable) curl -X POST https://api.pdfmodule.com/v1/templates/invoice/lock \ -H "Authorization: Bearer pm_live_xxxxx" # Get template versions curl -X GET https://api.pdfmodule.com/v1/templates/invoice/versions \ -H "Authorization: Bearer pm_live_xxxxx"
Document Management
# List recent documents
curl -X GET "https://api.pdfmodule.com/v1/documents?limit=10" \
  -H "Authorization: Bearer pm_live_xxxxx"

# Get document by UUID
curl -X GET https://api.pdfmodule.com/v1/documents/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer pm_live_xxxxx"

# Download PDF file
curl -X GET https://api.pdfmodule.com/v1/documents/550e8400.../download \
  -H "Authorization: Bearer pm_live_xxxxx" \
  -o document.pdf
Account & Usage
# Get current user info
curl -X GET https://api.pdfmodule.com/v1/auth/me \
  -H "Authorization: Bearer pm_live_xxxxx"

# Get usage statistics
curl -X GET https://api.pdfmodule.com/v1/account/usage \
  -H "Authorization: Bearer pm_live_xxxxx"

# Response:
# {
#   "pdfs_used_this_month": 1234,
#   "pdf_limit": 5000,
#   "plan": "production",
#   "billing_cycle_start": "2024-01-01"
# }

# List API keys
curl -X GET https://api.pdfmodule.com/v1/account/api-keys \
  -H "Authorization: Bearer pm_live_xxxxx"