Invoice PDFs from Stripe payments, in n8n

Stripe's own invoices are fine until you need your layout, your numbering, or a language Stripe doesn't print. This workflow builds the PDF from the payment and emails or stores it, in about ten minutes.

  1. 1

    Pick the Invoice starter

    Sign up free, choose the Invoice starter, and change the logo, colors, and footer in the editor. Publish it. The editor shows the exact fields the template expects.

  2. 2

    Install the community node

    In n8n go to Settings → Community nodes → Install and enter the package name. Add your live API key as a credential.

    n8n-nodes-docspout
  3. 3

    Trigger on payment

    Add a Stripe Trigger node on the checkout.session.completed event, then a Stripe node that fetches the session's line items.

  4. 4

    Map the fields

    Add the Docspout node, choose Render PDF and your Invoice template. Each template field appears as an input; map them from the Stripe data. Amounts in Stripe are in cents, so divide by 100.

    {
      "number": "{{ $json.invoice ?? $json.id }}",
      "customer": { "name": "{{ $json.customer_details.name }}", "email": "{{ $json.customer_details.email }}" },
      "issued": "{{ $now.toISODate() }}",
      "items": "{{ $('Line items').all().map(i => ({ name: i.json.description, qty: i.json.quantity, price: i.json.price.unit_amount / 100, amount: i.json.amount_total / 100 })) }}",
      "total": "{{ $json.amount_total / 100 }}"
    }
  5. 5

    Send it

    Set Output to PDF as Binary Data and connect a Gmail or Send Email node with the file attached, or upload it to Google Drive. The node sends an idempotency key for each execution and item, so when n8n's Retry On Fail kicks in you get the same PDF back, not a second one.

More workflows

Send your first PDF in two minutes.

100 documents a month free. No card.

Start free