Inspiration
A completed payment does not mean an order was delivered. And when a customer reports that an item never arrived, a merchant may have to piece together tracking information, carrier messages, delivery confirmations and transaction records to understand what actually happened.
I started thinking about how much of this process depends on scattered information and manual interpretation. More importantly, what happens when the available evidence is incomplete, contradictory or simply unclear?
I wanted to build something that helps merchants organize that information without allowing AI to make decisions it cannot justify.
That became Delivery Gate.
What it does
Delivery Gate connects PayPal transaction records with delivery evidence and provides a structured way to assess the information associated with a payment.
It allows merchants to:
- Create and capture PayPal Sandbox payments and associate them with individual assessment cases.
- Retrieve and preserve actual PayPal transaction responses.
- Submit delivery-related documents and extract relevant facts using an AI model.
- Track where each extracted fact came from, who made the statement and whether it is ambiguous.
- Apply deterministic validation to identify unsupported, unsuitable or conflicting information.
- Review, accept or reject extracted facts through a human review process.
- Preserve evidence, extraction results, validation snapshots and review history across application restarts.
One principle guided the implementation: AI extracts evidence. It does not decide the outcome.
A merchant's statement is not automatically a carrier confirmation. A reviewer's attestation is not the same as independent verification. And a PayPal Seller Protection eligibility field is recorded as an observation, not treated as a legal decision by Delivery Gate.
PayPal retains the final decision.
How we built it
I built Delivery Gate around a separation of responsibilities.
The PayPal integration handles order creation, buyer approval, payment capture and retrieval of transaction information. Each order is associated with a persistent assessment case.
The evidence extraction layer uses a configured language model to identify relevant facts from submitted text. Instead of asking the model to decide whether a merchant is protected, I constrained its responsibility to extracting information and preserving its source.
A deterministic validation layer then checks the extracted facts against allowed evidence types and validation rules. It handles issues such as ambiguous dates, unsupported claims, conflicting information and incorrect attribution.
Finally, a human review layer records reviewer decisions, identity and timestamps.
I also built persistence into the workflow so that transaction associations, evidence, extraction results and review decisions survive application restarts.
The project includes an automated test suite covering the extraction, validation, persistence and transaction-association workflows.
Challenges we ran into
One of the hardest problems was preventing an AI model from turning uncertain statements into confident facts.
A document might say that a package was delivered without establishing who made that statement. A merchant might repeat something a customer said, but that does not make the merchant a carrier. A date might be present without enough information to determine the year.
Treating all extracted information as equally reliable would defeat the purpose of the system.
I had to pay particular attention to source attribution, ambiguity preservation, normalization, contradictory documents and unsupported claims.
Another challenge was integrating PayPal without confusing payment completion with delivery confirmation. A successful capture proves that a payment was captured. It does not prove that an order reached its recipient.
Getting the boundaries right mattered more than making the interface look impressive.
Accomplishments that we're proud of
I'm proud that Delivery Gate goes beyond a simple document summarizer.
We implemented a working PayPal Sandbox flow covering order creation, buyer approval and capture. The resulting transaction and capture responses are displayed in the application and associated with an assessment case.
We also demonstrated the complete evidence workflow: document submission, AI extraction, deterministic validation, human rejection of unsuitable facts and preservation of the review history after restarting the application.
The system also has automated tests covering important failure cases, not just successful examples.
Most importantly, we resisted the temptation to let the AI invent certainty where the evidence does not support it.
What we learned
Building Delivery Gate reinforced an important lesson about AI in financial workflows: extracting information and making a decision are two very different responsibilities.
A model can identify a delivery date, but that does not establish that the source is authentic. A document can contain a tracking number, but that does not establish that a carrier issued it.
We learned that provenance, deterministic validation and human oversight are not optional extras in systems like this. They are part of the core product.
We also learned that integrating a payment API is only one part of building a reliable workflow. The relationships between transactions, evidence, decisions and historical records matter just as much.
What's next for Delivery Gate
The next step is to move beyond the current demonstration and build toward a production-ready evidence workflow.
I'd like to expand document support to PDFs and images, introduce integrations with real carrier tracking services, improve evidence authenticity checks and develop a more complete workflow for managing actual PayPal disputes.
I also want to strengthen the system's ability to handle multiple documents, identify conflicting claims and show exactly how each piece of evidence affects an assessment.
The long-term goal is straightforward: help merchants make sense of delivery evidence without pretending that an AI model can replace independent verification or PayPal's decision-making process.
