Mayank Tiwari

Integration · Case study

FastBill ↔ Pipedrive Invoicing App

A Pipedrive app that shows FastBill invoices and payment status right inside Pipedrive deals.

The challenge

A German client's sales team worked in Pipedrive but invoices lived in FastBill, so checking what was billed or paid meant switching tools.

What I built

Built a Pipedrive marketplace-style app with OAuth connections, a custom panel in the deal view, webhook handling, scheduled sync jobs and Stripe subscription billing, deployed with zero-downtime scripts and covered by Playwright browser tests.

Results

  • Invoices and payment status visible inside Pipedrive deals
  • OAuth, webhooks and scheduled sync jobs
  • Stripe subscription billing for app users
  • Zero-downtime deploys and end-to-end browser tests

Tech stack

  • Next.js
  • TypeScript
  • Prisma
  • PostgreSQL
  • Stripe
  • Pipedrive API

Code sketch

A simplified illustration of the core logic, not production code.

// Pipedrive panel: invoices for the open deal
export async function getDealInvoices(dealId: number, account: Account) {
  // Map the Pipedrive deal to its FastBill customer
  const customer = await db.customerLink.findFirst({
    where: { accountId: account.id, dealId }
  });
  if (!customer) return { invoices: [] };

  // Fetch invoices from FastBill
  const invoices = await fastbill.invoices.list({
    customerId: customer.fastbillId
  });

  return {
    invoices: invoices.map(inv => ({
      number: inv.number,
      total: inv.total,
      status: inv.paid ? 'paid' : 'open',
      dueDate: inv.dueDate
    }))
  };
}

Related services

More Integration case studies

Need something similar?

Tell me which systems are involved and what should happen between them.