Checkout pages
A checkout page is a page EdgeKit serves on your site’s own domain, at /edgekit/checkout/<slug>. You create it in
the console; you do not build it. Each checkout page belongs to one site and sells through one billing provider.
A checkout page names no offers. What it sells comes with the request that opens it: an outcome that sells an offer on the page sends the user there with an offer token, or a direct link names a direct-link offer. Opened with no offer, the page shows its heading, its body copy and a message that there is nothing to buy. It shows no card form.
The page is on a white background and uses the site’s brand: its logo, its text and accent colours and its font. Its text is in English.
Checkout, payment methods, renewals and failed-payment handling
Section titled “Checkout, payment methods, renewals and failed-payment handling”What EdgeKit’s checkout covers, and what it leaves to your billing provider:
- Checkout. A hosted checkout page on your own domain, in your brand, with no card form to build. It sells an offer with its trial and introductory discount, takes a typed coupon code, shows alternatives such as annual beside monthly, charges in the currency you name, and runs 3-D Secure in the page. You can also build the form yourself on the same checkout request.
- Payment methods. Card, Apple Pay, Google Pay and PayPal, each switched on per page. See Payment methods. A card is typed into your billing provider’s own card fields. A user replaces the card on the account page. Bank debits and other payment methods are not offered.
- Renewals. Your billing provider charges each renewal. EdgeKit reads it and moves the grant’s expiry to the new period end. A user cancels, undoes a cancel or changes to another offer on the account page.
- Failed-payment handling. Your billing provider retries a failed payment, and one setting decides whether the user keeps access meanwhile. The account page asks the user for a new card. See Retries and proration.
- Proration. Your billing provider computes and charges the prorated amount of an upgrade.
- Tax. With Tax on, your billing provider calculates and charges sales tax or VAT on the user’s country and postal code, and the page shows its tax line before the user pays. EdgeKit calculates no tax itself.
Create a checkout page
Section titled “Create a checkout page”- Open Revenue › Catalog › Checkout pages and choose Add checkout page. The page has five sections: Address, Content, Look, Payment and Buying.
- In Address, pick the site and type a slug. A checkout page stays on the site it was created for. The slug is the end of the page’s URL: lowercase letters, digits and hyphens. Two checkout pages on one site cannot share a slug; the same slug on another site is fine. The section shows the URL the page will answer at.
- In Content, type a heading and, if you want, body copy and a return URL. Body copy is plain text; a blank line starts a paragraph. The return URL is where a user lands after buying when the link that brought them names nowhere.
- In Look, pick a layout (One screen, Summary beside or Choose first, see Layout) and a design (Statement, Member pass or Cover, see Design). One screen and Statement are the defaults.
- In Payment, pick the billing provider and tick the payment methods the page offers (see Payment methods). Only active billing providers are listed, and card alone is the default. Each ticked method shows what to set up at the billing provider. On a Stripe page with Card ticked, you can also tick Link: Save my information. Tick Tax to charge tax, then pick Prices before the tax quote (see Tax).
- In Buying, optionally tick Show alternatives, Sign in first and Coupon code field. See Show alternatives, Sign in first and Coupon code field. All three are off by default.
- Select Add checkout page, then deploy.
To change a saved checkout page, open it from the list. Each section has its own Save and Revert, and you stay on the page after saving. Delete checkout page is at the bottom of the page.
Anyone who can edit offers can create, edit and delete checkout pages. Everyone else can read them.
A checkout page goes live on deploy
Section titled “A checkout page goes live on deploy”A saved checkout page is a draft. The page your users open is the one last deployed:
- A new checkout page answers
404until you deploy. - An edit shows on the page after the next deploy.
- A deleted checkout page keeps answering until the next deploy, then its URL answers
404.
A slug that names no deployed checkout page on that site answers 404.
Sell an offer on a checkout page
Section titled “Sell an offer on a checkout page”An outcome sells an offer through its offer_token field (see
Offers). To sell it on a checkout page:
- Open the outcome in Revenue › Decision Engine › Outcomes.
- On the
offer_tokenfield, pick the offer, then pick the checkout page beside it. The list names each page by its site and slug. Leave it on no checkout page to keep selling through your own card form. - Deploy.
The decision then carries the page’s URL for that field in checkoutPageUrls, keyed by the field’s name. The URL
already carries the offer token. Link to it as it is:
const { paywall } = await client.decide(['paywall']);
if (paywall.status === 'decided' && paywall.checkoutPageUrls?.checkout) { // `checkout` is the name you gave the outcome's offer_token field. buyLink.href = paywall.checkoutPageUrls.checkout;}The field’s own value is still the offer token. An outcome that names no checkout page returns no
checkoutPageUrls and works as it did.
A feature that sells on a checkout page must run only on that page’s site: a checkout page belongs to one site.
Sell an offer by direct link
Section titled “Sell an offer by direct link”A direct link sells one offer on a checkout page with no decision in front: use it in an email, an ad or a button anywhere. Anyone who holds the link can buy, so an offer is not sold by link until you mark it.
- Open the offer in Revenue › Catalog › Offers.
- In Merchandising, tick Direct link and save. It is off by default.
- Under Direct links, copy the link for the checkout page you want. There is one per checkout page.
- Deploy. The link sells once the mark and the checkout page are deployed.
The link is /edgekit/checkout/<slug>?offer=<offer id> on the site’s domain. You can add currency and return to
it, as below.
- Only a direct-link offer is sold by link. A link that names any other offer is refused: that offer is sold only where an outcome offers it.
- The offer needs an active price on the page’s billing provider, in the currency the page is opened with. Without one the page refuses.
- The purchase is the same. The page makes an offer token when it opens, and the purchase goes through checkout with the same rules and the same purchase record.
- A page left open still sells. When the offer token of a direct-link offer expires, the page replaces it and the purchase continues.
To stop selling an offer by link, clear Direct link and deploy. Outcomes that offer it keep selling it.
Show alternatives
Section titled “Show alternatives”With Show alternatives on, the page shows other offers beside the one it was opened with, so a user can pick, say, annual over monthly and buy it on the same page. With it off, the page shows the one offer alone.
The alternatives are the offers that the offer’s frequency_change and related edges lead to (see
Offers). Frequency changes come first, then related offers, each in the order you
gave them. No other edge kind is shown.
- Opened with a decision’s offer token, the page shows every alternative until the token expires.
- Opened by direct link, the page shows only alternatives that are direct-link offers themselves.
- An alternative is left off when it has no active price on the page’s billing provider in the currency the page is opened with, when that price is a Stripe price with no fixed amount, or when it is no longer purchasable or active.
- The user picks one offer and pays once. The page makes an offer token for each alternative it shows, and the purchase of the picked offer goes through checkout like any other.
A related edge shown this way makes its target buyable by anyone who has the page’s URL and an offer token. Keep
an offer meant for one segment out of the related edges of offers you sell on a page with alternatives on.
To stop showing alternatives, switch Show alternatives off and deploy.
Sign in first
Section titled “Sign in first”With Sign in first on, only a signed-in user can buy on the page, and the purchase is that user’s. With it off, anyone buys with an email they type.
- A user who is not signed in sees the sign-in form at the page’s own URL, in place of the offer. They sign in with an email code. The page then opens again with the same offer, currency and return URL.
- The purchase goes to the signed-in user. The page shows their email and locks it. Checkout does not read the email in the request for such a page: it charges and grants the signed-in user.
- An offer token of such a page cannot be bought without a session. Checkout answers
409 sign_in_required, and charges nothing. - The page makes no offer token before the sign-in. A direct link opened by a user who is not signed in mints nothing until they are.
Use it only on a site where EdgeKit signs users in. Deploy refuses the switch on a site whose sign-in mode is
external_only, and on a dual site that has not allowed EdgeKit sign-in. See
What deploy refuses. The sign-in form sends no Castle request token, so on a site that
requires Castle the page refuses in place of the form.
To stop requiring sign-in, switch Sign in first off and deploy.
Coupon code field
Section titled “Coupon code field”With Coupon code field on, the page shows a field where the user can type a coupon code before paying.
- The code must be a coupon of the page’s billing provider. EdgeKit checks it against the coupons synced from that billing provider, and no other. On Recurly the user types the coupon’s code. On Stripe the user types the coupon’s id; a Stripe promotion code is not accepted.
- A valid code shows the new price before the user pays. The page shows the offer’s price with the coupon’s percentage or amount taken off, and whether that price is for the first payment only. The billing provider computes the amount it charges.
- The typed code replaces the offer’s own discount. The two never add up. A user who types a code on an offer with an introductory discount gets the code’s discount only, even when the offer’s own was larger.
- A code that cannot be used gives a message, and the user can go on without it. That is a code no synced coupon carries, one that has expired or is used up, one that does not apply to the offer’s price, or an amount coupon with no amount in the currency. The same holds when the billing provider itself refuses the code at the charge: nothing is charged, and the user removes the code and pays the offer’s own price.
- Only the billing provider’s own coupon rules limit a code. EdgeKit adds no limit per offer or per page.
- With alternatives, the code applies to the offer the user picked. Picking another offer clears it.
A coupon you just created at the billing provider works once the catalog sync has brought it in.
The checkout request carries the code as couponCode. Checkout refuses it with 409 coupon_code_not_accepted for
an offer token of a page with the field off, and for an offer token minted for no checkout page: your own card form
cannot send one. See 409 codes.
To stop taking codes, switch Coupon code field off and deploy.
Payment methods
Section titled “Payment methods”A checkout page offers the payment methods you tick: Card, Apple Pay, Google Pay and PayPal.
- Card or PayPal is always ticked. Apple Pay and Google Pay show only on a device that has them, so a page with only wallets would show some users nothing to pay with. Deploy refuses such a page.
- Apple Pay, Google Pay and PayPal are buttons above the card fields, with “or pay by card” between them. With card off, the page shows the buttons and no card fields.
- Each one is set up at your billing provider first. EdgeKit cannot check that setup: until it is done, the
button does not show. When none of the page’s methods can load, the page says it cannot take a payment and
sends
checkout_page_refusedwith codeno_payment_method. The console shows each method’s setup under its checkbox. - Stripe Link is off by default. On a Stripe page with Card ticked, switch on Link: Save my information
to offer it in the card fields: a new user can save their details for faster checkout, and a returning Link user
pays with the saved ones. Your Stripe Dashboard must have Link on too. With the switch off, the card fields show no
Link, and the checkout request refuses
linkwith409 payment_method_not_accepted. - Off is what the page shows, not a charge rule. Apple Pay and Google Pay pay with a card, so a card typed by
other means is still charged. The checkout request refuses a payment method the page has off by name, with
409 payment_method_not_accepted.
What each billing provider needs:
| Method | Stripe | Recurly |
|---|---|---|
| Apple Pay | Your site’s domain, and every subdomain the page is served on, under Settings, Payment method domains. | Apple Pay turned on by Recurly Support, your Apple Pay certificates and domain in Recurly, and your merchant country set for EdgeKit. |
| Google Pay | The same domains, and Google Pay on. | Google Pay on for your gateway, your site in Google’s Pay and Wallet Console, and your merchant country and Google merchant id set for EdgeKit. |
| PayPal | PayPal on under Settings, Payment methods, with a PayPal account connected. Stripe offers PayPal to accounts in Europe only. | PayPal Complete added as a gateway in Recurly. |
Apple’s domain file. Apple Pay needs a file at
https://<your domain>/.well-known/apple-developer-merchantid-domain-association. It is outside the /edgekit/
mount, so you host it on your own site, served directly with no redirect. Recurly’s comes from your Apple Developer
account; host Stripe’s if Stripe asks for it.
PayPal leaves the page. On Stripe the user approves the payment on PayPal and comes back to the checkout page, which then finishes the purchase. On Recurly PayPal opens in a window over the page.
Renewals with Apple Pay show a manage link in the user’s Wallet: the site’s
account page where it is switched on and the sign-in mode is not
external_only. Otherwise it is the return URL the page was opened with, else the page’s own return URL, else the
site’s home page.
With Tax on, the user chooses their country and types a postal code before paying. Your billing provider calculates the sales tax or VAT and charges it, on the first payment and on every renewal.
-
The page shows the tax before the user pays. It asks your billing provider what this purchase costs today at that address, with any coupon code, and shows a VAT line, or VAT included for a price that already contains it. The page calls every tax VAT, a US sales tax included. The amount due and the Pay button show the billing provider’s total. Pay is off until that total is known.
-
Prices before the tax quote decides which prices say + VAT, for example “€99 a year + VAT”, until the tax is known: the offers, the coupon code’s price, the renewal terms and the amount due.
- + VAT, the default: every price says it. For prices that exclude tax.
- By currency: USD and CAD prices say it, and every other currency is shown with tax included. This matches Stripe’s Automatic tax behavior.
- Tax included: no price says it. For prices that include tax.
Once the billing provider answers, its answer decides: a price says + VAT exactly when tax is added on top at this user’s address. The setting changes labels only. Your billing provider’s price decides the charge, so match the setting to how your prices are taxed there.
-
The country is required. The postal code is needed in the United States and Canada. Elsewhere the country alone is enough. The page asks for no street address and no tax id.
-
Nothing is due today on a free trial, and no tax. The user still chooses a country: renewals are taxed there.
-
Stripe: Stripe Tax charges the tax. Each purchase from the page creates its own Stripe account holder with that address, so someone who only knows a user’s email can never change the address Stripe holds for an earlier purchase. Stripe’s card fields ask for no country or postal code of their own on the page.
-
Recurly: Recurly’s own tax settings charge the tax, on the address in the card’s token. Apple Pay and Google Pay send the address typed on the page, not the wallet’s. PayPal sends Recurly no address, so a Recurly page with Tax on does not offer PayPal.
-
Once a Stripe purchase is posted, the address is locked, like the email: the first invoice is already taxed there.
Set tax up at your billing provider before you switch it on. EdgeKit cannot check that setup.
| Stripe | Recurly |
|---|---|
| Stripe Tax on, with a registration for every place you collect tax. Each price has a tax behavior (tax included or added on top), or the account default under Tax settings sets it. | Tax set up under Configuration, Taxes, and Collect Tax on for each Recurly plan you sell on the page. |
The checkout request carries the address as country and postalCode. On an offer token of a page with Tax on,
checkout refuses a request with no country, 409 address_required, and an address the billing provider cannot tax,
409 address_invalid. Both are refused before anything is charged. On any other offer token the two fields are
ignored. See 409 codes.
To stop charging tax on the page, switch Tax off and deploy. On Stripe that is enough. On Recurly it is not: the switch only stops the page asking for a country and showing the tax line, and Recurly still charges what its own tax settings say, on the card’s postal code and country. Also switch Collect Tax off for each Recurly plan you sell on the page, or the user pays tax they were not shown.
Layout
Section titled “Layout”The layout sets how the page is arranged. The purchase is the same in each: the same offers, the same checks and the same purchase record. Every layout shows the site’s header in its brand colour, the heading and the body copy.
- One screen: one column at every width. The offer, the coupon code link, the email and the card fields sit in one card. Use it where users arrive having already picked an offer, from an outcome on your site.
- Summary beside: the email and the card fields in one card, and a summary card beside it with the offer, its alternatives and the coupon code link. On a phone the summary sits above the form.
- Choose first: with alternatives shown, the offers fill the page as cards, the offer the link was opened with marked Your offer. Choosing one opens the form under a line naming it, with Change to go back to the cards. With alternatives off, or with none to show, the page looks like One screen. Use it for a direct link, where users have not seen your offers yet.
On both billing providers the email and the card fields appear together, and one Pay button buys.
To change the layout, pick another and deploy.
Design
Section titled “Design”The design sets how the page looks. Any design works with any layout, and the purchase is the same in each. Every design uses the site’s brand.
- Statement: calm and precise. The price is set like a statement, and the brand colour is on the one action, the Pay button.
- Member pass: a pass in the brand colour that fills in as the user types, and is issued when they pay.
- Cover: the brand colour as a cover with the price set large, and the form on a white sheet.
To change the design, pick another and deploy.
What the user sees
Section titled “What the user sees”The page shows the site’s header, the offer’s name, its product and its price, then the card fields of the page’s billing provider, arranged by its layout. The card number is typed into the billing provider’s own fields and never reaches your site or EdgeKit. With alternatives the user first picks one of the offers shown. With the coupon code field the user opens Have a code?, types a code and sees the new price before paying. With Tax the user chooses a country and types a postal code, and sees the tax before paying.
- A user who is not signed in types an email and pays in one step. No account is created first. The purchase lands on the user with that email, as in Who gets the grant.
- A signed-in user sees their own email, filled in and locked. They do not type one. On a site whose sign-in
mode is
external_onlythe page reads no EdgeKit session, so every user types an email. - Recurly: the user types their name and card and pays. If their bank asks for a 3-D Secure check, it runs in the page and the purchase then finishes.
- Stripe: the user types their email, types their card into Stripe’s payment fields and pays, 3-D Secure included.
- A wallet or PayPal: the user types their email and chooses the button. On Stripe, a wallet asks for the email itself when the field is empty.
- After a declined payment the user may pay another way on the same page.
- A declined card shows the reason and leaves the form open for another card.
- A payment still being confirmed shows a message that it is pending and that the user does not need to pay again.
- After a purchase the page shows a success message, then sends the user on.
Every purchase from a checkout page goes through checkout: the same rules decide whether the offer may be sold, and the same purchase record is written.
URL parameters
Section titled “URL parameters”| Parameter | What it does |
|---|---|
token |
The offer token. The URL in checkoutPageUrls already carries it. |
offer |
The id of a direct-link offer. The link you copy from the offer already carries it. |
currency |
The currency to charge in, a three-letter code such as eur. Without it the page uses the site currency. |
return |
Where the user goes after buying. Only a path, or a URL on the site’s own domain, allowed origins or redirect origins, is accepted. |
Add currency and return to the URL from checkoutPageUrls, or to a direct link, yourself. When a URL carries
both token and offer, the page uses the token.
- Currency. If the offer has no active price in that currency on the page’s billing provider, the page refuses. It never charges another currency. There is no currency picker on the page.
- Return. A
returnURL anywhere else is ignored. The user then goes to the page’s own return URL, or to the site’s account page when the page has none.
When the page refuses
Section titled “When the page refuses”The page shows a message, a link back and no card fields when:
- the URL carries no offer token and no offer;
- the offer token is unknown, or was minted for another checkout page or another site;
- the offer token has expired and its offer is not a direct-link offer: the user goes back and gets a fresh offer;
- the link names an offer that is not a direct-link offer, or one that does not exist;
- the offer is no longer purchasable or active;
- the offer has no active price in the currency on the page’s billing provider;
- the page sells through Stripe and the offer’s price has no fixed amount, such as a tiered or metered price;
- the page’s billing provider is no longer active;
- the page is set to sign in first, the user is not signed in, and the site has no sign-in form to show.
An offer token works only on the checkout page it was minted for. It is charged through that page’s billing provider, in the currency fixed when the page was opened; the checkout request cannot change either.
Events
Section titled “Events”A checkout page sends four events to your organization’s analytics, so you can read a purchase funnel.
| Event | Sent when |
|---|---|
checkout_page_view |
The page is served with an offer to sell. |
checkout_page_submitted |
The user submits the payment. |
checkout_page_refused |
The purchase is refused, for example a declined card. |
checkout_page_completed |
The user sees the success screen. |
Each event carries checkout_page_id, offer_id and billing_provider (stripe or recurly). The offer is
the one the user picked when the page shows alternatives. checkout_page_view carries payment_methods, the
page’s; the other three carry payment_method, the one the user paid with or tried: card, apple_pay,
google_pay, paypal or link. checkout_page_refused also carries code: the refusal code of the checkout
request, card_not_confirmed when Stripe refused the payment in the browser, or payment_not_confirmed when the
user came back from PayPal without paying.
The events are in the cloud.edgekit vendor. Their schemas are already in your schema registry: you do not publish
them. See Schemas.
Each event carries the site as app_id, a signed-in user as user_id, and the device as network_userid, read
from the request’s network cookie, so a funnel can follow a device from its first page view
to a purchase. A user who only typed an email is not on the event. On a site whose consent basis is
consent_required, no event carries the user or the device. See Consent.
- A page that refuses sends no view. Neither does the sign-in form of a sign in first page.
- The page reports the last three, and EdgeKit’s server sends them. A user who closes the tab before the success
screen sends no
checkout_page_completed, even when the purchase finishes afterwards. Count purchases from your user subscriptions, not from this event. - An event that cannot be delivered is dropped. It never stops or undoes a purchase.
The events start after EdgeKit’s next deploy of your organization’s stack. Until then the page works and sends none.
What deploy refuses
Section titled “What deploy refuses”Deploy refuses, and names what is at fault:
- A checkout page whose billing provider is not active. This happens when a billing provider is set to retiring or retired after a page picked it. Open the page, pick an active billing provider, and deploy again.
- A checkout page set to sign in first on a site where EdgeKit signs nobody in. That is a site whose sign-in
mode is
external_only, ordualwithout EdgeKit sign-in allowed. The message names the page. Switch Sign in first off on the page, or allow sign-in on the site. - An outcome whose offer has no active price on its checkout page’s billing provider. The message names the offer and the page. Attach a price of that billing provider to the offer, or pick another checkout page.
- An outcome that sells on a checkout page that no longer exists. Pick another page on the outcome, or clear it.
- A feature that sells on a checkout page and also runs on another site. Limit the feature to the page’s site.
- A checkout page whose payment methods hold neither card nor PayPal. Tick card or PayPal on the page.
What the site needs
Section titled “What the site needs”- The
/edgekit/mount. The page is served on your site’s domain through the same mount as every other browser request. See First-party mount and site proxy. - The site’s own origin in its allowed origins. The page calls checkout from the site’s domain.
- The billing provider’s public key. EdgeKit mounts the card fields with it. Without it the page refuses.
- For wallets and PayPal, the setup in Payment methods.
A checkout page is served whatever the site’s sign-in settings are, and whether or not its account page is switched on. Only sign in first needs EdgeKit sign-in on the site.