| name | make-invoice |
| version | 1.0.0 |
| description | Generate professional HTML/PDF invoices from order data and email them to customers. |
| author | ZeptoClaw |
| license | MIT |
| tags | ["invoice","billing","pdf","ecommerce"] |
| env_needed | [{"name":"INVOICE_COMPANY_NAME","description":"Your company name (e.g. Kedai Ahmad Sdn Bhd)","required":true},{"name":"INVOICE_COMPANY_ADDRESS","description":"Company address for invoice header","required":false},{"name":"INVOICE_CURRENCY","description":"Currency code: MYR, SGD, USD, THB, IDR","required":false}] |
| metadata | {"zeptoclaw":{"emoji":"🧾","requires":{"anyBins":["python3","wkhtmltopdf"]}}} |
Make Invoice Skill
Generate professional invoices as HTML or PDF. Works for any order — Lazada, Shopee, manual, or custom.
Setup
export INVOICE_COMPANY_NAME="Kedai Ahmad Sdn Bhd"
export INVOICE_COMPANY_ADDRESS="No 12, Jalan Usahawan, 47500 Subang Jaya, Selangor"
export INVOICE_CURRENCY="MYR"
Install wkhtmltopdf (for PDF output):
brew install wkhtmltopdf
sudo apt install wkhtmltopdf
Generate HTML Invoice
cat > /tmp/invoice.py << 'EOF'
import os, sys, json
from datetime import datetime
data = json.load(sys.stdin)
company = os.environ.get("INVOICE_COMPANY_NAME", "My Company")
address = os.environ.get("INVOICE_COMPANY_ADDRESS", "")
currency = os.environ.get("INVOICE_CURRENCY", "MYR")
inv_no = data.get("invoice_number", f"INV-{datetime.now().strftime('%Y%m%d%H%M')}")
customer = data.get("customer", {})
items = data.get("items", [])
total = sum(i["quantity"] * i["unit_price"] for i in items)
rows = "\n".join(f"""
<tr>
<td>{i['description']}</td>
<td style="text-align:right">{i['quantity']}</td>
<td style="text-align:right">{currency} {i['unit_price']:.2f}</td>
<td style="text-align:right">{currency} {i['quantity']*i['unit_price']:.2f}</td>
</tr>""" for i in items)
(futf-8metatext-align:rightmetametametatext-align:righttext-align:righttext-align:right3text-align:righttotaltext-align:righttotalmargin-top:40px;color:#666)
EOF
<< | python3 /tmp/invoice.py > /tmp/invoice-INV001.html
{
: ,
: {
: ,
: ,
:
},
: [
{: , : 2, : 49.90},
{: , : 1, : 8.00}
],
:
}
INVOICE_DATA