Skip to main content
Modem Pay automatically determines your invoice type based on the data you provide.

Simple Invoices

Simple invoices contain a single total amount without itemized breakdown. They’re automatically created when you don’t include line items.

When to Use Simple Invoices

  • Fixed Subscription Plans - Monthly/annual fees
  • Membership Dues - Gym memberships, club fees
  • Service Subscriptions - SaaS with flat-rate pricing
  • Donations - Single amount payments
  • Simple Service Fees - Consulting retainers

Example: Monthly SaaS Subscription

const invoice = await modempay.invoices.create({
  amount: 2500,
  customer_email: "user@modempay.com",
  customer_name: "Modem Pay Inc", 
  due_date: "2025-12-31",
  notes: "Pro Plan - December 2025"
});

With Discounts

const invoice = await modempay.invoices.create({
  amount: 5000,
  customer: "b7ca54db-a2ad-4153-8603-d8873dbffc2d",
  discount: {
    type: "percentage",
    amount: 20 // 20% discount
  }
});

// Calculation:
// Subtotal: 5000
// Discount: 1000 (20% of 5000) 
// Total: 4000
For simple invoices, the amount becomes the subtotal, and discounts calculate the final total.

Professional Invoices

Professional invoices include detailed line items. They’re automatically created when you include the line_items array.

When to Use Professional Invoices

  • Usage-Based Billing - Metered services, API calls
  • Multi-Product Subscriptions - Bundles with multiple components
  • Tiered Pricing - Base fee + overage charges
  • Product Sales - E-commerce with multiple items
  • Transparent Pricing - When customers need breakdowns

Example: Usage-Based Subscription

const invoice = await modempay.invoices.create({
  amount: 0,
  customer_email: "api-customer@tech.com",
  customer_name: "Tech Guru",
  line_items: [
    {
      item: "API Calls",
      quantity: 150000,
      unit_price: 0.02
    },
    {
      item: "Storage (GB)",
      quantity: 50,
      unit_price: 100
    },
    {
      item: "Pro Plan Base Fee",
      quantity: 1, 
      unit_price: 2000
    }
  ]
});

// Auto-calculated:
// API Calls: 150,000 × 0.02 = 3000
// Storage: 50 × 100 = 5000  
// Base Fee: 1 × 2000 = 2000
// Total: 10,000
The amount parameter is ignored when line items are present. Total is calculated from line items.

Discount Types

Percentage Discount

{
  discount: {
    type: "percentage",
    amount: 15 // 15% off
  }
}

Fixed Amount Discount

{
  discount: {
    type: "fixed", 
    amount: 500 // 500 off
  }
}

Choosing the Right Type

Simple Invoice Checklist
  • Single product/service
  • Fixed, predictable pricing
  • No itemization needed
  • Flat subscription fee
Professional Invoice Checklist
  • Multiple products/services
  • Usage-based or metered billing
  • Customer needs breakdown
  • Variable pricing