Widgets
Checkout Widget
Our Checkout Widget can be used to bring the Moshtix checkout experience to authorised client websites, so that customers can purchase in a branded experience without leaving a client's website.
To implement the Checkout Widget on your website, you need to follow these simple steps:
Contact Moshtix client support and request the website domain be added to the 'allow checkout widget' settings for the relevant client account.
Add this script tag to the head of your website or at the section where all the scripts gets loaded on page.
<script src="https://www.moshtix.com.au/v2/Scripts/App/moshtix.embed.js" async="true"></script>
Use the showEvent function to launch the Checkout Widget on your website. The following example uses a button.
<button onclick="moshtix.showEvent({ eventId: '12345', skin: 'yourskin', ref: 'marketing-ref-code', offerCode: 'DISCOUNT10', country:'nz' });">Get Tickets</button>
Note that the skin, offercode, and ref parameters are optional, for country parameter enter 'nz' for New Zealand, it can be left blank for Australia and due to iframe security restrictions imposed by Apple, ApplePay is unavailable when purchasing with our Checkout Widget.
On mobile devices, showEvent redirects the customer to the Moshtix event page instead of opening the embedded widget, as this provides a better mobile experience: screen real estate isn't wasted on modal frames, the URL isn't prominent in mobile browsers, and Apple doesn't support ApplePay in iframes — with ~90% of customers on mobile, redirecting ensures they have access to ApplePay. On desktop the widget opens as usual.