BillResolve — Turn Invoice Disputes Into Clear, Approved Corrections
AI-powered invoice clarification and controlled payment resolution using PayPal Invoicing.
Inspiration
Getting an invoice paid should not require endless emails, awkward negotiations, or manually reconstructing what work was completed.
Consider a freelancer who sends a $180 invoice. The client questions a charge for two revision sessions because the available work record only documents one.
The problem is not necessarily that the client refuses to pay. They need clarity, supporting evidence, and a fair way to agree on the correct amount.
Traditional invoicing tools handle sending and tracking invoices, but the conversation around disputed charges often happens elsewhere.
BillResolve was built to bridge that gap: connect the invoice, the evidence, the explanation, and the payment correction in one controlled workflow.
What It Does
BillResolve helps merchants and buyers clarify disputed invoice charges before issuing an agreed correction.
1. Review and question invoice charges
The buyer can examine an invoice and raise questions about specific line items.
Each question remains connected to the relevant charge and supporting work records, keeping the discussion structured and traceable.
2. Understand the evidence with AI
BillResolve integrates Qwen3-30B-A3B-Instruct-2507 to analyze the supplied invoice context and work records.
The AI generates understandable explanations, references relevant evidence, and identifies missing information.
Rather than accepting arbitrary AI-generated citations, the application validates citation identifiers and quoted text against the supplied records.
3. Prepare an accurate correction
The merchant reviews the explanation and decides whether an adjustment is appropriate.
For example, a $180 invoice includes two revision sessions. After reviewing the supporting record, the merchant can reduce the quantity to one, producing a corrected invoice of $140.
The AI explains the evidence; the merchant controls the financial terms.
4. Secure approval from both parties
Before proceeding, BillResolve requires explicit approval of the proposed revision from both the merchant and buyer.
Each approval is bound to the exact revision using a content hash.
If the quantity, price, or other revision details change, previous approvals become invalid.
5. Execute a controlled invoice correction
BillResolve implements a PayPal Invoicing workflow designed to verify the original invoice's status before making changes.
The process checks that the original remains unpaid, confirms its cancellation, creates and verifies the corrected invoice, issues it, and retrieves the resulting provider status.
If the original has already been paid or its state cannot be established confidently, replacement is blocked.
6. Maintain a traceable resolution history
Questions, AI explanations, proposed changes, approvals, invoice transitions, and resulting records are preserved in the application.
The resolution history can also be exported as JSON.
How We Built It
BillResolve combines an AI explanation engine, a deterministic approval system, and payment-provider workflow controls.
Core technologies:
- Node.js 24 and JavaScript for backend services and transaction workflow orchestration
- HTML and CSS for buyer and merchant interfaces
- SQLite for durable application state
- PayPal Sandbox Invoicing APIs through the application's payment integration layer
- Qwen3-30B-A3B-Instruct-2507 for evidence-grounded explanations
- OpenAI-compatible inference API for model communication
- Google Cloud Storage adapter for persistent state management
Evidence-grounded AI
The model receives structured invoice information and supporting records.
Its role is limited to explaining the available evidence and highlighting inconsistencies or missing facts.
The backend validates the response schema, source identifiers, and cited text before presenting the explanation.
An actual Qwen3 inference request successfully produced an explanation referencing the exact E2 work-log citation and passed the application's validation rules.
Exact approval integrity
BillResolve uses revision hashes to bind buyer and merchant approval to specific invoice terms.
Changes invalidate previous consent, preventing a different correction from being issued under an outdated approval.
Payment reconciliation
Invoice cancellation, replacement creation, and issuance are separate provider operations.
BillResolve records operation intent before payment-provider writes and uses explicit state retrieval to reconcile results.
If a creation response becomes uncertain, the application avoids blindly submitting another creation request.
Security and reliability
The application includes operator-access protections, state validation, safeguards against unresolved invoice transitions, persistent workflow records, and focused automated regression testing.
The architecture keeps AI explanations separate from approval authority and financial operations.
Challenges We Faced
Preventing convincing but unsupported AI explanations
An AI explanation is only as reliable as the information supporting it.
We addressed this by validating citations against actual supplied records and distinguishing documented facts from missing confirmation.
Ensuring both parties approve the same correction
A common risk in invoice adjustments is that an amount changes after someone approves it.
Binding approvals to the revision content ensures that consent cannot silently carry over to altered terms.
Handling non-atomic invoice operations
Canceling an existing invoice and issuing its replacement cannot be treated as one indivisible operation.
The application must account for an invoice being paid during the correction process, or a provider completing an operation before its response is received.
We designed explicit state checks, recorded intent, and reconciliation rules to handle these situations.
Keeping AI out of financial authority
The language model can assist with understanding a dispute, but it does not determine the final amount, approve terms, or independently issue invoices.
Those actions remain governed by merchant decisions, buyer approval, and deterministic workflow controls.
Accomplishments We're Proud Of
We completed and exercised the full application workflow using a representative three-line invoice.
The demonstrated scenario includes:
- An original invoice totaling $180
- A buyer questioning two billed revision sessions
- Evidence analysis identifying one documented session and missing confirmation for the other
- A merchant-proposed correction reducing the total to $140
- Exact approval by the merchant and buyer
- Controlled cancellation and corrected-invoice issuance
- Invoice status inspection and resolution-history export
- State preservation across application restarts
The AI explanation adapter was also verified against the real Qwen3 model endpoint.
Automated checks cover critical workflow behaviors, approval integrity, operator protection, invoice-state handling, and regression scenarios.
Demonstration scope: The recorded invoice lifecycle uses simulated PayPal responses. The PayPal Invoicing integration is implemented, while end-to-end execution against the actual PayPal Sandbox remains unverified.
What We Learned
Building BillResolve reinforced a fundamental lesson:
AI can help people understand a disagreement, but financial resolution requires verifiable evidence, explicit consent, and reliable state transitions.
A useful model explanation is only one part of the process. The application must also preserve the exact agreement, avoid acting on uncertain payment information, and maintain a traceable history.
We also learned how important it is to keep uncertain provider outcomes unresolved until authoritative evidence is available.
What's Next
BillResolve can evolve into a broader invoice-resolution platform for freelancers, agencies, consultants, and service businesses.
Planned improvements include:
- Separately authenticated merchant and buyer accounts
- Existing invoice and work-record imports
- Integration with accounting and project-management systems
- Stronger evidence collection and review workflows
- Extended payment-state reconciliation and provider verification
- Merchant-configurable invoice correction policies
Our goal is to make resolving a questioned invoice as straightforward as issuing one.
BillResolve — explain the charge, agree on the correction, and settle with confidence.
Built With
- css3
- generative-ai
- github
- google-cloud
- html5
- javascript
- llm
- node.js
- openai-compatible-api
- paypal
- paypal-invoicing-api
- qwen3
- rest-api
- sqlite

