Bill Import Gate 0.1.0 — public local toolkit and hosted API

Purpose
Check normalized bill batches against exported history before importing them into a ledger. Intended user: automation operator combining bill intake from multiple sources. No live accounting connection, payments, writeback or deletion.

Try locally (Node.js 20+)
  node cli.mjs example.json
Exit 0: no supported flags. Exit 2: hold for human review. Exit 1: invalid input.
  node --test test.mjs test-http.mjs

Input
JSON {scopeConfirmed:true, history:[], incoming:[]}.
Each row: id, entityId, vendorId, invoiceNumber, fiscalPeriod, documentType (bill or credit_note), currency (three uppercase letters), amountMinor (nonnegative safe integer), billDate (YYYY-MM-DD).
Use stable IDs, explicit fiscal periods and currency minor units. Preserve source invoice references as strings including leading zeroes. Each array permits at most 5,000 rows; CLI and HTTP limit 2 MiB. The operator must map source data correctly and supply complete relevant history. No CSV mapping, OCR or vendor-name fuzzy matching is provided.

Checks
- Same entity/vendor/type/period/exact reference and same currency/amount: repeated bill identity, hold for review.
- Same scoped reference with amount/currency mismatch: identity conflict, review only.
- Different reference with matching normalized form/date/amount/currency/scope: possible reference variant, review only. Never auto-merge.
- Same reference from another vendor, period, entity or document type is not merged.
Findings refer to source row and id; at most 1,000 findings returned with full counts and a truncation flag. Only one representative match per input row is reported.

Worker adapter
worker.mjs exposes POST /bills/preflight. Requires a dedicated encrypted BILL_PROXY_SECRET and gateway header x-rapidapi-proxy-secret; missing configuration fails closed. The dedicated production secret is encrypted in Cloudflare after explicit owner approval; no production secret is included in this toolkit. Hosted API: https://rapidapi.com/didyouseethis212sys/api/bill-import-gate . One synthetic owner gateway test returned HTTP200 with two findings; this is not customer activity. BASIC25/month free, PRO$9/500monthly hard request limits; platform bandwidth fees and terms separate. Local use needs no subscription.

Privacy
CLI processing is local and makes no network calls. The hosted API receives the supplied JSON; send only necessary mapped fields, excluding bank details, private contacts and credentials. Reports include supplied row identifiers. No telemetry is included.

Commercial assessment
Xero already provides duplicate-bill warnings and Zoho Books handles reused invoice numbers with vendor/year distinctions. A basic duplicate checker alone is weak differentiation. The narrowly testable hypothesis is cross-source intake checks before ledger ingestion, with explicit identity mapping, exact minor-unit arithmetic and structured report routing. This is not evidence that customers will pay. Free scripts/spreadsheets and existing ledger checks remain alternatives.
Official evidence reviewed 2026-11-17:
https://central.xero.com/0/article/Changes-to-bills-in-Xero
https://www.zoho.com/sa/books/kb/bills/repeat-bill-number.html
https://www.xero.com/us/pricing-plans/

Commercial validation still required
Get a real operator to reproduce a blocked intake using synthetic/de-identified records and confirm a repeated cross-source problem their existing ledger does not resolve. Assess whether they would use a hosted API or prefer this local tool. Do not claim savings, prevented duplicate payments, paying customers or guaranteed revenue. Hosted plans are active; customer demand remains unvalidated.

Limitations
This tool flags import candidates, not fraud or proof of duplicate payment. It does not validate bank accounts, taxes, vendor identity, payment status, credit offsets or the completeness of accounting history. A clean report is not payment approval. Review underlying documents before ledger actions.
