-
-
-
Manage case assignments, deadlines, and customer waiting states.
-
A clear overview of resolution cases, commitments, and recorded refund balances.
-
Trace payment verification, commitments, approvals, and refund events chronologically.
-
Merchant approval and refund execution recorded as separate operations.
-
An eight-dollar payment, an eight-dollar refund, and zero remaining.
-
Compare store records with PayPal evidence while keeping discrepancies visible.
-
A specific refund promise linked to its source and supporting evidence.
-
A buyer-facing summary of the agreed refund, confirmed amount, and final outcome.
-
The customer’s cancellation and refund request attached to the original case.
-
Store orders linked to Resolve through the custom TypeScript SDK.
-
Follow the conversation from the initial complaint to the refund-verification request.
-
The original transaction, customer issue, and resolution status in one connected case.
-
Private customer access to shared case progress and conversations.
-
Review PayPal-backed findings, proposed next steps, and evidence-freshness safeguards.
-
A recorded history of workspace activity for traceable operations.
Inspiration
A successful payment doesn’t necessarily mean the users issue has been resolved.
We wanted a tool to help bridge the gap between payment and actionable information. So we can provide clarity for both sides on what needs to be done after the payment has been made.
For example, when a refund is requested by a user. We have a receipt in the system, payment made by the merchant and a refund promised in a conversation. How do we know if that has been done?
It’s important to clarify the difference between approvals, requests and completed refunds.
This is how we came up with Resolve. We wanted to link all these parts together and ensure the post payment process is treated with the same attention to detail.
Vision
We wanted all the information about the refund to be stored so they can be viewed as a case. This gives clarity to the merchant on what’s happening with the case. They know what happened in the original transaction, what the issue was and what they have committed to. If a customer wants to check on progress, there’s a place for them to go.
AI will play a key role here. It will gather information on the case to determine what action needs to be taken. We want to know if the refund has been made by looking at the associated payment evidence. Also when there isn’t enough evidence to give a reliable answer.
Financial authority will be maintained using explicit approvals from the merchant and server-side validation.
Implementation
The main UI is built with Next.js and TypeScript. The merchant dashboard provides cases, conversations, promises, payment details and evidence history. The customer can raise an issue via the associated storefront and view their case privately.
The backend is built with Python, FastAPI and Pydantic. All financial rules are maintained server-side. We have a transactional store for the workflow. We’re using SQLite locally and PostgreSQL.
There are two different integrations. We’re using the REST API to interact with PayPal payments. We authenticate using OAuth on the server. The store creates an order, redirects the buyer to the PayPal approval page and then captures the payment once approved. The server works out the price from the catalogue and validates the payment details match the order (amount, currency, seller and references).
The custom Resolve SDK (built with TypeScript) allows us to integrate with the stores order and support systems. The example Node.js storefront uses this to add payment references, open/create a resolution case, raise a customers issue (after validating they own the order) and get safe progress details. The integration details are maintained server-side.
In the demo, a customer buys an 8 dollar Brew Brush from the official PayPal Sandbox. The customer asks for a cancellation. The merchant logs an 8 dollar refund promise. These are approved and executed separately. Once we’ve received confirmation from PayPal, we consider the refund complete.
When the customer asks if the refund has been completed, Resolve investigates the associated transaction. The AI looks at any available evidence and the backend validates the results. The workflow determines what action needs to be taken.
Behind this, the investigation automatically queues a background job. The Groq AI agent looks into the issue and can ask for limited evidence from the associated PayPal data. The backend ensures the action to be taken matches the facts and we know the case hasn’t changed whilst we investigated. In our example, 3 findings were found from PayPal to confirm no further refund actions were required. The model doesn’t have any authority to approve or execute payments.
Challenges
One common issue was what counts as evidence. A merchant promise is a commitment, it doesn’t prove that PayPal have issued the refund. We’ve separated these two pieces of information. We track any pending/refunded failures explicitly. We use decimal math for any financial calculations. Any cases that share the same capture will share the same refund amount. This means we can’t open a new case and have another 8 dollars available.
When handling retries, we need to be careful. The request may time-out after being approved by the provider. If we treat this as a simple failure, we may attempt to refund again. We track the request IDs so we know what has been requested. We put any uncertain results into a pending state. We can recover from these using the existing request and provider evidence. Approvals are bound to the reviewed state and can become invalid if this changes.
We found an issue with the investigation flow. The model may ask for a resource we have already validated. However, the worker may exit as we’ve recently refreshed this so can’t read it again. We’ve adjusted this so that we only reuse new, valid facts from this associated resource. We still validate ownership, freshness and case versions. This couldn’t have been resolved with a prompt.
The UI can get quite slow if too many panels are making immediate requests. We’ve implemented limited connection pooling, delayed panels and incremental case loading. We still have financial authority to ensure we don’t use the information until we have everything we need.
Learnings
One major learning was that we don’t need to use AI everywhere. Calculations, permissions and approvals should be handled in normal code. Using AI gives us value when trying to understand the customers issue.
We also learnt what is involved in building an agent. We need to retrieve evidence, handle background jobs, retries and ensure the answer we get is valid based on changing case information.
Security is important. We need to know what the model has authority over. Whilst it can ask for limited evidence, it can’t approve or execute payments. We validate ownership and outputs server-side. We can’t rely on instructions within a prompt.
We did some red teaming. We tried to hide buyers instructions as merchant promises. In one full Groq evaluation, none of the 50 synthetic prompt injected examples were successful. This gives us confidence that the cases we’ve tested are secure. There are still more attacks to look into.
We learnt to keep things transparent. If there’s a pending refund or no evidence, there should be a clear action.
What’s Next
We’ve validated our payment flow in the PayPal Sandbox. We want to ensure our hosted workflow, incoming webhooks and recovery are working in a production environment before we say this is ready for use.
We have return, replacement and dispute evidence package workflows within the code. We want to test these more and ensure things are clear when multiple people/conditions are involved in the resolution of an issue. Submitting disputes formally is future work.
We want to help give both parties a unified and traceable answer.
We know money has moved based on the payment receipt. We want to help make everything else as clear. What did the customer ask for, what has the merchant committed to and has this been fulfilled?
Built With
- fastapi
- groq
- next.js
- node.js
- openapi
- paypal
- playwright
- postgresql
- python
- react
- sqlite
- typescript