-
-
The fan's pre-order page after settlement: what is being made, what was charged and what was released.
-
Fan page in PayPal sandbox mode: the cart is held by PayPal at checkout, not charged.
-
Post office list matched to fans across scripts and spellings; tracking goes onto each PayPal capture.
-
Settled in the PayPal sandbox: $41 charged and $36 released on the 3 live holds, checked before charging.
-
At close, cost, profit and spare units per price break; GPT-6.1 recommends make or cancel per item.
-
Receipt notes in each fan's language, written by the model as templates; code fills in every amount.
In short. Who: small studios that make goods in factory batches for fans abroad. Problem: the factory needs a minimum per item, so studios collect money before they know what will be made, and refund it when an item falls short. What Quorum does differently: each fan's PayPal payment is only authorized; at close, Quorum captures just the items that go to the factory plus shipping and releases the rest of the hold, so there is nothing to refund. GPT-6.1 does the language work; code computes every amount.
Inspiration
Illustrators and small studios in Korea sell goods of their own characters, such as acrylic keyrings, stands, sticker sheets, pins and self-published books, in batches of 30 to a few hundred. Factory quotes usually set a minimum order per item, with price breaks above it and sometimes a one-time fee such as a mold for pins.
The usual routine is a demand survey on a web form, then a second round to collect money once the factory order is placed. One public example: a 2021 Postype notice for a self-published book took orders through a Naver form with payment by bank deposit, and warned that with fewer than 50 orders the book might not be made and payments would be refunded (https://www.postype.com/@richjelly/post/8933811). Filling in a survey costs nothing, so the counts are soft. Fans abroad can't easily pay by Korean bank transfer, so their orders get handled by hand or skipped. And if one item falls short after people have already paid, the artist owes partial refunds to dozens of people.
PayPal's authorize-and-capture flow already covers most of the payment side. An authorization holds a fan's money without charging it, and a capture can take less than the full hold. I wanted to see how far that goes when a language model handles the messy text around it (a Korean post, a factory quote, fans writing in different languages, a post office list full of differently spelled names) while plain code keeps control of every amount.
How it differs from what exists
Crowdfunding sites such as Kickstarter also charge only at the end, but against one money goal for the whole project, all or nothing. Keycap group buys do set a minimum per kit, but they take the full amount first and refund the kits that miss it. Quorum never charges for an item until it is going to be made, one PayPal hold covers a fan's whole order, and the creator decides item by item with the factory's price breaks on screen.
What it does
- Draft. The creator pastes their pre-order post and the factory quote as they are. The model turns them into a campaign: items, USD prices for fans, the factory's price breaks, one-time fees, shipping regions, and the creator's own notes about leftover stock. It also lists what it is unsure about, such as which exchange rate to use or whether the VAT note covers the mold fee, and the campaign can't be published until each question is ticked.
- Pledge. A fan picks items and a shipping region. The server prices the cart and creates a PayPal order with
intent=AUTHORIZE. The fan approves in the PayPal popup (JavaScript SDK v6), Quorum authorizes, and the fan gets a page for their pre-order. Progress toward each item's minimum is public. - Ask. Fans can ask questions in any language. The model answers from the campaign data and forwards anything else to the creator. An answer that quotes a dollar amount no cart in this campaign can add up to is not shown; the question goes to the creator instead.
- Decide. When pre-orders close, Quorum computes for each item the factory cost at every price break (VAT included), the estimated profit after a fee allowance, and how many spare units the creator would be left with. The model recommends make or cancel per item from those numbers and what the creator wrote about storage and risk. The creator can override any choice.
- Check. Eight checks are recomputed from campaign prices, apart from the model: no capture above its authorization, every capture equal to the confirmed items plus shipping, every hold equal to the charged part plus the released part, every unit charged covered by the factory order, and so on. If one fails, nothing is sent. Right before charging, Quorum also reads every live authorization back from PayPal and skips any hold that is no longer open or has a different amount. Holds past PayPal's 3-day honor period can be reauthorized in one click first.
- Charge. For each fan: a full capture, a partial capture with
final_capture: trueso the rest of the hold is released, or a void when none of their items are made. Each capture carries anote_to_payerin the fan's language, which PayPal shows in the fan's transaction history and email, and aPayPal-Request-Id, so a retry can never charge twice. A void has no note field, so the creator gets the longer messages as a CSV to send. - Ship. The creator pastes the post office's bulk shipping list. The model matches each row to a fan even when the list has 田中 由紀 and PayPal has Yuki Tanaka, and Quorum adds the tracking number to that fan's capture with carrier
KR_KOREA_POST.
The demo campaign uses fictional data: 133 seeded fans plus three pledges made through the PayPal checkout (in the recorded sandbox run, one on camera and two placed six days earlier), 136 pledges and $3,533.00 held for four items. The keyrings and sticker sheets reach their minimums. The model recommends making the acrylic stand even though it is 2 short of 30, because 30 still shows an estimated profit and leaves 2 spare units; a simple "minimum met?" rule would have cancelled it. For the sticker sheets the screen points out that 300 sheets cost ₩25,520 less than the 212 pledged, but the model keeps 212 because 300 would leave 88 spare and the creator wrote that the studio can keep about 10 per item. The pin is 57 short; making 100 would earn an estimated ₩19,222 and leave 57 unsold, so it is cancelled.
Settling against the local PayPal mock then makes 99 full captures and 22 partial captures and releases 15 holds: $2,841.00 charged, $692.00 released, no refunds. If the money had been collected up front, cancelling the pin would have meant refunding 37 orders.
How I built it
- PayPal. JavaScript SDK v6 (
createInstance,createPayPalOneTimePaymentSession,<paypal-button>) for approval. Orders v2 to create orders (intent: AUTHORIZE, line items,shipping_preference: GET_FROM_FILE), authorize, and add tracking. Payments v2 for partial capture, void, reauthorize and reading authorizations back. The fan's language goes to the SDK and to the order'sexperience_context.locale, so the button and review pages match the receipt note. (The demo video was recorded before the button fix, so its PayPal button is in Korean; PayPal's sign-in page can still follow the browser's last language.) Every POST sends aPayPal-Request-Id. Request and response shapes follow PayPal's published OpenAPI specs. - AI. GPT-6.1 (
gpt-6.1-sol) deployed in Azure OpenAI, called through the v1 Chat Completions API. Each job is one call with structured outputs (json_schema, strict); shipment matching is split into 40-row calls. The output is checked in code before use. A recommendation may only pick an order quantity the code already computed. Payer notes come back as templates with placeholders such as{captured}and{released}, any template that writes an amount itself is rejected, and code fills in every number. Shipment matches must point at a real pledge in the same country. A fan answer that quotes a dollar amount no cart in this campaign can add up to is replaced by a hand-off to the creator, in the fan's language. A full walkthrough makes 8 model calls and used about 26,000 input and 11,300 output tokens. - App. Node.js with no web framework and no npm dependencies, plain HTML and JavaScript pages, and a JSON file store. A local mock of the PayPal endpoints, with the same request and response shapes and error codes, lets the whole flow run without credentials, together with sample AI outputs written for the demo data. The server's PayPal REST client is the same in both modes; only the base URL changes. Every screen shows which mode is on.
- Tests. 37 automated tests cover price breaks, settlement plans, each guard check, the AI output checks, a full pledge-to-tracking flow against the mock (including bulk reauthorization, a hold voided behind Quorum's back, a reauthorized hold voided through its original authorization, idempotent retries and PayPal's error codes), the model request path against a local fake of the Azure OpenAI endpoint, rebuilding the demo data around holds that were placed days earlier, and seeding the walkthrough numbers.
Challenges I ran into
- Authorization timing. PayPal honors an authorization for 3 days and keeps it valid for 29. In a 10-day campaign most holds are past day 3 at close: 97 of the 133 seeded holds in the demo. Quorum caps campaigns at 29 days, shows each hold's age, reauthorizes the old ones in one click, and re-reads every hold before charging.
- Currency. PayPal doesn't support KRW, so fans pay in USD while factory costs are in KRW. Costs are estimates at an exchange rate the creator sets, and the draft step asks for it instead of guessing.
- Keeping the model away from amounts while still letting it write the messages fans read. Placeholder templates solved this, and they made the money path testable. In the first live run the model shortened the partial-capture note and dropped two placeholders in every language, so every template was rejected and fans would have got the plain English fallback. Listing the required placeholders per field in the prompt fixed it; the check stayed as it was.
- Names across scripts in the shipping list: kanji or hanzi in one file, romanized names in PayPal, surname first, capitals, postal codes with and without hyphens. In the recorded sandbox run the model matched all 121 demo rows. Earlier runs left one to three look-alikes for the creator, such as the walkthrough's test buyer with two shipments under one name and address; the parcel contents now tell those two apart.
- Voiding a reauthorized hold. In the sandbox, PayPal answered
CANNOT_BE_VOIDEDwhen Quorum voided a reauthorized hold by its new ID. The void has to go to the original authorization, which releases both. Quorum now keeps the original ID, and the mock PayPal refuses the same call, so a test covers it.
Accomplishments that I'm proud of
- In the PayPal sandbox, with a Korean sandbox business account, the recorded run reauthorized two holds that were six days old, then made a full capture, a partial capture and a void, and added tracking to both captures.
- Against the PayPal mock, one settlement run moves all 136 pledges to the right state and the ledger matches the plan to the cent: $2,841.00 captured, 15 holds voided, none left open.
- The recommendation follows what the creator wrote. The cheapest sticker order is on screen, and the model explains why it still keeps 212.
- A fan who pledged $38.00 for a stand and a pin gets a note on their PayPal capture, in German, saying the pin wasn't made, $24.00 was charged, and $14.00 was released and never charged.
What I learned
A partial capture with final_capture: true turns a pre-order into "pay for whatever gets made" with no refund step at all. Asking the model for templates instead of finished text meant that no amount the model writes ever reaches PayPal or a fan's receipt, and a strict check on those templates caught the one time the model cut corners.
What's next for Quorum
- Run it with a real artist's next pre-order, on the sandbox first.
- Confirm that a live Korean PayPal business account can use authorize and capture (it works with a Korean sandbox business account). If it can't, the same flow runs on a business account in a country that supports it.
- PayPal's server-side shipping callbacks, so shipping is priced from the address the fan picks in PayPal.
- Webhooks for holds changed on the PayPal side, and an automatic fresh payment link when a late capture fails.
- Accounts and a database, so more than one creator can use one install.
Built With
- azure-openai
- css3
- gpt
- html5
- javascript
- node.js
- paypal
- paypal-javascript-sdk-v6
- paypal-orders-api
- paypal-payments-api