Guides

Sell tickets on your website

A ticket button, a single show card, or a whole ticket picker on your own page, with checkout opening on top of it.

5 minutesNo key for steps 1 to 4Pro

1Choose a widget

There are seven, from a link you already have to your whole box office. Add the script once per page, anywhere in it, however many widgets the page has:

HTML, once per page
<script src="https://cocoscout.com/tickets/embed.js" async></script>

Then put a widget where it goes. Write it with your box office's address and the show's (both are in the show's ticket page link), or take embed_html from the API: every show and production has one, the single show card unless you add ?embed_view=dates or another view.

The first four are drawn right in your page, in your site's font, and take your colors through CSS (step 3). The last three are drawn by CocoScout in a frame, in the colors you set for your ticket pages, and the frame grows to fit.

Button

data-view="button"

Just a button. Name one date with data-date and checkout opens on that date's tickets; name only the show and it opens on its dates. The button's words are data-label, or the element's own text.

Buy Tickets
HTML
<div data-cocoscout-tickets="the-basement"     data-event="late-night-sketch"     data-view="button"     data-label="Buy Tickets"></div>

Single show card

data-view="single" Default

One date, its time, and a button: the soonest date on sale, or the one data-date names. When that show starts, the card moves on to the next date by itself. A sold-out date says so and offers the next date with seats. It has no heading unless you add one with data-heading. This is what you get when you leave out data-view; data-view="next" works too.

Saturday, December 5, 2026
8:00 PM
Buy tickets
HTML
<div data-cocoscout-tickets="the-basement"     data-event="late-night-sketch"></div>

Dates list

data-view="dates"

Upcoming dates in a short list, each with a button that opens checkout on that date. It shows five, then a link to the rest; data-limit changes how many.

Upcoming shows
Fri, Dec 58:00 PM Tickets
Sat, Dec 68:00 PM Sold out
Fri, Dec 128:00 PM Tickets
4 more dates
HTML
<div data-cocoscout-tickets="the-basement"     data-event="late-night-sketch"     data-view="dates"     data-limit="5"></div>

Tickets for one date

data-view="tickets"

One date's ticket types, each price with what's added to it, a quantity for each, the total, and a Checkout button. No date picker, so it suits a page for a single night. Checkout opens over your page with the seats already held.

Friday, December 12 · 8:00 PM
General
$20.00
+$0.55 fees
+$2.05 Sales tax
−2+
2 tickets$45.20
Checkout
HTML
<div data-cocoscout-tickets="the-basement"     data-event="late-night-sketch"     data-date="dec-12"     data-view="tickets"></div>

Full picker

data-view="full"

The show's name, its dates, and the chosen date's tickets. Good for a page that's all about one show. It used to be called card, and data-view="card" still works.

Late Night Sketch
The Basement · Main room
Fri58:00 Sat68:00 Fri128:00 Sat138:00 Fri198:00
General · $22.60− 2 +
Continue to checkout
HTML
<div data-cocoscout-tickets="the-basement"     data-event="late-night-sketch"     data-view="full"></div>

Whole box office

data-view="box-office"

Every show you have on sale, soonest first.

Thu4 Open Mic Night7:30 PM Tickets
Fri5 Late Night Sketch8:00 PM Tickets
Sat6 The Improvised Musical9:30 PM Tickets
HTML
<div data-cocoscout-tickets="the-basement"     data-view="box-office"></div>

Other settings

AttributeWidgetsWhat it does
data-viewalllink, button, single (the default), dates, tickets, full, or box-office. With no data-event and no data-view, the whole box office.
data-eventall but link and box-officeThe show's address, like late-night-sketch, or one date's address. Both are in your ticket page links.
data-datebutton, single, tickets, fullOne date, written dec-12. Without it, the next date on sale.
data-limitdatesHow many dates before the link to the rest: 5 unless you change it.
data-checkout="page"allOpens checkout in a new tab on CocoScout instead of over your page.
data-codeall but box-officeA discount or access code, applied when checkout opens.

2Change the words

Every piece of text a widget shows can be changed with an attribute. Set one to an empty string to hide that line.

AttributeWidgetsUnless you change itWhat it is
data-labelbutton, single, dates, tickets"Buy tickets"; "Tickets" on each date in dates; "Checkout" in ticketsThe button's words. On button, the element's own text works too.
data-headingsingle, dates, ticketsNone in single; "Upcoming shows" in dates; the date in ticketsThe small heading above the card, the list, or the tickets. The single show card has one only when you add it.
data-sold-out-labelbutton, single, dates"Sold out"What a sold-out date shows in place of its button.
data-next-date-labelsingle"Next date:"Before the next date with seats, when the card's date is sold out.
data-empty-textsingle, dates"No shows on sale right now."What shows when nothing is on sale. Empty hides the whole widget.
data-more-labeldates"4 more dates"The link under a cut-off list. {count} is the number of dates left.
data-date-stylesingle, dateslong in single, short in dateslong is "Saturday, December 5, 2026"; short is "Sat, Dec 5".
HTML
<div data-cocoscout-tickets="the-basement"     data-event="late-night-sketch"     data-heading="Next show"     data-label="Get tickets"></div>

3Match your site

Every widget starts in the colors you set for your ticket pages. The four drawn in your page also use your site's font, and until you set any page colors, everything but their buttons follows your site's own text color, so they sit on a dark page or a light one.

To give one widget its own colors, add the same four your ticket page settings have. They're six-digit hex colors, with or without the #. They replace the settings' colors for that widget only, including the checkout it opens, so the whole purchase matches.

AttributeIn your pageIn a frame and in checkout
data-button-colorButtons. Their words are white or near-black, whichever reads better.Buttons, links, and the chosen date.
data-background-colorBehind the single show card.The page behind the ticket boxes.
data-heading-colorThe date.The show's name and the date above the tickets.
data-text-colorTimes, the heading, "Sold out", and the lines between dates.Words on the page behind the ticket boxes.
HTML
<div data-cocoscout-tickets="the-basement"     data-event="late-night-sketch"     data-view="tickets"     data-button-color="#7c1714"     data-background-color="#ffffff"></div>

For finer control of the four in your page, set these CSS custom properties on the widget, or on :root. They win over the colors above:

CSS
[data-cocoscout-tickets] {  --cocoscout-button-bg: #ffffff;  /* buttons */  --cocoscout-button-fg: #000000;  /* their words */  --cocoscout-radius: 0;           /* buttons and the card's corners */  --cocoscout-card-bg: #181818;    /* behind the single show card */  --cocoscout-heading: #ffffff;    /* the dates */  --cocoscout-border: #3a3a3a;     /* the card's edge, and lines between dates */  --cocoscout-muted: #a8a8a8;      /* headings, times, and "Sold out" */}

For anything further, each piece has a class: .cocoscout-button, .cocoscout-single, .cocoscout-dates, .cocoscout-heading, .cocoscout-date, .cocoscout-time, and .cocoscout-sold-out. Your own rules win over the widget's.

4Say thanks your way

When the buyer pays, your page gets a cocoscout:paid event with the order code and ticket count. Buyer names and emails never pass through your page; read the order with the API if you need them. Closing the checkout sends cocoscout:closed.

JavaScript
document.addEventListener("cocoscout:paid", (event) => {  // { order_code: "K7Q2", tickets: 2 }  showThanks(`You're in! Order ${event.detail.order_code}.`);});

5Or draw your own ticket picker

List the dates with GET /v1/shows?status=on_sale, hold the seats from your server with POST /v1/checkouts, and open that checkout over your page. Keep your key on your server; the checkout token is safe in the browser.

JavaScript
// On your serverconst res = await fetch("https://api.cocoscout.com/v1/checkouts", {  method: "POST",  headers: { Authorization: `Bearer ${process.env.COCOSCOUT_KEY}`,             "Content-Type": "application/json", "Idempotency-Key": crypto.randomUUID() },  body: JSON.stringify({ show_id: 4812, tickets: [{ ticket_type_id: 912, quantity: 2 }] })});const { checkout_token } = await res.json();// In the browser, with embed.js on the pageCocoScout.checkout(checkout_token); // seats are held for 10 minutes
Fees are the same everywhere. A ticket sold from your website, the API, or a connected tool costs 50¢, the same as on your CocoScout box office page. Sales you record from another register or ticket site are free.