Learn Build Community Opportunities Hosted n8n Blog About Careers Contact Log in

Home / Blog / Explainer

Explainer

Collect Rent Through Paystack and Issue Receipts with n8n

An Arena brief about a property manager drowning in Paystack emails, and how to design an n8n system that issues every receipt once, in minutes.

This Arena brief asks builders to collect rent through Paystack and issue receipts automatically with n8n for a property management agency in Abuja. Every payment should be recorded once, matched to the right unit, written to the ledger and receipted by email and WhatsApp within minutes, instead of the ten days it takes by hand today.

The business behind the brief

The brief describes ShelterCraft Property Managers, a scenario we wrote for the Arena, which manages 120 residential and commercial units across Wuse 2, Maitama and Gwarinpa. Annual rent runs from ₦1,500,000 to ₦6,500,000 a unit, with service charges of ₦50,000 to ₦150,000 a month, all paid through Paystack payment links and card charges.

The money arrives fine. The paperwork does not. Paystack notification emails land in a shared inbox, two estate officers match references against Excel by hand, type receipts in Word and email them as PDFs. The brief lists what goes wrong: Paystack retries and tenant re-submissions create duplicate receipts and double counting, receipts take up to 10 days in renewal season, and more than 35 staff hours a month go on data entry. That is the real cost: tenants who paid millions of naira and cannot get proof of it.

What the automation has to do

Stripped to its job, the system must turn one Paystack event into exactly one ledger entry and one receipt, every time, even when Paystack sends the same event three times. Around that core sit the things a property manager actually needs:

  • Confirm the payment belongs to a real unit and tenant before recording anything.
  • Keep two ledgers in step: Supabase as the source of truth and a Google Sheet the office can read.
  • Send a receipt by Gmail and a short confirmation by WhatsApp through GreenAPI.
  • Catch every failure somewhere a human will see it, instead of losing it in an execution log.

How to approach the build

  1. Answer Paystack immediately. Set the Webhook node's Respond option to Immediately. Paystack keeps retrying a webhook that does not get a quick 2xx response, and each retry is a chance to double count. Acknowledge first, work second.
  2. Verify the request is really from Paystack. Paystack signs each webhook with an HMAC SHA512 of the raw body, sent in the x-paystack-signature header. Turn on the Webhook node's raw body option and check the signature in a Code node before trusting a single field. The brief does not grade this step, but a client handing you their rent flow will expect it.
  3. Canonicalise, then hash. Pull out the event, reference, unit code, email and amount, trim and uppercase the text, convert kobo to naira with two decimal places, join them in a fixed order and hash the result with SHA256. The same payment always produces the same hash, however Paystack formats the retry.
  4. Check for the hash before doing anything else. Look it up in the rent_payments table. If it exists, log the duplicate to audit_logs and stop. Back this with a unique constraint on the transaction reference in Supabase, so two executions racing each other cannot both insert.
  5. Verify the unit and tenant. Fetch the property by unit code. If it does not exist, throw a clear error rather than writing a payment against nothing. Thrown errors are what the error workflow is for.
  6. Write the ledgers, then receipt. Insert into Supabase first, append to the RentLedger sheet second, and only then send the email and WhatsApp message. If sending fails, the money is still recorded, and a retry can resend the receipt without recording the payment twice.
  7. Route failures to an Error Trigger workflow. Build a second workflow that starts with the Error Trigger node, select it under the main workflow's settings as its error workflow, and have it write to payment_exceptions and alert the office.

The hard parts

Deciding what makes two payments the same

Hashing is easy. Choosing what goes into the hash is the real decision. Include too little and two genuine part-payments from one tenant look like a duplicate; include a timestamp and every retry looks new. The brief's choice, event, reference, unit, email and amount, works because the Paystack reference is unique per transaction. Write down why you chose your fields: graders and clients both ask.

Receipt numbers

Receipts need numbers that never repeat and never skip without explanation. Counting existing rows breaks the moment two payments arrive together. Generate the number from a database sequence or the inserted row's ID, so Supabase guarantees uniqueness rather than your workflow.

Money in kobo

Paystack sends amounts in kobo. A receipt for ₦150,000,000 instead of ₦1,500,000 is the kind of mistake that ends a client relationship. Convert once, in one place, and use the converted value everywhere after.

What our graders look for

The rubric splits the brief into four equal parts, and each maps to something a client would test:

  • Webhook ingestion, SHA256 deduplication and flow control (25%). Send the same payload twice and only one payment appears. This is the whole reason the client is paying.
  • Tenant verification and dual ledger sync (25%). Supabase and the sheet agree, and an unknown unit is rejected instead of recorded.
  • Receipting by Gmail and WhatsApp (25%). The tenant gets proof quickly, in the channel they actually read.
  • Error handling and documentation (25%). Failures land in a table someone checks, and the notes explain how to operate the system.

Pricing and pitching this job

The brief puts this at USD 1,200 to 2,500 for setup plus a USD 400 to 800 monthly retainer. The retainer is justified: Paystack payloads change, credentials expire and the agency will want new reports. Pitch it in the client's terms. Do not sell "SHA256 deduplication". Sell "every tenant gets a correct receipt within minutes, and no payment is ever counted twice", then show the duplicate test running live.

New Arena briefs drop every Monday in the app at app.automatenaija.com, and every Beginner brief is free, so pick one and build it this week.

Frequently asked questions

How do I stop duplicate Paystack webhooks in n8n?

Respond to the webhook immediately so Paystack stops retrying, then build a hash or use the transaction reference as a unique key. Check Supabase for that key before recording anything, and add a unique constraint so two runs at the same moment cannot both insert. Log every duplicate you skip so you can prove nothing was lost.

Do I need to verify the Paystack webhook signature?

Yes, for any real client. Paystack signs each webhook with an HMAC SHA512 of the raw request body using your secret key and sends it in the x-paystack-signature header. Recompute it in a Code node and reject requests that do not match, otherwise anyone who finds your webhook URL could record fake rent payments.

Why keep both Supabase and Google Sheets?

Supabase is the source of truth: it enforces unique references and keeps a proper audit trail. The Google Sheet is for the office staff, who already live in spreadsheets and need to see payments without logging into a database. Write to Supabase first so the sheet can always be rebuilt from it if the two ever disagree.

What should happen when a payment has an unknown unit code?

Do not record it against nothing. Throw a clear error so the Error Trigger workflow logs it to a payment exceptions table and alerts staff. A person then finds the right unit, often a typo in the payment link metadata, and replays the payment. The tenant still gets a receipt, just after a human check.


Build it with us. The community is free and the build track teaches this kind of automation week by week: see pricing or join the community.

Comments

Questions, corrections and your own experience are welcome. Comments are posted by members in the Automate Naija community and moderated there.

Loading comments...

Add a comment

Keep reading

More guides on building, fixing and shipping automations with n8n, Make and Zapier.