How to Create an Automated Invoice System with n8n and Paystack

Manual invoicing is one of the biggest drains on a growing business. You close a deal, then spend the next twenty minutes formatting a PDF, attaching it to an email, waiting for payment, manually checking your bank account, and sending a receipt. Multiply that by every deal and you have lost hours each week — hours that should go into selling, building, and serving customers.

An automated invoice system eliminates all of that. When a deal is marked as won, n8n generates the invoice, sends it to the customer via email and WhatsApp, creates a Paystack payment link, monitors the transaction, and fires off a receipt the moment the payment clears. If the invoice goes unpaid, the system follows up automatically — no reminders needed on your end.

In this guide, you will build that exact system using n8n and Paystack. Every step is explained in plain terms, with the exact node configuration you need. By the end, you will have a production-ready invoice automation workflow running in your own n8n instance.

Already have n8n?

The Selazone Automation Vault includes a pre-built invoice generator workflow and a payment receipt workflow — both fully configured for Paystack. You can import them in under two minutes. Get the vault here.

What You Will Build

Here is the full automation flow you will create in this tutorial:

Deal Won (Webhook/CRM) Generate Invoice PDF Send Invoice (Email + WhatsApp) Create Paystack Payment Link Wait for Payment Send Receipt

Each stage is a separate block of n8n nodes. You can wire them together in a single workflow or split them across multiple workflows connected by webhooks. This tutorial assumes a single workflow for clarity.

Prerequisites

Paystack first

If you do not have a Paystack account yet, sign up at paystack.com. It is free to create an account. You will need your live secret key (or test secret key for sandbox mode) from the Settings → API Keys & Webhooks page.

Step 1: Trigger the Workflow from a New Deal

The first node in any invoice automation workflow is the trigger. You want the workflow to fire automatically when a deal is won in your CRM or when a new row appears in your deal-tracking spreadsheet.

n8n gives you several trigger options:

Whichever trigger you choose, the data coming into the workflow should include the customer name, email, phone number, deal value, invoice number (or a unique identifier you can use), and a line-item description of what was sold.

Step 2: Generate the Invoice PDF

Once the trigger fires, you need to produce a professional invoice PDF. n8n does not have a built-in PDF generator, but you have two practical options:

Option A: HTML + Puppeteer (Recommended)

Use an HTML node to construct an invoice template using HTML and inline CSS, then pass that HTML to a Puppeteer node that converts it to PDF. This approach gives you full control over the invoice layout — your logo, your fonts, your color scheme.

Your HTML template should include:

Option B: Invoice API Service

Use an HTTP Request node to send the invoice data to a service like Invoice Ninja, Invoice Simple, or a self-hosted PDF generation API. The API returns a PDF URL or base64-encoded PDF that you can attach to your email.

For this guide, we assume Option A (HTML + Puppeteer). It is free, self-contained, and gives you full control.

Pro tip

Store your invoice HTML template as an n8n code node with the template stored in a variable. This keeps the invoice design separate from the workflow logic and makes it easy to update later.

Step 3: Send the Invoice via Email

With the PDF generated, the next step is delivering it to the customer. Use n8n's Gmail node (or the SMTP node for any email provider) to send the invoice as an attachment.

Configure the email node as follows:

If you use Gmail, you will need to set up OAuth credentials in n8n. For SMTP, you need your email host, port, and credentials. Both are secure — n8n encrypts credential data at rest.

Step 4: Send the Invoice via WhatsApp

Email alone is not enough. Customers in markets like Nigeria, Kenya, Ghana, and South Africa often respond faster to WhatsApp messages than to email. Adding a WhatsApp delivery channel dramatically improves the chances that your invoice is seen and paid promptly.

Use n8n's WhatsApp Business node (powered by Twilio) to send the invoice as a message:

WhatsApp setup

WhatsApp Business API requires a Twilio account and a WhatsApp Business profile approved by Meta. The setup takes about 24–48 hours for full approval. You can use the Twilio WhatsApp Sandbox to test immediately.

Step 5: Generate a Paystack Payment Link

This is the core of your Paystack invoice integration. You will use n8n's HTTP Request node to call the Paystack Transaction API and generate a payment link that the customer can click to pay securely.

Here is the exact HTTP request configuration:

Important: Paystack accepts amounts in kobo (the smallest currency unit). Multiply your invoice total by 100. For example, an invoice of ₦5,000 becomes 500000 in the API call.

The API response contains an authorization_url field. This is the payment link you embed in the invoice email and WhatsApp message. When the customer clicks it, they are taken to a Paystack checkout page where they can pay with a card, bank transfer, USSD, or mobile money — depending on their currency and region.

