SecondCut — Give Every Cancelled Order a Second Chance
An AI-powered commercial resolution agent that transforms cancelled custom orders into financially safe, mutually approved, and PayPal-verified transactions.
Inspiration
A cancelled order isn't always just a refund. Sometimes, it represents a much bigger problem.
Imagine a small furniture manufacturer receiving a $2,000 custom desk order. Production begins, materials are purchased, and work is underway. Suddenly, the buyer's requirements change.
Traditional commerce systems typically offer limited choices: cancel the order, issue a refund, or manually negotiate a replacement.
But what happens to the unfinished product, invested materials, production costs, and the opportunity to satisfy the customer?
The buyer wants a fair resolution. The seller wants to recover value. Both need transparency and trust.
We built SecondCut around one question: What if AI could find a better commercial outcome before a cancelled order became a financial loss?
Rather than treating cancellation as the end of a transaction, SecondCut treats it as an opportunity for intelligent, financially responsible recovery.
What It Does
SecondCut is an AI-powered commercial resolution platform that helps buyers and sellers negotiate complex order changes, evaluate alternatives, and execute approved financial outcomes through PayPal.
It combines generative AI reasoning with deterministic financial safeguards, multi-party approvals, and verifiable payment execution.
1. Understands Complex Commercial Requests
Buyers can describe changing requirements in natural language.
Instead of forcing users through rigid refund forms, SecondCut uses Google Gemini to interpret their requests, identify constraints, and understand the underlying commercial problem.
2. Generates Intelligent Alternatives
SecondCut goes beyond extracting information.
Its AI generates context-aware commercial alternatives based on buyer requirements, seller constraints, available recovery options, and financial considerations.
For example, when a buyer changes the specifications of a partially manufactured product, the system can propose alternative arrangements instead of immediately cancelling the transaction.
Each proposal includes an explanation of the proposed resolution and its tradeoffs.
3. Enforces Financial Safety Independently of AI
AI proposes. Deterministic rules validate. Humans approve. PayPal executes.
This is the central design principle behind SecondCut.
AI-generated suggestions are never automatically trusted as financially valid.
A separate deterministic validation layer evaluates proposed actions against applicable commercial constraints and financial rules.
Unsafe or infeasible proposals are rejected before they can become commitments.
This separation enables flexible AI reasoning without surrendering financial control to a probabilistic model.
4. Coordinates Multi-Party Approvals
Commercial decisions often affect multiple stakeholders.
SecondCut provides a structured, three-role approval workflow so relevant parties can review proposed terms, understand their financial implications, and approve the outcome before sensitive actions proceed.
Every decision becomes part of a traceable resolution history.
5. Executes Real PayPal Sandbox Transactions
SecondCut connects commercial decisions to actual payment operations through the PayPal Developer Platform.
The demonstrated workflow includes:
- PayPal sandbox payment authorization and capture.
- Approved refund execution.
- Verified PayPal webhook processing.
- Transaction-linked audit evidence.
- Safeguards against duplicate financial execution.
In our demonstrated scenario, SecondCut processes a $1,700 replacement capture and a $900 refund through PayPal's sandbox environment.
These are sandbox financial operations, not simulated UI animations or live-money transfers.
6. Provides Verifiable Resolution Evidence
SecondCut maintains an auditable record connecting commercial decisions to their financial outcomes.
The system records proposal decisions, policy validation, approvals, payment operations, and verified transaction events.
This helps users understand not only what happened, but also why it happened and what evidence supports it.
7. Identifies Potential Commercial Conflicts
SecondCut can surface concrete warning signs such as ambiguous specifications, conflicting requirements, missing approvals, expired quotations, and delivery-related disagreements.
Rather than claiming to predict disputes with unvalidated accuracy, it uses identifiable risk indicators to support earlier intervention.
How We Built It
We designed SecondCut as a controlled AI decision-and-execution workflow rather than a conventional chatbot connected to payment APIs.
The architecture separates responsibilities into distinct layers:
1. AI reasoning layer
Google Gemini interprets commercial requests and generates potential resolution alternatives.
2. Deterministic financial validation layer
Independent business rules evaluate the feasibility and financial safety of proposed outcomes.
3. Approval and workflow orchestration layer
A structured workflow coordinates stakeholder decisions, proposal states, and authorization requirements.
4. PayPal execution layer
PayPal sandbox APIs handle the supported financial operations, while verified webhooks provide transaction evidence.
5. Audit and reliability layer
The application tracks important state transitions and protects financial workflows against duplicate events, concurrent operations, and uncertain outcomes.
Our Architecture
Buyer Request
|
v
Gemini AI Understanding
|
v
AI-Generated Commercial Alternatives
|
v
Deterministic Financial Validation
|
+---- Unsafe → Reject / Revise
|
v
Stakeholder Review & Approval
|
v
PayPal Sandbox Execution
|
v
Verified Webhooks
|
v
Auditable Financial Resolution
The important architectural decision is that AI does not directly control financial execution.
It contributes commercial intelligence, while deterministic software and explicit authorization control the actual movement of money.
Challenges We Faced
Challenge 1: Making AI Genuinely Useful
Our initial AI implementation focused primarily on understanding and extracting requirements.
While useful, this did not fully exploit the potential of agentic commerce.
We improved the system to generate context-sensitive commercial alternatives and explain their tradeoffs.
We also evaluated contrasting scenarios to demonstrate that different constraints can lead to different outcomes, including rejection of incompatible requests.
What we learned: Meaningful AI integration requires the model to contribute to decision-making, not merely summarize information.
Challenge 2: Preventing Financially Unsafe AI Decisions
Generative models can produce plausible proposals that violate real-world financial or contractual constraints.
Allowing such outputs to trigger payments would introduce unacceptable risks.
We addressed this by separating AI proposal generation from deterministic financial validation and human approval.
What we learned: The most valuable financial agents are not necessarily the most autonomous. They are the ones whose autonomy is bounded by verifiable controls.
Challenge 3: Making Payment Execution Reliable
Payment workflows must handle much more than successful API responses.
Duplicate webhooks, concurrent requests, timeouts, retries, and uncertain transaction outcomes can create serious financial inconsistencies.
We developed safeguards and automated tests around these failure scenarios.
Our evaluation includes 111 automated tests and 12 provider checks, while distinguishing controlled failure-recovery tests from actual PayPal sandbox interactions.
What we learned: Reliable financial software must be designed around uncertainty, idempotency, and reconciliation—not just the happy path.
Challenge 4: Proving That the System Actually Works
A polished interface alone cannot demonstrate trustworthy financial execution.
We therefore focused on showing actual sandbox payment operations, verified transaction events, stakeholder approvals, and linked evidence.
We also separated verified financial completion from physical fulfillment, which remains outside the completed sandbox transaction demonstration.
What we learned: Evidence is more persuasive than ambitious claims.
Challenge 5: Measuring Impact Responsibly
SecondCut is designed to reduce manual coordination and improve commercial recovery workflows.
However, prototype demonstrations are not equivalent to validated real-world customer outcomes.
We developed controlled workflow measurements and comparisons while avoiding unsupported claims about actual merchant savings or production-scale performance.
What we learned: Credible impact requires transparent methodology, reproducible evidence, and clear limitations.
Accomplishments We're Proud Of
- Built an AI-assisted commercial resolution workflow that goes beyond simple request classification.
- Integrated Gemini-generated alternatives with independent deterministic financial safeguards.
- Implemented structured multi-party approvals before sensitive commercial commitments.
- Demonstrated real PayPal sandbox capture and refund operations.
- Connected financial outcomes to verified webhook evidence.
- Developed automated reliability coverage for important financial failure scenarios.
- Evaluated AI behavior across contrasting commercial constraints.
- Produced a complete end-to-end demonstration connecting AI reasoning, approvals, and payment execution.
Most importantly, we demonstrated that AI can help make commercial decisions without being given unchecked authority over financial transactions.
My Contribution
I independently designed, built, tested, documented, and presented SecondCut.
I implemented the Gemini-assisted commercial recovery workflow, deterministic financial and physical safety controls, multi-party approval flow, PayPal Sandbox authorization/capture/refund integration, signed webhook verification, failure-recovery handling, automated tests, evaluation evidence, and demo video.
I was responsible for taking the project from its initial concept through implementation, testing, and final presentation.
What We Learned
Building SecondCut changed how we think about AI agents in commerce.
We learned that an intelligent payment experience requires more than connecting an LLM to a checkout API.
It requires understanding commercial intent, generating feasible alternatives, protecting financial constraints, coordinating human decisions, and verifying the outcome.
We also learned that AI and deterministic software are complementary.
AI is powerful at interpreting ambiguity and proposing creative options. Traditional software is essential for enforcing precise financial rules and transaction safety.
Combining these strengths produces a more credible foundation for agentic commerce.
What's Next for SecondCut
Validate the workflow with custom furniture makers: Use anonymized cancellation scenarios, maker-confirmed modification constraints, and real cost estimates.
Test an opt-in buyer-request pool: Learn whether viable recovery matches can be found without compromising consent or privacy.
Pilot the focused tabletop workflow end-to-end: Include maker readiness, buyer receipt, and physical handoff evidence.
Expand carefully into adjacent custom-order categories: Validate their specific material, modification, pricing, and delivery constraints before expanding.
Continue hardening payment operations: Work toward production-grade merchant authentication, monitoring, reconciliation workflows, and jurisdiction-specific refund policy review.
SecondCut's next milestone is not broader automation. It is proving that controlled AI recovery produces commercially useful outcomes in real workshop operations.
Built With
- agentic-ai
- agentic-commerce
- ai-agents
- ai-decision-making
- api
- financial-safety
- generative-ai
- google-gemini
- human-in-the-loop
- idempotency
- javascript
- next.js
- node.js
- payment-processing
- paypal
- paypal-rest-api
- paypal-sandbox
- paypal-webhooks
- react
- rest-apis
- typescript
- webhooks
- workflow-automation

