# Gig Worker Finance API – Invoice Generator

> Gig Worker Finance API – Invoice Generator is a paid API for AI agents from safe-weekly-spend-api-production.gigfinancetools.workers.dev, paid per call via x402, $0.25/call, status unknown (last checked 2026-10-17).

Generates a professional invoice (PDF and HTML) for gig workers, with line items, tax, discounts, and payment terms

## Facts

- Endpoint: POST https://safe-weekly-spend-api-production.gigfinancetools.workers.dev/v1/invoice?utm_source=zero.xyz
- Price: $0.25/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gig-worker-finance-api-invoice-generator-df15aea2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_f83icTXUUuMynRDSz-VC4

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability gig-worker-finance-api-invoice-generator-df15aea2 -d '<json body>'
```

Example prompt: Create an invoice for my freelance logo design project: bill Acme Co. (ap@acme.example, 500 Market St, San Francisco, CA 94105) from my company Acme Design LLC (billing@example.com, 123 Main St, Austin, TX 78701), invoice number INV-2026-0042, issued today and due November 15 2026, with two line items — 'Logo design' at $850 and 'Brand guidelines PDF' at $400, apply 8.25% sales tax, and give me the PDF and HTML versions.

## When to prefer this

Choose this endpoint when a gig worker, freelancer, or independent contractor needs to generate a polished, print-ready invoice with automatic tax and total calculations in both PDF and HTML format, especially within a pay-per-use agent workflow using USDC on Base. Prefer it over generic document tools when you need structured invoice fields (line items, tax rates, discounts, payment terms) computed server-side and returned as ready-to-send documents.

## Known failure modes

- Missing required line_items array or empty array — returns validation error
- Missing required 'from.name' or 'to.name' — returns schema validation error
- Invalid date format for issue_date or due_date (must be YYYY-MM-DD) — returns format error
- tax_rate outside 0–1 range — returns validation error
- quantity or unit_price below minimum — returns validation error
- Payment failure (USDC/x402) — returns 402 Payment Required before processing
- line_items exceeding 100 items — returns validation error

## How this service works

Pay-per-call finance tools for US gig workers, paid in USDC on Base via x402. Not tax or financial advice.

## Output

Returns a JSON object containing the rendered invoice HTML string, base64-encoded PDF bytes, computed line totals (amount, tax per line), subtotal, total discount, total tax, and grand total, along with echoed metadata like invoice number, issue date, due date, and currency.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "type": "object",
   "required": [
    "name"
   ],
   "properties": {
    "name": {
     "type": "string",
     "maxLength": 500
    },
    "email": {
     "type": "string",
     "maxLength": 500
    },
    "phone": {
     "type": "string",
     "maxLength": 500
    },
    "tax_id": {
     "type": "string",
     "maxLength": 500
    },
    "address": {
     "type": "string",
     "maxLength": 500
    }
   },
   "additionalProperties": false
  },
  "from": {
   "type": "object",
   "required": [
    "name"
   ],
   "properties": {
    "name": {
     "type": "string",
     "maxLength": 500
    },
    "email": {
     "type": "string",
     "maxLength": 500
    },
    "phone": {
     "type": "string",
     "maxLength": 500
    },
    "tax_id": {
     "type": "string",
     "maxLength": 500
    },
    "address": {
     "type": "string",
     "maxLength": 500
    }
   },
   "additionalProperties": false
  },
  "notes": {
   "type": "string",
   "maxLength": 2000
  },
  "output": {
   "type": "object",
   "properties": {
    "pdf": {
     "type": "boolean",
     "default": true
    },
    "html": {
     "type": "boolean",
     "default": true
    }
   }
  },
  "currency": {
   "type": "string",
   "default": "USD",
   "pattern": "^[A-Z]{3}$"
  },
  "discount": {
   "type": "number",
   "minimum": 0,
   "description": "Flat pre-tax discount"
  },
  "due_date": {
   "type": "string",
   "format": "date",
   "description": "YYYY-MM-DD"
  },
  "tax_rate": {
   "type": "number",
   "maximum": 1,
   "minimum": 0,
   "description": "Default tax rate for items without one"
  },
  "issue_date": {
   "type": "string",
   "format": "date",
   "description": "YYYY-MM-DD"
  },
  "line_items": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "description",
     "quantity",
     "unit_price"
    ],
    "properties": {
     "quantity": {
      "type": "number",
      "exclusiveMinimum": 0
     },
     "tax_rate": {
      "type": "number",
      "maximum": 1,
      "minimum": 0
     },
     "unit_price": {
      "type": "number",
      "minimum": 0
     },
     "description": {
      "type": "string",
      "maxLength": 500,
      "minLength": 1
     }
    },
    "additionalProperties": false
   },
   "maxItems": 100,
   "minItems": 1
  },
  "payment_terms": {
   "type": "string",
   "maxLength": 2000
  },
  "invoice_number": {
   "type": "string",
   "maxLength": 64,
   "minLength": 1
  },
  "pay
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "to": {
   "name": "Acme Co.",
   "email": "ap@acme.example",
   "address": "500 Market St, San Francisco, CA 94105"
  },
  "tax": 99.8,
  "from": {
   "name": "Acme Design LLC",
   "email": "billing@example.com",
   "address": "123 Main St, Austin, TX 78701"
  },
  "html": "<!doctype html><html><head><meta charset=\"utf-8\"><title>Invoice INV-2026-0042</t…(truncated)",
  "lines": [
   {
    "tax": 67.86,
    "amount": 850,
    "quantity": 1,
    "tax_rate": 0.0825,
    "unit_price": 850,
    "description": "Logo design (3 concepts, 2 revision rounds)"
   },
   {
    "tax": 31.94,
    "amount": 400,
    "quantity": 1,
    "tax_rate": 0.0825,
    "unit_price": 400,
    "description": "Brand guidelines PDF"
   },
   {
    "tax": 0,
    "amount": 300,
    "quantity": 2.5,
    "tax_rate": 0,
    "unit_price": 120,
    "description": "Consulting call"
   }
  ],
  "total": 1599.8,
  "currency": "USD",
  "discount": 50,
  "due_date": "2026-10-30",
  "subtotal": 1550,
  "pdf_bytes": 3825,
  "issue_date": "2026-10-16",
  "pdf_base64": "JVBERi0xLjcKJYGBgYEKCjEgMCBvYmoKPDwKL1R5cGUgL1BhZ2VzCi9LaWRzIFsgNiAwIFIgXQovQ291…(truncated)",
  "invoice_number": "INV-2026-0042"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gig-worker-finance-api-invoice-generator-df15aea2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from safe-weekly-spend-api-production.gigfinancetools.workers.dev](https://www.zero.xyz/host/safe-weekly-spend-api-production.gigfinancetools.workers.dev/llms.txt)
