Skip to main content

System Requirements

Before installing the Electronic Invoice Processing API, ensure your system meets these requirements:

Python Version

Python 3.9 or higher required

Disk Space

Minimum 200 MB for dependencies

RAM

At least 512 MB available memory

Operating System

Linux, macOS, or Windows

Installation Methods

Environment Configuration

The API uses FastAPI’s built-in configuration. Key settings are defined in the main application:

CORS Configuration

The API is configured with CORS middleware to allow cross-origin requests:
main.py:16-22
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],  # In production, specify allowed origins
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)
For production environments, replace allow_origins=["*"] with specific domains like ["http://localhost:3000"] to enhance security.

Server Configuration

You can customize the server settings when starting Uvicorn:
uvicorn main:app --reload --host 127.0.0.1 --port 8000

Verification Steps

After installation, verify that the API is working correctly:
1

Check API Health

Start the server and visit the interactive documentation:
uvicorn main:app --reload
Open your browser to:
  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc
2

Test the Endpoint

Verify the /process_excel endpoint is available:
curl -X GET http://localhost:8000/docs
You should see the FastAPI documentation page.
3

Process a Sample File

Create a minimal Excel file with the required columns and test processing:
curl -X POST "http://localhost:8000/process_excel" \
  -F "file=@test_invoices.xlsx" \
  --output test_output.zip
If successful, you’ll receive a ZIP file containing the processed invoices.

Troubleshooting

This means FastAPI is not installed. Ensure you’ve activated your virtual environment and run:
pip install -r requirements.txt
Another process is using port 8000. Either stop that process or use a different port:
uvicorn main:app --port 8001
Ensure your Excel file:
  • Contains all required columns
  • Has the correct column names (case-sensitive)
  • Contains valid data types (dates as dates, numbers as numbers)
  • Is in .xlsx format (not .xls)
Check the container logs:
docker logs invoice-api-container
Common issues:
  • Port conflict (change port mapping: -p 8001:8000)
  • Missing files (ensure all files are copied correctly)
  • Permission issues (check file permissions)

Next Steps

Quickstart Guide

Learn how to process your first invoice in under 5 minutes

API Reference

Explore detailed API endpoint documentation

Excel Format

Learn about required Excel columns and data formats

Invoice Structure

Understand the electronic invoice JSON output format

Understanding the Dependencies

Core Framework

  • FastAPI: Modern, high-performance web framework for building APIs with automatic documentation
  • Uvicorn: Lightning-fast ASGI server implementation

Data Processing

  • pandas: Powerful data manipulation library for reading and processing Excel files
  • openpyxl: Engine for reading Excel 2010+ (.xlsx) files
  • numpy: Fundamental package for numerical operations (pandas dependency)

Utilities

  • python-multipart: Handles multipart form data for file uploads
  • num2words: Converts numeric amounts to Spanish words for invoice text fields (main.py:36-71)
The num2words library is specifically configured for Spanish (lang='es') to comply with Venezuelan electronic invoice requirements.

Build docs developers (and LLMs) love