Skip to content

Add Invoice Processing Agent with Stripe Integration#9

Open
Tar-ive wants to merge 1 commit into
toolhouseai:mainfrom
Tar-ive:main
Open

Add Invoice Processing Agent with Stripe Integration#9
Tar-ive wants to merge 1 commit into
toolhouseai:mainfrom
Tar-ive:main

Conversation

@Tar-ive

@Tar-ive Tar-ive commented Oct 27, 2025

Copy link
Copy Markdown

Summary

This PR adds a comprehensive invoice processing agent that leverages Toolhouse AI tools and Stripe API to automate invoice workflows.

Features

🤖 AI-Powered Invoice Processing

  • Extracts invoice data from text, URLs, PDFs, and other sources using Claude 3.5 Sonnet
  • Intelligent field detection and validation
  • Natural language interaction

💳 Stripe Integration

  • Automatic customer creation and management
  • Invoice generation with line items
  • Payment tracking and monitoring
  • Support for various payment terms

🏗️ Production-Ready Architecture

  • Comprehensive error handling and validation
  • Full test suite with unit and integration tests
  • Modular and extensible design
  • Security best practices

📚 Complete Documentation

  • Detailed setup guide with troubleshooting
  • 14+ usage examples covering common scenarios
  • Architecture documentation
  • Quick start guide for 5-minute setup

Files Added

  • agents/invoice-processing-agent/src/invoice_agent.py - Main AI agent (561 lines)
  • agents/invoice-processing-agent/src/stripe_integration.py - Stripe API wrapper (317 lines)
  • agents/invoice-processing-agent/tests/ - Comprehensive test suite (711 lines)
  • agents/invoice-processing-agent/docs/ - Complete documentation (4 files)
  • Configuration files (requirements.txt, .env.example, pytest.ini, Makefile)

Tech Stack

  • Anthropic Claude 3.5 Sonnet - Natural language understanding
  • Toolhouse SDK - Tool execution and web scraping
  • Stripe API - Payment processing
  • Python 3.8+ - Core implementation
  • pytest - Testing framework

Example Usage

```python
from agents.invoice_processing_agent.src.invoice_agent import InvoiceProcessingAgent

agent = InvoiceProcessingAgent()

Process invoice from text

result = agent.process_invoice(
source="Invoice text...",
source_type="text",
auto_send=False
)

if result["success"]:
print(f"Invoice created: {result['stripe_invoice']['invoice_id']}")
```

Testing

All code includes comprehensive tests:
```bash
cd agents/invoice-processing-agent
pytest tests/ -v
```

Documentation

Checklist

  • Code follows project structure (added to agents/ directory)
  • Comprehensive test coverage
  • Complete documentation
  • Error handling and validation
  • Security best practices (API key management)
  • Example usage and quick start guide

Related

This agent demonstrates advanced usage of Toolhouse SDK for real-world invoice automation, complementing existing examples in the repository.

This agent uses Toolhouse AI and Stripe API to automate invoice processing workflows.

Features:
- AI-powered invoice data extraction from text, URLs, and PDFs
- Automatic customer management and invoice creation in Stripe
- Payment tracking and status monitoring
- Comprehensive test suite with full coverage
- Production-ready with error handling and validation
- Complete documentation and usage examples

Tech stack: Anthropic Claude 3.5 Sonnet, Toolhouse SDK, Stripe API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant