Inspiration

“Cancel my order—but only if it hasn’t shipped.”

This request contains a condition that a merchant must verify before deciding what to do. Cancelling an order and voiding its payment authorization are also separate operations.

I built PayPal Cancellation Assistant to help merchants preserve customer conditions, document their evidence, and control when an eligible payment action can happen.

What it does

The application supports two distinct workflows:

Conditional request review: AI extracts cancellation intent, explicit order references, reasons, conditions, and supporting quotes. Merchants can save a pending review, record evidence, reopen it, and update their finding while preserving previous findings, notes, and timestamps.

Conditional requests remain blocked from cancellation and void—even after a merchant records “Condition met.” A recorded finding does not authorize a payment action.

PayPal Sandbox authorization void: For eligible unconditional requests, the backend checks the reference against the manually selected order. The merchant separately approves simulated local cancellation and the Sandbox void. Backend checks verify payment eligibility before execution, and a read-only lookup confirms the outcome.

An optional Shopify integration saves order payment and fulfillment status, source, and query time. These snapshots do not prove carrier handoff, link Shopify orders to PayPal transactions, or authorize payment actions.

How we built it

I used Node.js, Express, and vanilla JavaScript.

The OpenAI Responses API produces structured request analysis that the backend validates. Customer claims and AI interpretations remain separate from retrieved payment facts.

The PayPal JavaScript SDK supports Sandbox buyer approval. PayPal Orders v2 and Payments v2 REST APIs create CAD 100 authorization orders, retrieve payment details, and void eligible uncaptured authorizations. Backend safeguards check ownership, amount, authorization eligibility, and captures, and guard against duplicate or uncertain execution.

Shopify GraphQL Admin API provides optional read-only order snapshots. Saved reviews persist locally. A separate credential-free Mock walkthrough uses preset analysis and fictional evidence without calling external services.

Challenges we ran into

The main challenge was translating natural-language requests into explicit business rules. Recognizing cancellation intent is insufficient: conditions, order-reference ambiguity, customer authority, and payment eligibility require separate handling.

Payment uncertainty was another challenge. Buyer approval, authorization creation, local cancellation, and authorization void are distinct events. I implemented read-only reconciliation so an uncertain result would not lead to blindly repeating a payment operation.

Shopify integration required investigating protected-data access restrictions despite successful authentication and an installed read_orders scope.

Saved reviews also needed stale-update protection so an older form could not silently overwrite a newer merchant finding.

Accomplishments that we're proud of

  • Completed real OpenAI analysis and PayPal Sandbox authorization-void workflows, with void outcomes confirmed through read-only lookups.
  • Built saved conditional reviews with evidence notes, timestamps, and previous findings.
  • Attached real Shopify development-store snapshots to reviews.
  • Created a credential-free Mock walkthrough for exploring the review workflow.
  • Achieved 183 passing automated tests in the latest documented test run, with external services mocked.

The repository includes setup instructions and validation notes that distinguish automated tests from operator-observed integration results and their verification limits.

What we learned

The most important lesson was to separate interpretation, evidence, approval, execution, and verification.

AI can organize a customer request, but its output must not become permission to change a payment. Reliable payment software also needs explicit error states, backend validation, and recovery paths when an operation’s outcome is uncertain.

What's next for PayPal Cancellation Assistant

Next steps include production authentication, account-based review access, verified fulfillment evidence, and usability testing with merchants.

The current application is a local prototype. Payment operations use PayPal Sandbox; local cancellation and shipment states are simulated. Capture and refund are not implemented, and no Shopify-to-PayPal transaction mapping is established.

Future work would preserve these boundaries while measuring whether the workflow helps merchants review cancellation requests more clearly and consistently.

Share this project:

Updates

Submission history