Skip to content
Docs
Concept

A buyer on the hosted box office

The hosted storefront is a first-party front end over the same Live worker: the channel is resolved from the hostname, the key is held by Live, and the flow is identical to a buyer on your own site.

Every sales channel can have a hosted storefront, served at <slug>.checkout.ticketlayer.com or on a custom domain pointed at the same place. It is the same code that renders the embedded checkout on your own site, and it is a front end over the same Live worker, so the sequence is the one on A buyer on your website with a different first hop.

The credential. There is no key in the page. The storefront resolves which channel a request is for from Host, and Live holds that channel's publishable key (tlpk_, low trust) for the session. A signed-in buyer's customer token stays in the Live session; it escalates the session, it does not authenticate it.

A buyer on the hosted box office: the storefront is a front end over Live1 List what is on sale: Hosted box office (browser) to Live: GET /sales/listings (channel resolved from Host); Live to Backstage API: GET /internal/live/listings (Live's service token, tlpk_ (held by Live), channel: the key's); Backstage API to Hosted box office (browser): what the channel sells, in the low-trust view shape. 2 Make an order: Hosted box office (browser) to Live: POST /sales/carts, items, POST /sales/carts/{id}/checkout (channel resolved from Host, X-Live-Session); Live to Backstage API: POST /internal/live/carts, items, .../checkout (Live's service token, tlpk_ (held by Live), channel: the key's); Live to Backstage API: POST /internal/live/orders/{id}/payments (Live's service token, tlpk_ (held by Live)); Backstage API to Hosted box office (browser): the order; Live keeps its order access token in the session. 3 Authenticate a customer: Hosted box office (browser) to Live: POST /sales/customer-auth/magic-link (channel resolved from Host); Live to Backstage API: POST /internal/live/customer-auth/magic-link (Live's service token, tlpk_ (held by Live)); A 15 minute code is emailed to the buyer.; Hosted box office (browser) to Live: POST /sales/customer-tokens { magic_link, code } (channel resolved from Host); Live to Backstage API: POST /internal/live/customer-tokens { magic_link, code } (Live's service token, tlpk_ (held by Live)); Backstage API to Live: customer token, 30 minutes (customer token); Live keeps the customer token in the session; the client never holds it. It escalates the session. The publishable key still authenticates every call.. 4 Read the order back: Hosted box office (browser) to Live: GET /sales/my-orders (channel resolved from Host, X-Live-Session); Live to Backstage API: GET /internal/live/my-orders (Live's service token, tlpk_ (held by Live), customer token); Live to Backstage API: GET /internal/live/orders/{id} (Live's service token, tlpk_ (held by Live), order access token); Backstage API to Hosted box office (browser): the buyer's orders, or the one order the session may see1 List what is on sale2 Make an order3 Authenticate a customer4 Read the order backHosted box office (browser)LiveBackstage APIA 15 minute code is emailed to the buyer.Live keeps the customer token in the session; the client never holds it.It escalates the session. The publishable key still authenticates every call.GET /sales/listingschannel resolved from HostGET /internal/live/listingsLive's service tokentlpk_ (held by Live)channel: the key'swhat the channel sells, in the low-trust view shapePOST /sales/carts, items, POST /sales/carts/{id}/checkoutchannel resolved from HostX-Live-SessionPOST /internal/live/carts, items, .../checkoutLive's service tokentlpk_ (held by Live)channel: the key'sPOST /internal/live/orders/{id}/paymentsLive's service tokentlpk_ (held by Live)the order; Live keeps its order access token in the sessionPOST /sales/customer-auth/magic-linkchannel resolved from HostPOST /internal/live/customer-auth/magic-linkLive's service tokentlpk_ (held by Live)POST /sales/customer-tokens { magic_link, code }channel resolved from HostPOST /internal/live/customer-tokens { magic_link, code }Live's service tokentlpk_ (held by Live)customer token, 30 minutescustomer tokenGET /sales/my-orderschannel resolved from HostX-Live-SessionGET /internal/live/my-ordersLive's service tokentlpk_ (held by Live)customer tokenGET /internal/live/orders/{id}Live's service tokentlpk_ (held by Live)order access tokenthe buyer's orders, or the one order the session may seeLow trust: publishable keyHigh trust: staff, organisation key, deviceWhere the channel comes fromCarried on top: escalates, never authenticatesNot a credential

The four moments#

MomentWhat happensCredential
List what is on saleThe storefront asks Live for GET /sales/listings. Live forwards under the publishable key of the channel the hostname resolved to.tlpk_, held by Live; the channel from Host
Make an orderPOST /sales/carts, items, POST /sales/carts/{id}/checkout, then POST /sales/orders/{id}/payments, all through Live under the session.tlpk_, held by Live
Authenticate a customerThe storefront's account pages use the magic link: POST /sales/customer-auth/magic-link, then POST /sales/customer-tokens with the code. The customer token lives in the Live session.tlpk_ authenticates; the customer token is carried on top
Read the order backThe confirmation page reads GET /sales/orders/{id} with the order access token the session holds; the account page reads GET /sales/my-orders under the customer token.tlpk_, plus the token carried on top

What is different, and what is not#

  • The channel comes from the hostname, not from a key on the page. A custom domain is a CNAME registered on the channel so the storefront can resolve it. That is the only place in the platform where the channel is resolved from Host; every other caller carries it in the credential or in X-Ticketlayer-Channel.
  • Everything else is the website flow. The theme on the channel is what the storefront wears, and it is what the embedded elements on your own site wear too, so a buyer who starts on your page and finishes in the hosted checkout sees one brand.
  • The embedded checkout on your site is this storefront. The cart on your page hands its Live session to /embed/checkout in an iframe, and the iframe sees the same cart because it is the same session.

Set up a box office is the how-to for giving a channel a storefront domain and a theme.