Step 6: Confirm Payment and Send Receipt

Generating a payment link is only half the picture. Your automated billing system must also detect when the payment succeeds and respond accordingly.

There are two ways to do this in n8n:

Option A: Paystack Webhook (Recommended for Production)

Create a second n8n workflow that starts with a Webhook node. In your Paystack dashboard, go to Settings → Webhooks and add the webhook URL pointing to your n8n workflow. Paystack will send a POST request to that URL every time a transaction status changes.

In the workflow, filter for events where event equals charge.success. Extract the transaction reference, customer email, and amount from the payload. Then:

Option B: Polling with n8n (For Simpler Setups)

If you cannot configure webhooks, use an n8n Schedule trigger that runs every 15 minutes. For each unpaid invoice, call the Paystack transaction/verify/:reference endpoint to check the status. If the status is success, proceed with the receipt and update flow.

Option A is preferred because it is real-time and does not waste API calls. But Option B works fine for low-volume setups.

Receipt payload

Your receipt should include: the paid invoice number, the amount paid, the payment method used (card, bank transfer, USSD), the transaction reference from Paystack, and a thank-you message. Attach it as a PDF and send it via both email and WhatsApp.

Step 7: Automate Follow-Up Reminders for Unpaid Invoices

Not every invoice gets paid on the first try. A professional automated invoice system handles this gracefully with timed follow-ups.

Here is a three-stage reminder sequence you can build in n8n:

Reminder 1 — Day 3

Gentle nudge

"Hi [Name], this is a friendly reminder that invoice #[number] for [amount] is due. You can pay securely here: [Paystack link]. Let us know if you have any questions."

Reminder 2 — Day 7

Firmer follow-up

"Hi [Name], invoice #[number] is now [X] days overdue. Please arrange payment at your earliest convenience to avoid service interruption. Pay here: [Paystack link]."

Reminder 3 — Day 14

Final notice + escalation

"Final notice: invoice #[number] is [X] days overdue. If payment is not received within 48 hours, your account will be suspended. Pay now: [Paystack link]. Reply to this email if you need to discuss payment arrangements."

To build this in n8n, use a Schedule trigger that runs daily. Query your unpaid invoices (from a Google Sheet, database, or n8n's internal data store). For each invoice that is past due, calculate the days overdue and decide which reminder to send based on the threshold. Send the appropriate message and log the reminder date so you do not send duplicates.

Smart reminder logic

Add a "reminder level" column to your invoice tracking sheet. Each time a reminder is sent, increment the value. The daily check workflow only sends a reminder if the current level matches the overdue threshold. This prevents duplicate messages.

Tying It All Together: The Complete Workflow Map

Here is what your final n8n invoice automation workflow looks like at a high level:

CRM Trigger Build HTML Invoice Puppeteer PDF Email Invoice WhatsApp Invoice Paystack Link

And the separate webhook listener for payment confirmation:

Paystack Webhook Verify Signature Mark Paid Generate Receipt Send Receipt

And the daily reminder sweep:

Schedule (Daily) Fetch Unpaid Invoices Check Overdue Days Send Appropriate Reminder

Why This Matters for Your Business

An automated invoice system is not just a convenience — it directly impacts your cash flow and customer experience. When invoices go out within seconds of a deal closing, customers perceive your business as professional and organized. When they can pay with a single click on a Paystack link, friction disappears. When receipts arrive automatically, support tickets about payment status drop to zero.

Businesses that implement automated billing with n8n and Paystack report an average reduction in days-sales-outstanding (DSO) of 40–60%. That means you get paid weeks faster without lifting a finger.

The n8n invoice generator workflow you just built handles the entire lifecycle: create, send, collect, confirm, and follow up. It is a complete accounts receivable department running on a single automation instance.

Go Further with the Selazone Automation Vault

Building this workflow from scratch is a valuable exercise. But if you want to go live in under 10 minutes — with professional invoice templates, pre-configured Paystack nodes, and battle-tested error handling — the Selazone Automation Vault has you covered.

The vault includes two workflows that directly apply to this tutorial:

Plus 34 other production-grade n8n workflows across lead generation, sales, marketing, AI agents, customer support, operations, and HR — each with documentation, credential mappings, and 200 AI prompts to accelerate your automation stack.

Automate Your Invoicing in Under 10 Minutes

Get the Invoice Generator + Payment Receipt workflows — and 34 more — in the Selazone Automation Vault. Import, configure, and go live today.

Buy the Automation Vault →