Browse SDK examples

Sell tickets to an event

Imagine your event page announces a one-day workshop. It has the date, venue, and a Get a ticket button. Publish a ticket offer in Plandalf, then let the button open its checkout.

Set it up

  1. Publish an offer for the ticket. This example calls it spring-workshop-ticket.
  2. Put the button on your event page, using your real organization host in the script URL or apiBase.
  3. Have your server confirm the purchase before it issues a ticket or reserves a place. The browser result alone is not a ticket record.

The browser bundle automatically binds the ticket button. No application JavaScript is needed to open checkout.

event.html
<script defer src="https://your-org.plandalf.dev/js/plandalf-sdk.js"></script>
<button data-plandalf-present="spring-workshop-ticket">Get a ticket</button>

Issue the ticket only after your server confirms the purchase. For an immediate page message based on the checkout result, use the JavaScript or React tab.

The page can respond immediately to a completed or dismissed checkout. Your ticketing system still needs a confirmed purchase from your server before sending a ticket, QR code, or admission confirmation. Add your site's usual error handling for failed checkout requests.

For exact inputs and outputs, inspect present(), FlowOpenOptions, and FlowResult. To add an early-bird price to one ticket offer, configure promo tiers and pass the promo slug to present().

Feature detail