Skip to main content

Sending an Invoice by Email

curl -X POST https://api.fluxrate.co/api/v1/invoices/<invoice_id>/send-email \
  -H "Cookie: access_token=<token>"
This will:
  1. Generate a PDF of the invoice
  2. If the invoice is in DRAFT, automatically finalize it to OPEN
  3. Generate a payment link (if a payment gateway is configured)
  4. Email the customer with the invoice PDF and payment link attached

Response

{
  "success": true,
  "message": "Invoice email sent successfully",
  "payment_link": "https://checkout.stripe.com/..."
}

Email Configuration

Configure SMTP settings in Dashboard → Settings → Email:
SettingDescription
SMTP HostYour email server hostname
SMTP PortPort (usually 587 for TLS)
SMTP UsernameAuthentication username
SMTP PasswordAuthentication password
From EmailSender email address
From NameSender display name
If SMTP is not configured, sending emails will return success: false. The invoice itself is still finalized.

Finalization (Without Email)

To finalize an invoice without sending email:
POST /api/v1/invoices/<invoice_id>/finalize
This transitions DRAFTOPEN and generates a payment link if a gateway is configured.

PDF Generation

Fluxrate generates professional PDF invoices that include:
  • Your organization’s logo and branding
  • Customer billing details
  • Itemized line items
  • Tax breakdown
  • Total due
  • Bank payment information (if configured)
  • Payment link

Automatic Email on Finalization

When the background worker finalizes invoices (after the 1-hour grace period), it automatically sends an email notification to the customer. This behavior is configurable per organization.

Payment Integrations

Connect a payment gateway in Settings → Integrations to automatically generate payment links that are included in emails and the public invoice page. Supported gateways:
  • Stripe — Generates Stripe Checkout links
  • Razorpay — Generates Razorpay payment links
  • Chargebee — Integrates with Chargebee billing