Inspiration
Shopping across stores means juggling tabs, a budget in your head and delivery dates. AI shopping agents promise to fix that, but nobody wants an agent that can quietly overspend. Cartling is built around one rule: the AI may choose, but it may never set a price.
What it does
Cartling is a shopping desk. You name a thing, a spending ceiling and a day you need it by.
- It keeps the cheapest store and the fastest store apart, so you see the tradeoff
- It refuses to add anything that pushes the cart over your ceiling
- Grok picks a store from the options and explains the pick in one sentence
- If the item isn't in the built-in aisle, or you name a brand or model, Channel3 returns live offers from real merchants
- You pay with PayPal (sandbox) and the receipt ID is the PayPal order ID
- You can refund: PayPal returns the money and the desk updates
How I built it
- PayPal Orders v2 (sandbox): create order, buyer approval, capture and refund. After capture, Cartling compares the amount PayPal captured against the desk total and flags any mismatch. The webhook never trusts the amount in its body; it asks PayPal for the order before changing any status.
- AI (Grok via xAI API): chooses a store and writes the explanation. Its tools accept a product and a store (or a Channel3 id) and have no price field at all. Any dollar amount that isn't already on a catalog row is dropped and PayPal is never opened.
- Channel3: live product search across merchants when the sample aisle has no match.
- Server-side rules: prices, ceiling, ship days and sets are computed on the server from a catalog file. The browser cannot change them.
- FastAPI backend, hosted on Render.
Challenges
- Making agentic checkout safe: the model needed freedom to choose, but no ability to move money. I solved it by removing price from the model's tools entirely.
- Never trusting payment state from the client or from a webhook body and verifying amounts against PayPal directly.
- Keeping delivery-day logic correct when results switch from the sample aisle to live Channel3 offers.
Accomplishments I am proud of
- A full loop that works end to end: ask, compare, budget check, PayPal sandbox payment, refund
- A guardrail design where the AI is structurally unable to overspend, not just told not to
What I learned
Agentic commerce is mostly a trust problem. The best place to put safety is in what the tools can express, not in the prompt.
What's next
Live-mode PayPal, more merchants through Channel3, price-drop watching and saved budgets per category.