Use case

Turn Stripe Payment Data Into Receipt PDFs Automatically

Stripe gives you a payment object. Your customer wants a receipt PDF. Right now you're either paying for a receipts add-on you don't need the rest of, or you've half-built an HTML-to-PDF pipeline that breaks every time Chromium updates.

Send the payment data as JSON, get a receipt PDF back.

Example request

terminal
curl -X POST "https://pdfapi-nu.vercel.app/api/v1/generate" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "receipt",
    "data": {
      "merchant": "Acme Co.",
      "date": "2026-07-08",
      "items": [
        {"description": "Pro Plan — Monthly", "amount": 29.00}
      ],
      "amountPaid": 29.00,
      "last4": "4242"
    }
  }' \
  -o receipt.pdf

Where this fits in a Stripe integration

On payment_intent.succeeded or charge.succeeded webhook

Map the Stripe event data into the receipt schema, call the API, attach the resulting PDF to your confirmation email. This is the most common pattern — receipts generated the moment payment clears, with no manual step.

On-demand from a customer portal

"Download receipt" button on a past transaction calls a server route, which calls this API, which streams the PDF back. No need to store every receipt PDF in advance — generate on request.

For marketplaces and platforms

If you're processing payments on behalf of sellers/vendors (Stripe Connect), you can generate consistent, branded receipts across all of them from the same schema, regardless of how each seller's own system is set up.

Why not just use Stripe's built-in receipts?

Stripe's hosted receipts work fine for a lot of cases, but they're Stripe-branded and Stripe-hosted. If you need your own branding, a specific layout, or a receipt that matches the visual language of the rest of your product (and your invoices, generated from the same API), a dedicated template you control is the more consistent option — without building the rendering pipeline yourself.

Pricing

Free tier: 200 calls/month, no credit card required. Paid tiers start at $29/month.

View pricing

Frequently asked questions

Can I trigger this directly from a Stripe webhook?

Yes — map the fields from your Stripe event object (merchant name, line items, amount paid, last 4 of the card) into the receipt schema and call the API server-side when the webhook fires.

What fields does the receipt template expect?

Merchant name, date, item lines (as text), amount paid, and the last four digits of the payment method.

Can I use this for refund receipts too, not just payment receipts?

The receipt template is built around a merchant/date/items/amount-paid structure, so it can represent a refund if you pass the appropriate line items and amount — check the docs for the recommended pattern.

Is this PCI-relevant since it involves card data?

Only the last 4 digits of the card are used — no full card numbers or sensitive payment credentials are ever part of the request.