> Markdown version of https://www.imranjan.cn/projects/p-plusone for AI agents and other programs. It carries the same public information as the web page. Built 2026-11-24.

October 2026

# PlusOne

Live-selling orders with PayPal checkout

PayPal AI Hackathon

A live-selling assistant I built for the PayPal AI Hackathon. Buyers just talk in chat, mixing English, Malay, Chinese and Thai; PlusOne keeps one correct parcel per buyer and collects with PayPal.

Tags: Hackathon, AI Agent, Payments, PayPal API

![PlusOne](https://www.imranjan.cn/images/projects/plusone-2026/cover.svg)

### Project resources

The code is public on GitHub; the README covers running and testing it locally. In the live demo you can order and pay with a PayPal sandbox account. The demo video is on YouTube, and the Devpost page has the full write-up.

[Source code](https://github.com/narmi924/plusone)
[Watch the demo](https://youtu.be/uMYv5OYjl1Y)
[Try the live demo](https://plusone-sjgp.onrender.com/live/lumicloset)

## Event

#### Hackathon

PayPal AI Hackathon

- **Organizer**: PayPal, hosted on Devpost
- **Brief**: Use PayPal and AI meaningfully together, with PayPal at the core
- **Result**: Submitted
[Hackathon website](https://paypalaihackathon.devpost.com/)

#### Entrant

- [Me](https://github.com/narmi924)
Engineered end to end; used Claude Code for rapid iteration, testing and refactoring.
- **Time**: Ten days
- **Code**: About 14,500 lines of TypeScript
- **Runtime**: Render, Singapore region, on the PayPal sandbox

## Background

Many small sellers in Southeast Asia sell clothes, snacks and handmade things on live video. Their buyers don't fill in order forms. They type "+1", "the blue one from before, M", "change to L, don't add another", "if no M forget it", in English, Malay, Chinese and Thai at once. After the live the seller scrolls back through the chat and rebuilds the orders by hand, and buyers who said +1 and never paid keep items off sale.

Comment-selling tools already exist: CommentSold and SoldLive in the US, SHOPLINE in Hong Kong and Taiwan, EasyStore and BigSeller in Southeast Asia. All of them need buyers to follow a format such as "A1+1". PlusOne lets buyers say it however they like: it follows the conversation the way a person does, keeps one parcel per buyer, asks only when it really can't tell, and collects with PayPal.

![The buyer's live page: the host holds up a rattan bag, the price label follows, and the buyer's parcel and PayPal button are on the right](https://www.imranjan.cn/images/projects/plusone-2026/buyer-live.jpg)

The buyer's live page. Aisha typed "the blue one from before, M", then "tukar L, jangan tambah" (Malay: change to L, don't add another), and her parcel holds one Linen Wrap Dress in Blue L.

## How it works

PlusOne has two screens: the buyer's live page and the seller's packing table. The look comes from a packing room: a kraft-paper table, shipping labels, yellow price tags.

![Auto-pay waiting for the buyer to choose a pattern](https://www.imranjan.cn/images/projects/plusone-2026/autopay.jpg)

Aisha said "and the scarf too", PlusOne asked which pattern, and her parcel shows auto-pay waiting for her answer.

### Buyers: say it, and the parcel is right

A name is all it takes to order; PayPal brings the email and address at checkout. Everything ordered in one live goes into one parcel, drawn as the shipping label it will become: paid items marked PAID, what is still held added up at the bottom with the time left and one button to pay. PlusOne replies privately, in the buyer's language.

At the first checkout a buyer can save PayPal with the shop and pay with one tap next time, or turn on auto-pay for this live, up to $50, $100 or $200\. Payment goes 15 seconds after the order last changed, so "and the scarf too" joins the same payment; while PlusOne is asking her something, auto-pay waits for the answer.

![The seller's packing table: a buyer's question on top, five orders waiting to pay below](https://www.imranjan.cn/images/projects/plusone-2026/seller-book.jpg)

A busy minute: a buyer's question on the red tape, five orders waiting to pay, one cancelled.

### Sellers: one packing table

The seller sees three manifests: waiting to pay, paid and ready to pack, sent. Things only a person can decide sit on red packing tape across the top, such as a question the shop's policies don't answer or a refund request, with Reply right there.

The host can just talk: "dress and blouse together, five dollars off" becomes a card that applies when tapped. With Let PlusOne watch on, whatever the host holds up to the camera goes on screen for buyers.

![Ask PlusOne: four PayPal invoice reminders waiting for the seller's approval](https://www.imranjan.cn/images/projects/plusone-2026/ask-plusone.jpg)

After the live, four PayPal invoice reminders lined up as cards, waiting for Approve all.

### After the live: Ask PlusOne

The seller can ask "who still owes?". PlusOne reads tonight's orders, stock and waitlists, and the shop's invoices, refunds, tracking and disputes through PayPal's Agent Toolkit.

It sends nothing by itself. Reminders, invoice reminders, cancellations, refunds and shipping come back as cards the seller approves one by one or all at once.

## Implementation

The split is fixed: Claude decides what a buyer meant; code decides price, stock and holds; an item is sold only when PayPal says the payment is COMPLETED.

Each message goes to Claude with what is on screen, what was shown before, the buyer's parcel, waitlists, deals, the shop's policies and what the host said in the last minute. It comes back as a structured action (buy, change, cancel, question, waitlist and so on), which the server applies in the order messages arrived.

![PlusOne architecture: buyer and seller pages, the service and background tasks on Render, PayPal, Claude and Deepgram](https://www.imranjan.cn/images/projects/plusone-2026/architecture.png)

The architecture. PlusOne's own code is in yellow.

##### Collecting with PayPal

Payments use Orders v2, created and captured on the server with the PayPal Server SDK; an item is marked sold only after a signature-verified webhook. Cancelling a paid item is a partial refund, shipping syncs tracking to PayPal, and buyers who still owe after the live get an Invoicing v2 invoice.

##### Saved PayPal and auto-pay

At the first checkout the buyer's PayPal is saved to the Vault; later payments complete in one call with the vault id. Each buyer has their own payment token; the limit is checked again at the moment of payment, and a declined payment turns auto-pay off instead of retrying.

##### The host's camera and voice

Every two seconds the console sends a small frame and Claude names the product being held up; it goes on screen only when two frames in a row agree, and frames are not stored. The host's voice goes through Deepgram and becomes cards for new products, prices, bundles and limits, which change nothing until the host taps Apply.

##### Closing out the live

When the host ends the live, Render Workflows invoices every buyer who still owes in parallel, each retrying on its own, then writes the seller a to-do list for tomorrow. A few minutes before a hold runs out, the buyer is reminded once, in their language.

### Technologies

#### Front end

ReactSocket.IOLiveKitAG Studio

#### Server

FastifyPostgreSQLRender Workflows

#### PayPal

Orders v2VaultWebhooksInvoicing v2Agent Toolkit

#### AI

Claude Opus 5.5Deepgram

## Problems solved

All four are about money or stock.

##### Everyone shared one payment token

**Problem**Everyone trying the demo uses the same PayPal sandbox account and would get the same Vault token, so one person's "Forget my PayPal" broke everyone else's one-tap payment.

**Fix**Turned on the SDK's permitMultiplePaymentTokens: each buyer gets their own token, and its description tells the buyer which shop they are saving it for.

##### A retry must never charge twice

**Problem**A retry after a timeout, or a buyer changing the order after opening the PayPal window, could charge too much or for the wrong items. The PayPal SDK also has no timeout or retries by default.

**Fix**Every call that moves money carries a PayPal-Request-Id; a saved-PayPal charge is written down before it is sent; a PayPal window opened before the order changed does not capture. The client sets timeouts and retries, and only POSTs with a request id are retried.

##### Auto-pay that fires too soon pays for the wrong thing

**Problem**A buyer may order in one message and add something in the next, or PlusOne may still be asking which colour. Charging at once would get it wrong.

**Fix**Every change restarts a 15-second countdown, and an open question from PlusOne or a message still being read holds it. Waitlisted items and conditional orders such as "if no M, forget it" are never bought on the buyer's behalf.

##### Several buyers, one last item

**Problem**In a live sale several buyers often want the last one at once; their messages arrive almost together, and each could think they got it.

**Fix**The server applies messages in the order they arrived and holds stock under a row lock, so later buyers go on the waitlist; an item is sold only when PayPal reports the payment complete.

## Results

I wrote a messy live chat: ten buyers and 22 messages in English, Malay, Chinese and Thai, with pointing back, changes of mind, a cancellation, a condition, one order split over two messages, questions and chat. Next to it is what a careful seller would write down for each buyer. The test plays it through the real chat pipeline on a fresh shop and compares every parcel.

10 / 10parcels right, three runs in a row

16 / 22messages place, change or cancel

1 / 16written in a fixed format

\~3 sto reply to a message

__Messy chat test__
| Item                                                                                      | Result                                                                                         |
| ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Messages that place, change or cancel an order                                            | 16 of 22                                                                                       |
| Of those, written as a product code with a quantity, or a bare "+1" for a one-option item | 1                                                                                              |
| Parcels at the end, three runs in a row                                                   | 10 of 10 each time                                                                             |
| Questions PlusOne asked                                                                   | 1: "+1" with the blouse on screen and no colour or size yet                                    |
| Passed to the seller                                                                      | 1: "is the dress see-through?", which the shop's policies don't cover                          |
| AI eval cases                                                                             | 25 chat cases and 8 host-speech cases, including Malay, Chinese, Thai, Indonesian and Singlish |

## Demo & Submission

In the live demo you can order straight away and pay with the sandbox account shown under the pay button.

[![PlusOne demo video cover: the host holds up a rattan bag next to "Buyers just talk"](https://www.imranjan.cn/images/projects/plusone-2026/video-poster.jpg)Watch the demoOpens on YouTube](https://youtu.be/uMYv5OYjl1Y)

[Source code (GitHub)](https://github.com/narmi924/plusone)
[Live demo](https://plusone-sjgp.onrender.com/live/lumicloset)
[Devpost submission](https://devpost.com/software/plusone-g8lj27)

## Other pages

- [Home](https://www.imranjan.cn/index.md)
- [About me](https://www.imranjan.cn/about.md)
- [Projects](https://www.imranjan.cn/projects.md)
- [Photography](https://www.imranjan.cn/gallery.md)
- [LCIMS Cloud](https://www.imranjan.cn/projects/p-lcims.md)
- [imranjan.cn](https://www.imranjan.cn/projects/p-portfolio.md)
- [Gatehouse](https://www.imranjan.cn/projects/p-gatehouse.md)
- [Gantry](https://www.imranjan.cn/projects/p-gantry.md)
- [BYOF Agent](https://www.imranjan.cn/projects/p-byof-agent.md)
- [Shopping Copilot by KI](https://www.imranjan.cn/projects/p-shopping-copilot.md)
- [Look2Act](https://www.imranjan.cn/projects/p-look2act.md)
- [AccessAudit - On-Chain Access Approval & Audit System](https://www.imranjan.cn/projects/p-accessaudit.md)
- [Eye Touch - Real-time Eye Tracking and Gaze Control System](https://www.imranjan.cn/projects/p-eyetouch.md)
- [China Collegiate Computer Competition—Mobile Application Innovation Contest](https://www.imranjan.cn/projects/p-yigui.md)
- [Nilufar Restaurant Expense Management System](https://www.imranjan.cn/projects/p-nilufar.md)
- [Voice-Interactive LED Light Panel](https://www.imranjan.cn/projects/p-led.md)
- ["Mengsheng Cup" Electronic Design Competition](https://www.imranjan.cn/projects/p-msb.md)
- [NUS SOC SWS 2024](https://www.imranjan.cn/projects/p-nus.md)

中文版本：https://www.imranjan.cn/zh/projects/p-plusone.md
