Inspiration

Freelancers rarely lose money because a client refuses to pay. They lose it in the gap between "the work is done" and "the invoice is paid", where three sentences live: "That wasn't in the brief." "It's not finished yet." "We'll pay once we've checked."

Each of those is a disagreement about evidence. The agreement is in one PDF, the delivered work is scattered across email and chat, and the invoice is somewhere else. Nobody can point to the clause, the screenshot and the payment at the same time. I wanted one record that connects all three, with AI doing the tedious checking and people making the decisions.

What it does

ScopePay turns a signed agreement into evidence-backed PayPal invoices:

  1. Read the agreement. Upload a PDF, Word or text agreement. AI extracts every milestone, amount, due date and acceptance condition, plus exclusions and the rate for extra work. Every term quotes the clause it came from, and ScopePay checks each quote word for word against the source. Anything it cannot find is flagged, and nothing is used until the freelancer confirms the terms.
  2. Check the delivered work. Upload screenshots and documents. A vision model checks each acceptance condition against what is actually visible and marks it met, partial or missing, naming what is absent. In the demo it catches that the Portfolio page required by clause 3.4 was never delivered.
  3. Catch scope creep. Paste a client request such as "Can you also add a blog?" ScopePay finds the clause that decides it. When it is extra work, it drafts a change order priced at the agreement's own hourly rate.
  4. Let the client decide. The client opens a private link, with no account needed, and sees each screenshot beside the clause it satisfies. They accept with their name, explicitly acknowledging any open items, or ask for changes. Change orders are approved the same way.
  5. Invoice and get paid with PayPal. Acceptance creates a PayPal invoice with the approval recorded on it. The freelancer sends it, tracks it and sends AI-drafted reminders through PayPal. When the client pays, a verified PayPal webhook marks the milestone paid.
  6. See every payment. An AG Grid payment pipeline shows every milestone across projects, from evidence check to payment, and an AG Grid invoice ledger offers filters, search, live totals and CSV export.

AI prepares the evidence, people decide, and PayPal moves the money. The AI never accepts work and never sends money.

Acceptance checklist: each condition is checked against the delivered screenshots and linked to its clause

How I built it

  • PayPal Invoicing v2 (sandbox): next invoice number, create (idempotent with PayPal-Request-Id), send, get status, remind, and the payer view link. Webhooks for INVOICING.INVOICE.PAID, UPDATED and CANCELLED are verified with PayPal's verify-webhook-signature API, passing the raw event through byte for byte.
  • AI: Anthropic models through forced tool calls with JSON schemas, so every answer is structured. Agreement extraction, vision-based evidence review, scope classification and reminder drafting are separate tasks with their own schemas. Documents and client messages are treated as untrusted data in every prompt.
  • Grounding: every extracted quote is normalised and matched against the agreement text. Unmatched quotes and inconsistent totals become warnings before the freelancer confirms.
  • AG Grid (Community): the invoice ledger and the payment pipeline, themed to match the app, with external filters, quick search, a pinned totals row and CSV export.
  • App: Node.js with no framework, vanilla JavaScript modules and no build step, plus a server-rendered public website. Accounts use scrypt-hashed passwords and hashed session tokens in HttpOnly cookies, with sign-in throttling.
  • Data and hosting: Postgres on Render stores accounts, projects and evidence files. The app runs on Render from a blueprint, and the public website is also published to GitHub Pages.
  • Quality: 14 unit tests with mocked AI and PayPal, plus a Playwright browser walkthrough of the whole flow, run in GitHub Actions on every pull request.

The client's private review page: delivered work beside each clause, with accept and request-changes controls

Challenges I ran into

  • Trusting AI output with money attached. A hallucinated clause in a payment dispute is worse than no answer. Quoting the source, verifying each quote mechanically, and keeping a person on every decision solved it.
  • Webhook verification. PayPal verifies the event exactly as it was sent, so the server keeps the raw body and builds the verification request around it instead of re-serialising the JSON.
  • Keeping it a real product. Multi-tenant accounts, private client links, an audit trail and Postgres storage took as much care as the AI, because invoices and client decisions have to be trustworthy.

Accomplishments that I'm proud of

  • The full loop works end to end: agreement, evidence, acceptance, PayPal invoice and payment.
  • Every AI claim in the interface links back to the clause and the evidence behind it.
  • A client can review and accept without creating an account, and their decision is recorded.
  • It is a complete website with accounts, not just a demo, and it still offers a one-click demo for judges.

What I learned

In payments, AI is most useful as a careful clerk: it reads, cross-checks and drafts, but it shows its working and leaves the decision to people. Grounding every answer in quoted source text made the output much easier to trust. PayPal Invoicing already covers the hard parts of getting paid, so the opportunity was in what happens before the invoice.

What's next

  • Email verification and password reset.
  • Partial payments and deposits per milestone.
  • Version-aware evidence, comparing a redelivery with the previous one.
  • A PayPal Agent Toolkit agent that proposes follow-ups on overdue invoices for the freelancer to approve.
  • More agreement types, such as retainers and hourly contracts.

Built With

Share this project:

Updates

Submission history