PDF Receipt Generator

/api/receipt 2 credit(s) per call

Generate professional PDF receipts with line items, payment details, and custom styling.

Overview

The PDF Receipt Generator creates professional PDF receipts from structured JSON data. Include seller and customer addresses, line items with prices and quantities, payment details, tax information, and custom styling.

Endpoint

POST /api/receipt

Request Body

Field Type Required Description
receiptNumber int No Receipt number (auto-generated if omitted)
date string No Receipt date (ISO 8601, defaults to today)
seller object No Seller info (name, addressLines, email, phone)
customer object No Customer info (same fields as seller)
items array Yes Line items (each: name, price, quantity)
amountPaid decimal No Amount paid (calculated from items if omitted)
paymentMethod string No Payment method (e.g. "Credit Card", "Cash", "PayPal")
transactionId string No Transaction or reference ID
taxAmount decimal No Tax amount added to the total
comments string No Optional comments or notes
logoUrl string No URL of the logo image (PNG, JPG, SVG) rendered in the header
accentColor string No Hex color for receipt heading and label (default: #3B82F6)
textColor string No Hex color for primary text (default: #1F2937)
mutedTextColor string No Hex color for secondary/muted text (default: #6B7280)
separatorColor string No Hex color for table row borders and address underlines (default: #E5E7EB)
notesBackgroundColor string No Hex color for the notes box background (default: #F3F4F6)
currency string No ISO 4217 currency code (e.g. "USD", "EUR", "GBP"). Defaults to "USD"

Example

Generate a PDF receipt:

curl -X POST https://simplewebapis.com/api/receipt \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: swa_your_key" \
  -d '{
    "receiptNumber": 5001,
    "date": "2025-07-15",
    "seller": { "name": "Acme Corp", "addressLines": ["123 Seller St", "San Francisco, CA 94105"], "email": "[email protected]" },
    "customer": { "name": "Globex Inc", "addressLines": ["456 Customer Ave", "New York, NY 10001"], "email": "[email protected]" },
    "items": [
      { "name": "Web Development", "price": 1500.00, "quantity": 1 },
      { "name": "UI Design", "price": 800.00, "quantity": 2 }
    ],
    "amountPaid": 3100.00,
    "paymentMethod": "Credit Card",
    "transactionId": "TXN-2025-0715-001",
    "taxAmount": 240.00,
    "comments": "Thank you for your purchase!",
    "currency": "USD",
    "logoUrl": "https://simplewebapis.com/favicon-32x32.png",
    "accentColor": "#2563EB",
    "separatorColor": "#E5E7EB",
    "notesBackgroundColor": "#F9FAFB"
  }' --output receipt.pdf

The response is a PDF document (Content-Type: application/pdf).

Try it out

Use the Playground to test this API live.