{"uid":"cap_QetoqN99uOx648UHjz29o","slug":"freelancedesk-invoice-preflight-check-a998a39b","name":"FreelanceDesk Invoice Preflight Check","description":"Invoicing and billing resources sold per call to software. POST invoice JSON to check it (0.05 USD), get a print-ready A4 invoice as PDF (0.10 USD) or as self-contained HTML (0.10 USD), or GET the FreelanceDesk app and document pack as zip downloads. Each endpoint answers 402 with two payment options: an x402 v2 PAYMENT-REQUIRED challenge and an MPP WWW-Authenticate challenge (method evm, intent charge). Both settle an exact USDC EIP-3009 transfer on Base (eip155:8453) and return the resource in the same response.","url":"https://afraid-butterfly-5236.obtranzat.deno.net/v1/invoice/preflight?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"date":{"type":"string","description":"Issue date, YYYY-MM-DD"},"items":{"type":"array","items":{"type":"object","required":["description","quantity","unitPrice"],"properties":{"taxRate":{"type":"number","maximum":100,"minimum":0},"quantity":{"type":"number","exclusiveMinimum":0},"unitPrice":{"type":"string","description":"Non-negative amount, max 2 decimals"},"description":{"type":"string"}}},"maxItems":100,"minItems":1},"notes":{"type":"string"},"client":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"email":{"type":"string"},"vatId":{"type":"string"},"address":{"type":"string"}}},"number":{"type":"string","description":"Invoice number, e.g. 2026-014"},"seller":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"email":{"type":"string"},"vatId":{"type":"string"},"address":{"type":"string"}}},"dueDate":{"type":"string","description":"Due date, YYYY-MM-DD"},"taxMode":{"enum":["exclusive","inclusive"],"type":"string","description":"default exclusive"},"currency":{"type":"string","description":"ISO 4217 code, default EUR"},"taxLabel":{"type":"string","description":"default VAT"}}},"responseSchema":{"type":"json","example":{"valid":true,"number":"2026-014","totals":{"net":"200.00","tax":"42.00","total":"242.00"},"currency":"EUR","findings":[]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_cS1-M9hf0QVlIMzMX7iCU","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates invoice JSON for correctness and returns computed totals (net, tax, total) before generating a PDF or HTML invoice","exampleAgentPrompt":"Can you check this invoice before I generate the PDF — invoice number 2026-014, seller Acme Design, client Globex Corp, dated 2026-06-15, due 2026-07-15, with two line items: 10 hours of design at 80.00 EUR each with 21% VAT exclusive, and 1 logo package at 200.00 EUR with 21% VAT exclusive, currency EUR?","exampleUseCases":[{"title":"Pre-flight check before PDF generation","prompt":"Before I generate the invoice PDF, can you validate invoice 2026-022 for me? Seller is Luna Studio (luna@studio.eu), client is Retail Brands GmbH, issued 2026-07-01, due 2026-07-31, three line items: 20 hours copywriting at 60.00 EUR each (21% VAT exclusive), 1 strategy doc at 250.00 EUR (21% VAT exclusive), and 1 rush fee at 50.00 EUR (0% VAT), currency EUR. Just confirm the totals are right and there are no errors."},{"title":"VAT-inclusive invoice total verification","prompt":"Check my invoice for errors — number INV-2025-009, seller Bright Pixels (me), client Hopper Labs, dated 2025-12-01, due 2026-01-01, one line item: website redesign for 1210.00 EUR with 10% VAT inclusive. Currency EUR. Tell me the net, tax, and total and whether it all looks valid."},{"title":"Multi-currency freelance invoice validation","prompt":"I want to validate an invoice in USD before sending it — invoice 2026-031, my company TechFlow LLC, client Marquee Partners, issued 2026-06-20, due 2026-07-20, two items: 5 consulting days at 800.00 USD each (no tax, 0%), and expense reimbursement for 1 item at 320.00 USD (0% tax). Currency USD. Can you run a preflight check and confirm the totals?"}],"resultDescription":"A JSON object indicating whether the invoice is valid (boolean), the invoice number, computed totals (net, tax, total as decimal strings), the currency code, and an array of findings describing any validation errors or warnings found in the submitted data.","failureModes":["Invalid date format (not YYYY-MM-DD) returns validation error in findings","Missing required seller or client name returns invalid result","Unit price with more than 2 decimal places rejected","Tax rate outside 0–100 range causes schema rejection","Empty items array or more than 100 items returns error","Malformed JSON body returns 400 Bad Request","Payment not completed returns 402 Payment Required with x402/MPP challenge","Unknown currency code may produce findings warning"],"whenToPreferThis":"Use this endpoint when you need to validate invoice data and compute totals before committing to PDF or HTML generation (which cost more per call). It is the cheapest entry point in the FreelanceDesk pipeline and ideal as a dry-run or sanity-check step in an automated invoicing workflow. Prefer it over generating the full document when you want to catch errors early, preview tax calculations, or confirm line-item totals without incurring rendering costs.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-01T06:47:26.490Z","isFirstParty":false,"canonicalSlug":"freelancedesk-invoice-preflight-check-a998a39b"}