← Projects

Car-rental booking & billing platformWork project

2024 · Siam Orchard Group

The backend behind a car-rental and tour business in Japan. A booking turns into a quotation, deposit, invoice, payment and receipt on its own, so staff stopped typing documents by hand.

100+REST endpoints
50%less manual document work
7document types created automatically
Dailycheck of every payment against the gateway
  • NestJS 11 + Fastify
  • TypeScript
  • MongoDB / Mongoose
  • Zod
  • INET Payment Gateway
  • React-PDF
  • LINE Messaging API
  • Google Sheets
  • Mailchimp
  • Sentry
  • Vercel

What I built

  • Built the backend for a car-rental booking and billing platform with 100+ REST endpoints, cutting manual document work by 50%
  • Integrated the INET payment gateway (QR and card), using an IP whitelist and idempotent callback handling, plus a daily reconciliation job that checks every payment against the gateway and fixes stuck transactions automatically
  • Automated the full accounting document flow (quotation, deposit, invoice, receipt, debit/credit notes, vouchers): PDF generation, email delivery, running numbers, and status cascading from bookings to related documents
  • Built a customer data platform that merges records across bookings and documents (normalized phone/email/tax ID/name matching), with confidence-ranked duplicate detection and an idempotent daily sync
  • Integrated LINE Messaging, Google Sheets and Mailchimp, and added Sentry monitoring and API audit logging that masks sensitive data
  • Moved the API from Next.js route handlers to NestJS 11 on Fastify, verified end to end: booking, invoice, deposit, payment callback, automatic receipt and email

The problem

The business rents cars and sells tours in Japan to Thai customers. Bookings came in over LINE, email and phone and lived in spreadsheets. Staff worked out prices, typed invoices and receipts by hand, and checked payments one by one. Bookings slipped through, and customers called to ask for documents.

From booking to paperwork

One flow from booking to paperwork. A customer books on the website; staff confirm it in the back office; the system creates the quotation, deposit request or invoice from the booking, the customer pays by QR or card through the INET gateway, and the gateway’s callback marks the payment, issues the receipt and voucher as PDFs and emails them. Changing a booking’s status carries through to every document that belongs to it.

I gathered the requirements with the business team and the payment provider, wrote the specs, and built and deployed the API. The back office and the public site call it.

How it is put together

  • MongoDB with Mongoose. Documents keep a snapshot of what they were issued with, because a financial document has to stay as it was printed.
  • Payments. The callback route accepts only the gateway’s IP addresses and handles a repeated callback without issuing a second receipt. A reconciliation job covers the callbacks that never arrive.
  • Customers. Records from bookings and every document type are matched on normalized phone, email, tax ID and name into one profile with its service history.
  • Operations. Sentry for errors, an audit log of API calls with sensitive fields masked, and a bot check on the public booking form.

The API started as Next.js route handlers. I moved it to NestJS 11 on Fastify.

Other projects