--- title: "A digital store with card checkout, built by Claude Code on Elements" author: "@chris" author_url: https://elements.dev/u/@chris published: 2026-09-30T21:05:05.813Z url: https://elements.dev/demos/a-digital-store-with-card-checkout-built-by-claude-code-on-5lygmi97 kind: post format: article --- # A digital store with card checkout, built by Claude Code on Elements by [@chris](https://elements.dev/u/@chris) ยท 2026-09-30 ## Description Card checkout with just an email, a five-use download link, a buyer library, and a creator dashboard with live sales. Bytestall needed product uploads, guest card checkout, download links with a limit and an expiry, emails, and live sales totals. Each of those is a part of Elements, so the agent spent its 22 minutes on the store itself. - **Card checkout with just an email.** The buy button prices the product on the server and sends the buyer to Stripe Checkout. The order is recorded when the buyer returns and again when Stripe's webhook arrives, once either way. Without a Stripe key the button opens a test checkout inside the app, which records the sale through the same function, so the whole flow runs before Stripe is connected. In production the app registers its own webhook on the first checkout. - **Product uploads.** The creator's product form sends the cover and the PDF or ZIP as file fields to an `@rpc` function, which checks each file's own bytes for its type and stores both. - **Download links that count.** Each purchase gets a link that works five times and expires in thirty days. One SQL update checks the count and the expiry and spends a download, so every click is counted exactly once. - **Live sales totals.** Each payment, download and resend notifies a channel, and the creator's dashboard re-reads its totals, so revenue and download counts move while it is open. - **Download emails.** A template emails the download link along with a link to the buyer's library of everything bought with that email, and the creator can resend it with a fresh link. - **Data from SQL files.** Migrations define the store and seed the creator, six products with drawn covers and real PDF and ZIP files, and a dozen past sales. The project server applied each one as soon as it was saved.