Skip to content

Store checkout

Your store’s checkout is one page at /checkout, hosted by Tuppence. You don’t build it or handle card details: it uses your products, delivery and payment methods, and every paid checkout becomes a store order. Your code sets a few options and listens for store.order_placed.

ShopperTuppenceYour serveropens /checkoutcontact, address, deliveryPaypayment succeedsorder page, emailstore.order_placed
PartWhat it does
SummaryFirst on the page, sticky on a phone: lines, discount, delivery, tax and the total
ExpressApple Pay, Google Pay and Link at the top. The wallet sheet fills the contact and address and shows your delivery choices
ContactOne field: an email or a phone number
AddressName, then the address with autocomplete
DeliveryYour delivery and collection choices for that address, with their prices and dates
PaymentThe secure card fields and your other payment methods
Have a code or gift card?Collapsed. A discount code applies to the basket
NoteOnly if you turn it on (below)
MarketingUnticked. Your words, or your country’s default

The card path asks for at most eight typed fields. The total shown before Pay is the product page’s price plus the chosen delivery.

Prices include VAT; the summary says how much (Includes VAT of).
Sales tax is its own line in the summary (Tax) and is in the total.

Methods that take days to settle (Direct Debit and other bank debits) are never offered: an order is made only once its payment has succeeded. A method that sends the shopper to their bank or provider brings them back to /checkout/return, which reads the payment and moves on to the order.

Two options, in the site’s settings.checkout. They apply to the next checkout, with no publish.

SettingDefaultDoes
note_enabledfalseShows a collapsed note field. The note reaches the order as fulfilment.instructions
marketing_textnull (your country’s wording)The marketing box’s words, up to 300 characters. The box is never ticked for the shopper
Terminal window
curl -sS https://api.tuppence.ai/v1/sites/site_… \
-H "Authorization: Bearer $TUPPENCE_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"settings": {"checkout": {"note_enabled": true, "marketing_text": "Send me news and offers by email."}}}'

Delivery choices come from Store › Settings › Delivery in the dashboard, and the payment methods from those your account takes.

Add store.order_placed to a webhook endpoint. It is sent once per order.

Terminal window
curl https://api.tuppence.ai/v1/webhook_endpoints \
-H "Authorization: Bearer $TUPPENCE_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/tuppence", "enabled_events": ["store.order_placed"]}'

The event’s object is the store order:

Field
idThe order (ord_…)
numberThe number the shopper sees: Order 1042
site, checkoutWhere it was placed
fulfilmentkind (delivery or collection), address, delivery (key, name, amount, earliest, latest) and instructions
fulfilment_statusunfulfilled until you send it
orderThe order as GET /v1/orders/{id} returns it, with its lines and tenders

Your test store is under /test/<your-slug> on the store’s address. It says “Test store: use a test card. No real card works and no money moves.” and lists the test cards to pick from. The order, its confirmation email and store.order_placed follow as they would live, in test mode.

WhenCheckThe shopper sees
The checkout opensEach item’s stock, held for 10 minutes (once more while paying)“Only 1 Blue mug is left. We’ve changed your basket.”
An address is givenYou deliver there“Sorry, we don’t deliver to Jersey.” In your test store, a link to fix it
PayThe basket priced again matches the total shownThe new total, to pay again
The paymentThe card or method is accepted“Your card was declined. Try another card or Apple Pay.”

At the till, a sale is never stopped by an online hold. A payment that succeeds after its hold ran out still makes the order, so a paying shopper is never turned away; the stock may go below zero, and you see it.

One payment makes one order, whether the payment’s success arrives first or the shopper’s return.

  • The order: source: online, totals from what the shopper was shown (never worked out again), numbered from 1001 for the shopper.
  • What the shopper was shown when they pressed Pay is kept with the order: lines, delivery and its dates, discounts, tax, total, your trader details and the cancellation terms. Read it as snapshot on GET /v1/orders/{id}/details.
  • The confirmation email goes in your business’s name, and replies come to you. It links to the order’s status page and to the store’s cancellation form.
  • The payment has source: store and is priced like any card payment (pricing).
EventWhen
store.order_placedA checkout was paid and its order made
order.created, order.paid, order.completedThe same order, as for any order
payment.succeededIts payment
store.checkout_abandonedA checkout with a contact and no payment was left for an hour. It carries marketing_consent, so you email only shoppers who agreed

Docs assistant

Open as a page
Loading the assistant…