PDF Purchase Order Generator

/api/purchaseorder 2 credit(s) per call

Generate professional PDF purchase orders with line items, addresses, and tax calculations.

Overview

The PDF Purchase Order Generator creates professional PDF purchase orders from structured JSON data. Include buyer and vendor information, a shipping address, line items with prices and quantities, tax rates, and delivery dates.

Endpoint

POST /api/purchaseorder

Request Body

Field Type Required Description
orderNumber int No Order number (auto-generated if omitted)
issueDate string No Issue date (ISO 8601, defaults to today)
expectedDeliveryDate string No Expected delivery date (ISO 8601, defaults to 14 days from now)
buyer object No Buyer info (name, addressLines, email, phone)
vendor object No Vendor info (same fields as buyer)
shippingAddress object No Shipping address (name, addressLines)
items array Yes Line items (each: name, price, quantity)
taxRate decimal No Tax rate as a percentage (0–100, e.g. 8 for 8%)
notes string No Optional notes or special instructions
logoUrl string No URL of the logo image (PNG, JPG, SVG) rendered in the header
accentColor string No Hex color for purchase order 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 purchase order:

curl -X POST https://simplewebapis.com/api/purchaseorder \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: swa_your_key" \
  -d '{
    "orderNumber": 1001,
    "buyer": { "name": "Acme Corp", "addressLines": ["123 Buyer St", "San Francisco, CA 94105"], "email": "[email protected]" },
    "vendor": { "name": "Globex Inc", "addressLines": ["456 Vendor Ave", "New York, NY 10001"], "email": "[email protected]" },
    "shippingAddress": { "name": "Acme Corp", "addressLines": ["123 Buyer St", "San Francisco, CA 94105"] },
    "items": [
      { "name": "Office Chairs", "price": 450.00, "quantity": 10 },
      { "name": "Standing Desks", "price": 800.00, "quantity": 5 }
    ],
    "taxRate": 0.08,
    "notes": "Please deliver to the loading dock on the east side.",
    "currency": "USD",
    "logoUrl": "https://simplewebapis.com/favicon-32x32.png",
    "accentColor": "#2563EB",
    "separatorColor": "#E5E7EB",
    "notesBackgroundColor": "#F9FAFB"
  }' --output purchase-order.pdf

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

Try it out

Use the Playground to test this API live.