$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
PaymentsintermediateNew

Invoice System

Share

Build invoice generation and management system

Works with OpenClaude

You are a backend developer building a production-ready invoice system. The user wants to create a complete invoice generation and management system with storage, PDF export, and payment tracking.

What to check first

  • Verify you have a database set up (PostgreSQL recommended) with migration tools like Prisma or Sequelize
  • Check that you have pdfkit or puppeteer available: npm list pdfkit puppeteer
  • Confirm Node.js version is 16+ with node --version

Steps

  1. Install required dependencies: npm install express prisma @prisma/client pdfkit uuid dotenv stripe for Stripe integration
  2. Define your Prisma schema with Invoice, InvoiceItem, and Customer models including timestamps and status fields
  3. Create a database migration with npx prisma migrate dev --name init_invoice_schema
  4. Build the invoice controller with methods: createInvoice(), getInvoiceById(), listInvoices(), updateInvoiceStatus()
  5. Implement PDF generation using pdfkit with invoice.generatePDF() that iterates through invoice items and calculates totals
  6. Add invoice item calculations in the model: subtotal, tax amount (use tax_rate * subtotal), and total due
  7. Create routes for POST /invoices, GET /invoices/:id, GET /invoices, PATCH /invoices/:id/status
  8. Implement soft delete for invoices by adding deleted_at timestamp and filtering archived invoices in queries

Code

import express from 'express';
import { PrismaClient } from '@prisma/client';
import PDFDocument from 'pdfkit';
import { v4 as uuidv4 } from 'uuid';
import fs from 'fs';

const app = express();
const prisma = new PrismaClient();
app.use(express.json());

// Create invoice with items
app.post('/invoices', async (req, res) => {
  try {
    const { customerId, items, taxRate = 0.10, dueDate } = req.body;
    
    const subtotal = items.reduce((sum, item) => sum + (item.quantity * item.unitPrice), 0);
    const taxAmount = subtotal * taxRate;
    const totalAmount = subtotal + taxAmount;

    const invoice = await prisma.invoice.create({
      data: {
        invoiceNumber: `INV-${Date.now()}-${uuidv4().slice(0, 8)}`,
        customerId,
        subtotal,
        taxAmount,
        totalAmount,
        taxRate,
        status: 'DRAFT',
        dueDate: new Date(dueDate),
        items: {
          create: items.map(item => ({
            description: item.description,
            quantity: item.quantity,
            unitPrice: item.unitPrice,
            lineTotal

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategoryPayments
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
paymentsinvoicesbilling

Install command:

curl -o ~/.claude/skills/invoice-system.md https://claude-skills-hub.vercel.app/skills/payments/invoice-system.md

Related Payments Skills

Other Claude Code skills in the same category — free to download.

Want a Payments skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.