{"slug":"stackbill-app-routes-x402-invoice-from-data-3f5f8d","title":"Generate a finished, professional invoice PDF from JSON — recipient and line ite","host":"stackbill.app","method":"POST","resource":"https://stackbill.app/routes/x402/invoice-from-data","category":"market","description":"Generate a finished, professional invoice PDF from JSON — recipient and line items in, a ready-to-send application/pdf out. Layouts: standard, legal, creative. Totals and tax are computed server-side so the numbers always add up. First payment auto-creates a wallet profile (token + API key in respon","price_listed":0.1,"price_asked":null,"state":"effects","state_label":"Not tested: has real-world effects","checks_7d":0,"answered_7d":0,"latency_ms_median":null,"reported_calls_30d":1,"reported_payers_30d":1,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"currency":"USD","dueDate":"2026-08-01","invoiceNumber":"INV-2026-042","lineItems":[{"description":"Backend development","quantity":10,"unitPrice":95},{"description":"Code review","quantity":2,"unitPrice":120}],"notes":"Payment due within 30 days.","recipient":{"address":"456 Oak Ave, Chicago, IL 60601","name":"Acme Corp"},"sender":{"address":"123 Main St, Springfield, IL 62701","name":"Jane Doe Consulting"},"taxRate":7.5},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"properties":{"currency":{"description":"Optional; must be \"USD\" if present (v1 renders USD only)","type":"string"},"dueDate":{"description":"Optional due date, YYYY-MM-DD","type":"string"},"invoiceNumber":{"description":"Invoice number printed on the PDF. Optional when the request carries an X-StackApps-Token header from a previous paid call — the next sequential number for that wallet is used and returned in the X-Invoice-Number response header","type":"string"},"lineItems":{"description":"At least one line item; amount per line, subtotal, tax and total are computed server-side","items":{"properties":{"description":{"type":"string"},"quantity":{"exclusiveMinimum":0,"type":"number"},"unitPrice":{"minimum":0,"type":"number"}},"required":["description","quantity","unitPrice"],"type":"object"},"type":"array"},"notes":{"description":"Optional notes printed at the bottom of the invoice","type":"string"},"recipient":{"description":"Who the invoice is billed to","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["name","address"],"type":"object"},"sender":{"description":"Who the invoice is from. Optional for activated wallet profiles (send X-StackApps-Token) — the profile's saved name and address are used","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["name","address"],"type":"object"},"taxRate":{"description":"Optional tax percent applied to the subtotal (e.g. 7.5)","minimum":0,"type":"number"},"template":{"description":"Optional PDF layout (default standard): legal = billing statement with a per-line Date column (populated when descriptions start with 'Work session on YYYY-MM-DD: '); creative = service/fee layout without hours-rate columns (service name taken from the text before ': ' in each description)","enum":["standard","legal","creative"],"type":"string"}},"required":["recipient","lineItems"]},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[],"description_full":"Generate a finished, professional invoice PDF from JSON — recipient and line items in, a ready-to-send application/pdf out. Layouts: standard, legal, creative. Totals and tax are computed server-side so the numbers always add up. First payment auto-creates a wallet profile (token + API key in response headers); returning wallets get sequential invoice numbering and can save a sender letterhead. USD only.","last_updated":"2026-09-14T14:53:01.677Z","schemes":["exact"]}