惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
腾讯CDC
Y
Y Combinator Blog
L
LangChain Blog
B
Blog
U
Unit 42
P
Proofpoint News Feed
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 【当耐特】
WordPress大学
WordPress大学
月光博客
月光博客
Vercel News
Vercel News
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 叶小钗

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Generate Professional PDF Invoices via REST API — JSON In...
Forgelab Africa · 2026-05-25 · via DEV Community

Forgelab Africa

Building invoicing into your app is painful. You spend days wrestling with PDF generation libraries, template engines, multi-currency formatting, and email delivery — then repeat it for every project.

The Forgelab Invoice API handles all of it in one API call. Send JSON, get back a professional PDF invoice.

What it does

  • JSON in → professional PDF invoice out
  • Multiple templates (professional, minimal, modern)
  • Multi-currency support (USD, EUR, GBP, and more)
  • White-label option for agencies
  • Hosted URL + base64 download
  • Free tier: 5 invoices/month, no card required

Quick start with curl

curl -X POST https://api.forgelab.africa/v1/invoice/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "professional",
    "currency": "USD",
    "from": {
      "name": "Acme Corp",
      "email": "billing@acme.com",
      "address": "123 Main St, New York, NY"
    },
    "to": {
      "name": "Jane Smith",
      "email": "jane@example.com"
    },
    "items": [
      { "description": "Web Development", "quantity": 1, "rate": 2500.00 },
      { "description": "Hosting (6 months)", "quantity": 6, "rate": 25.00 }
    ],
    "notes": "Payment due within 30 days."
  }'

Response:

{
  "success": true,
  "invoice_id": "inv_abc123",
  "pdf_url": "https://api.forgelab.africa/v1/invoice/inv_abc123/pdf",
  "total": 2650.00,
  "currency": "USD"
}

Node.js example

const res = await fetch("https://api.forgelab.africa/v1/invoice/generate", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.FORGELAB_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    template: "professional",
    currency: "USD",
    from: { name: "Acme Corp", email: "billing@acme.com" },
    to: { name: "Jane Smith", email: "jane@example.com" },
    items: [
      { description: "Web Development", quantity: 1, rate: 2500 },
    ],
  }),
});

const { pdf_url, total } = await res.json();
console.log(`Invoice ready: ${pdf_url} — Total: $${total}`);

Python example

import requests

response = requests.post(
    "https://api.forgelab.africa/v1/invoice/generate",
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    json={
        "template": "professional",
        "currency": "USD",
        "from": {"name": "Acme Corp", "email": "billing@acme.com"},
        "to": {"name": "Jane Smith", "email": "jane@example.com"},
        "items": [
            {"description": "Consulting", "quantity": 10, "rate": 150},
        ],
    }
)

data = response.json()
print(f"Invoice URL: {data['pdf_url']}")

PHP example

$response = file_get_contents("https://api.forgelab.africa/v1/invoice/generate", false,
  stream_context_create(["http" => [
    "method"  => "POST",
    "header"  => "Authorization: Bearer {$apiKey}\r\nContent-Type: application/json",
    "content" => json_encode([
      "template" => "professional",
      "currency" => "USD",
      "from" => ["name" => "Acme Corp", "email" => "billing@acme.com"],
      "to"   => ["name" => "Jane Smith", "email" => "jane@example.com"],
      "items" => [["description" => "Design", "quantity" => 1, "rate" => 800]],
    ]),
  ]])
);
$data = json_decode($response, true);
echo $data["pdf_url"];

When to use it

  • SaaS apps that need automated billing documents for customers
  • Freelance tools for client invoicing without building from scratch
  • E-commerce VAT invoices and order receipts
  • Agencies building white-label invoicing products

Pricing

Plan Price Invoices/month
Free $0 5
Starter $5/mo 100
Pro $15/mo 1,000
Business $30/mo 10,000

No credit card required for the free tier.


Get your API key at forgelab.africa — docs, free tier, and full endpoint reference included.