Doorstep
An AI delivery agent for small PayPal sellers. Refunds buyers when parcels go missing, proves who had the parcel, and prepares fact-checked carrier claims so sellers can recover their losses.
Live App: https://doorstep-ojmg.onrender.com
Demo Video (2 min): https://www.youtube.com/watch?v=z5owHAEQOGk
Licence: MIT
Environment: PayPal Sandbox, Shippo Test Mode
Supported Regions: UK and US orders
Inspiration
A courier's "Delivered" scan wins almost every argument today. The buyer is told to wait, the honest seller loses money, and the carrier that lost the parcel faces no consequences.
Under UK law, the seller remains responsible for the parcel until the buyer physically receives it (Consumer Rights Act 2015, Section 29). But proving who actually received a parcel is still difficult and expensive.
Citizens Advice reported that 15 million people in the UK had a problem with their latest delivery (November 2025). "Item not received" also accounts for 1 in 5 card chargebacks (Chargeflow, October 2026).
We built Doorstep to solve this problem by making delivery proof verifiable and helping sellers resolve disputes, recover losses, and prevent future problems.
What it does
Doorstep manages every PayPal order through five stages:
1. Prevent
- Checks delivery addresses and assesses delivery risk.
- Recommends suitable delivery options at PayPal checkout based on the order's risk.
2. Prove
- Checks packing evidence before an order is shipped.
- Creates a QR-based possession seal that the buyer scans to confirm receipt.
- Adds shipment tracking directly to the PayPal payment.
3. Resolve
- Identifies where the delivery process failed.
- Checks a carrier's "Delivered" scan against the carrier's own data.
- Applies the relevant UK, EU, or US consumer protection rules using versioned policy files.
- Automatically refunds when appropriate, offers refunds within PayPal disputes, or prepares dispute evidence.
4. Recover
- Builds a carrier claim package using verified facts.
- Includes evidence and the carrier's actual claim deadline.
- Ensures every statement in the claim is backed by checked evidence.
5. Learn
- Learns from the seller's previous decisions.
- Turns repeated approvals into rules that sellers can review and activate.
The Seller Experience
The seller works from a Delivery Control Room built with AG Grid.
- Sellers can turn plain-language requests into data views.
- Doorstep's recommendations appear directly beside the relevant data.
- A guide row highlights the next action to take.
Claims, Disputes, and Money track every carrier claim, PayPal dispute, and refund until completion.
Each refund includes:
- The checks performed before the refund was sent.
- A signed receipt that the browser can independently verify.
Autopilot can replay the last 90 days of orders to show what would happen before a new rule is activated.
Policy checks the seller's written policies against applicable consumer protection laws.
AI-Powered Insights
Insights, built with AG Studio, gives sellers three main capabilities:
- Brief: A quick overview of important delivery issues.
- 3D Atlas: A visual view of where deliveries fail.
- Ask Doorstep: An AI agent that answers questions with charts, creates pages to follow up with carriers, and records every action it takes.
Buyers can also use their own AI assistants to report delivery problems through our MCP server and receive signed delivery proof they can independently verify.
How we built it
PayPal Integration
We integrated:
- PayPal Orders v2: Shipping options, order updates before capture, and payment capture.
- PayPal Shipment Tracking: Tracking information linked to payments.
- PayPal Refunds: Refund processing.
- PayPal Disputes: Evidence submission and refund offers.
- PayPal Webhooks: Verified event handling.
Orders and Payments use the official PayPal Server SDK generated by APIMatic. The runtime case agent uses the PayPal Agent Toolkit with read-only access.
Payment Safety
We designed the system so AI cannot directly move money.
- All payment operations go through a single module (
app/policy). - Every PayPal write uses a transactional outbox and one
PayPal-Request-Idto prevent duplicate operations. - CI import checks ensure AI modules cannot access PayPal write operations.
AI and Machine Learning
- Claude Sonnet and Gemini: Used through a single adapter, with Gemini as a fallback.
- Pydantic: Every AI response must follow a defined schema.
- Temperature 0: Keeps AI outputs consistent.
- Coded fallbacks: Invalid AI responses fall back to predefined templates or human review.
- XGBoost + TreeSHAP: Predicts delivery risk and explains the factors behind each prediction.
- BM25: Retrieves relevant sections from policy documents.
- AG Grid AI Toolkit: Powers natural-language interactions with seller data.
- AG Studio Agent Framework: Powers the AI assistant in Insights.
Technology Stack
- Backend: Python 3.12, FastAPI, PostgreSQL.
- Frontend: React 19, TypeScript.
- Data Grid and Visualisation: AG Grid 36 Enterprise, AG Studio 3.1, AG Charts.
- AI/ML: Claude Sonnet, Gemini, XGBoost, TreeSHAP, FastMCP.
- Payments: PayPal APIs, PayPal Server SDK, PayPal Agent Toolkit.
- Shipping: Shippo API (test mode).
- Testing: pytest, Hypothesis, Schemathesis, Playwright, Promptfoo, Ragas.
- Infrastructure: Render, GitHub Actions.
Challenges we ran into
- Keeping AI away from payments: We needed to ensure AI could never directly issue refunds or move money. We enforced this through the system architecture rather than relying on prompts.
- Preventing duplicate refunds: We had to handle retries, webhooks, and cases where buyers close their browsers during payment operations.
- Verifying delivery failures: We needed to challenge unreliable "Delivered" scans without wrongly accusing buyers. Conflicting evidence is sent for human review.
- Protecting sensitive information: We gave the Studio agent useful tools while restricting its access to postcode districts rather than exact addresses.
Accomplishments we're proud of
- Completed a real PayPal sandbox refund with a receipt that could be verified end to end.
- 1,984 automated tests.
- 100% branch coverage across payment and state-management code.
- Zero surviving logic mutants in policy testing.
- 49 API operations tested through fuzzing.
- 64 prompt-injection red-team tests with zero unsafe responses reaching buyers.
- Built a signed delivery proof that addresses an open gap in agent-payment standards (VCAP-AP2).
What we learned
- Sellers need fewer explanations and one clear next action.
- Legal rules should live in versioned files that the application can read, not inside AI prompts.
- A data grid can be the main product experience when it helps users understand their data and tells them what to do next.
- AI is most useful when its decisions can be checked, explained, and traced.
What's next
- PayPal Multiparty: Allow sellers to onboard through PayPal Partner Referrals.
- Connect-only mode: Support sellers who already have their own checkout systems.
- Dispute evidence: Submit verified possession proofs directly as PayPal dispute evidence.
- Delivery intelligence network: Build a shared network that identifies patterns in failed deliveries across participating shops.
- More integrations: Extend the same system to Shopify, WooCommerce, and other marketplaces.
Built With
paypal-orders-v2, paypal-payments, paypal-disputes, paypal-webhooks, paypal-shipment-tracking, paypal-server-sdk, apimatic, paypal-agent-toolkit, claude-sonnet, gemini, xgboost, fastmcp, python, fastapi, postgresql, react, typescript, ag-grid-enterprise, ag-studio, ag-charts, playwright, render, github-actions, shippo.
AI Tools Used and How
Claude Sonnet (Anthropic) and Gemini (Google)
Used through a single AI adapter, with Gemini as a fallback. They power:
- Explanations for buyers and sellers.
- Carrier claim drafts based on verified evidence.
- Packing photo checks.
- Seller policy analysis.
- Read-only case investigation.
- Natural-language questions about delivery data.
Every AI response must follow a defined schema. Invalid responses fall back to predefined templates or human review.
PayPal Agent Toolkit
Provides the case agent with read-only access to PayPal orders, shipments, and disputes.
AG Grid AI Toolkit and AG Studio Agent Framework
Power natural-language questions about seller data and the AI assistant in Insights.
XGBoost and TreeSHAP
Used to predict delivery risks and explain the factors behind each prediction. The model was trained on synthetic data, with its model card available in the repository.
FastMCP
Powers the MCP server that allows buyers' AI assistants to report delivery problems and retrieve signed delivery proofs.
Built With
- ag-charts
- ag-grid-enterprise
- ag-studio
- apimatic
- claude-sonnet
- fastapi
- fastmcp
- gemini
- github-actions
- paypal-agent-toolkit
- paypal-disputes
- paypal-orders-v2
- paypal-payments
- paypal-server-sdk
- paypal-shipment-tracking
- paypal-webhooks
- playwright
- postgresql
- python
- react
- render
- shippo
- typescript
- xgboost

