Invoice Collector MCP avatar
Invoice Collector MCP

Pricing

Pay per event

Go to Apify Store
Invoice Collector MCP

Invoice Collector MCP

Automates invoice collection from Razorpay, PayPal, and Stripe. Generates PDF/JSON exports, emails reports automatically, and supports AI-ready MCP mode for agent workflows.

Pricing

Pay per event

Rating

0.0

(0)

Developer

lalithhh

lalithhh

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

6 days ago

Last modified

Share

πŸš€ InvoiceCollector MCP β€” Unified Invoice Automation for Razorpay, PayPal & Stripe

InvoiceCollector MCP is a production-grade automation tool designed for businesses, accountants, SaaS vendors, and AI agents who need a fully automated pipeline to fetch, organize, export, and deliver invoices from multiple payment platforms.

It works in two powerful modes:

  • NORMAL MODE β†’ Bulk-fetch invoices (PDF/JSON) from selected platforms
  • MCP MODE β†’ Runs as a WebSocket MCP server so AI agents (ChatGPT, Claude, LangChain, custom tools) can call it programmatically

Whether you're reconciling payments, filing GST, preparing financial reports, or integrating AI workflows β€” this Actor gives you a complete, automated invoice pipeline.


⭐ Why This Actor Exists

Modern businesses use multiple payment platforms.
But invoices are scattered, inconsistent, and hard to download in bulk.

πŸ›‘ Razorpay doesn’t provide unified bulk exports
πŸ›‘ Stripe splits charges, payments, and invoices across APIs
πŸ›‘ PayPal separates Invoicing API vs Reporting API
πŸ›‘ No single dashboard fetches everything
πŸ›‘ No AI-ready automation framework existed… until now

InvoiceCollector MCP solves this.

It provides:

  • Unified fetch across platforms
  • Bulk PDF download
  • JSON summaries for missing PDFs
  • Optional email delivery
  • MCP server automation for AI tools

✨ Key Features

βœ… 3-in-1 Platform Support

No scraping β€” 100% official API integrations.

PlatformFetch TypePDF SupportNotes
RazorpayPayments / Invoicesβœ” YesFastest, stable
PayPalInvoicing API + Reportsβœ” YesThick records
StripeCharges + Hosted Invoicesβœ” YesBest metadata

βœ… Full Invoice Automation Pipeline

βœ” Authenticate
βœ” Fetch date-range transactions
βœ” Download invoice PDFs
βœ” Save JSON summaries when PDFs missing
βœ” Upload results to KV store
βœ” (Optional) Email all invoices
βœ” Return unified flattened output


βœ… AI Automation Ready (MCP Mode)

Run as a WebSocket MCP server the same way ChatGPT tools work:

  • listPlatforms
  • validateCredentials
  • collectInvoices

Perfect for:

  • Accounting bots
  • ERP automations
  • AI assistants
  • Internal finance agents

βœ… Zero UI Scraping β†’ Fully Compliant

All integrations use official APIs, making it:

  • Faster
  • More reliable
  • Safe for enterprise
  • Allowed by payment providers

βœ… Built for Pro Use

  • Modular adapters
  • Scalable architecture
  • Clean SDK-based structure
  • Extensible for future platforms

🧠 Who This Actor Is For

  • Founders / Startups
  • Fintech apps
  • Accounting firms
  • CAs & auditors
  • No-code automation builders
  • ERP developers
  • AI agent engineers
  • Automation enthusiasts

Anyone dealing with Razorpay, PayPal, or Stripe invoices β€” this is for you.


πŸ”§ Quick Start (Normal Mode)

🟦 Example INPUT

{
"mode": "normal",
"platforms": ["razorpay", "stripe"],
"dateFrom": "2024-01-01",
"dateTo": "2024-12-31",
"emailTo": "yourname@example.com"
}

πŸ” Environment Variables (Required)

Set these in Apify β†’ Actor Settings β†’ Environment variables:

VariablePurpose
RAZORPAY_API_KEYRazorpay access key
RAZORPAY_API_SECRETRazorpay secret key
PAYPAL_CLIENT_IDPayPal REST API
PAYLAY_SECRETPayPal REST API
STRIPE_API_KEYStripe secret key
SMTP_USERGmail address / SMTP user
SMTP_PASSGmail App Password / SMTP key
SMTP_HOSTOptional β€” default smtp.gmail.com
SMTP_PORTOptional β€” default 587

πŸ“€ Output Example

{
"mode": "normal",
"processedPlatforms": "razorpay, stripe",
"successCount": "2",
"errorCount": "0",
"totalInvoices": "14",
"pdfFiles": "inv001.pdf, inv002.pdf",
"jsonFiles": "invoice_summary_12.json",
"emailSent": "yes",
"emailTo": "yourname@example.com"
}

πŸ“¨ Email Delivery

If emailTo is provided and invoices were fetched:

βœ” PDFs and JSON summaries are attached
βœ” Message is delivered using SMTP/Gmail
βœ” Skipped automatically if SMTP not configured


πŸ€– MCP Mode β€” For AI Agents

Turn the Actor into a WebSocket automation backend.

🟦 Example MCP Input

{
"mode": "mcp",
"mcpPort": 8080
}

Server launches at:

ws://localhost:8080

Supported Commands (MCP)

CommandDescription
listPlatformsReturns: razorpay, paypal, stripe
validateCredentialsEnsures API keys work
collectInvoicesTriggers normal invoice flow

Perfect for:

  • ChatGPT MCP tools
  • Claude MCP tools
  • LangChain tool wrappers
  • Internal automation APIs

πŸ“¦ Storage Usage

The Actor stores:

πŸ“ Key-value store

  • PDF invoices
  • JSON summaries
  • Error logs

πŸ“ Dataset (UI preview)

  • Flattened summary table of the run

βš™ Architecture Overview

main.js
β”œβ”€β”€ normal mode β†’ orchestrator.js
└── mcp mode β†’ mcp/server.js
orchestrator.js
β”œβ”€β”€ connectorManager.js
β”œβ”€β”€ email/sendEmail.js
└── adapters/
β”œβ”€β”€ razorpay
β”œβ”€β”€ paypal
└── stripe

Adapters follow a strict format:

  • connect(credentials)
  • bulkDownload(connection, filters)

This ensures the Actor remains easy to extend.


🎯 Limitations

  • Rate limits apply based on API providers
  • Some transactions do not have PDFs
  • Email requires valid SMTP / Gmail App Password
  • MCP mode requires an MCP-enabled client

🏁 Final Notes

This Actor is built to be:

  • Reliable in production
  • Extensible for more payment gateways
  • Fast and stable
  • AI-automation-ready
  • Useful for accounting + fintech workflows

If you'd like support for Cashfree, RazorpayX, Zoho Books, or Stripe Checkout logs β€” just ask!