Developer resources
Build ticketing into any website.
Everything you need to plan a MyTicket integration: the embed widget, the WordPress plugin and the design of our REST API and webhooks.
Preview documentation. Code on this page is illustrative and shows the intended design. The widget script, plugin, API endpoints and webhooks are not live yet, and details may change before launch.
Integration overview
At launchMyTicket offers three ways to sell tickets. All of them use the same ticketing engine, so inventory, orders and tickets stay in sync whichever channel a buyer uses.
Universal embed
A small script displays the ticket shop inside any web page, inline or as a pop-up.
At launchHosted checkout
Every published event gets a fast, shareable event page and checkout on MyTicket.
At launchDeveloper API
Build a fully custom ticket-buying experience on the same engine.
PlannedThe checkout always runs on MyTicket's own secure domain inside a sandboxed frame. Your page never handles buyer payment details, and host-page CSS can't break the checkout.
Widget integration
At launchPaste the snippet where the ticket shop should appear. The link inside the placeholder is a fallback: it still works if JavaScript is blocked, and the widget replaces it once loaded. Use your event code from the dashboard's Share tab.
<div class="myticket-shop" data-event="E7K3Q9XP">
<a href="https://tix.myticket.co.zw/e/E7K3Q9XP">Buy tickets</a>
</div>
<script async src="https://js.myticket.co.zw/v1/widget.js"></script><button class="myticket-button" data-event="E7K3Q9XP" data-mode="button">
Get tickets
</button>
<script async src="https://js.myticket.co.zw/v1/widget.js"></script>| Attribute | Purpose |
|---|---|
| data-event | Required. Your public event code. |
| data-mode | inline (default) or button for a pop-up. |
| data-theme | light, dark or auto. |
| data-accent | Brand colour as a hex value; contrast is checked automatically. |
| data-ticket-type | Pre-select a ticket type, e.g. VIP. |
| data-hide-header | Hide the event banner if your page already shows it. |
Content Security Policy: if your site sets a CSP, allow js.myticket.co.zw in script-src and tix.myticket.co.zw in frame-src.
document.querySelector(".myticket-shop")
.addEventListener("myticket:order_completed", (e) => {
const { order_ref, total_minor, currency, ticket_count } = e.detail;
// e.g. send a conversion event to your analytics
});WordPress integration
At launchThe official MyTicket plugin adds a shortcode, a Gutenberg block and an Elementor widget. Until it's published, the HTML snippet above works in any Custom HTML block or Elementor HTML widget.
[myticket event="E7K3Q9XP" mode="inline"]- Loads the widget only on pages that use it.
- Compatible with common caching plugins: no API keys are stored in WordPress for the embed.
- Plugin directory listing planned after the pilot phase.
REST API overview
PlannedThe API follows REST conventions: JSON over HTTPS, versioned paths (/v1), cursor pagination, idempotency keys on every write that matters, and consistent error objects. It's the same API our own ticket shop uses.
curl https://api.myticket.co.zw/v1/public/events/E7K3Q9XP \
-H "X-MyTicket-Key: pk_live_your_publishable_key"{
"event_code": "E7K3Q9XP",
"title": "Sunday Social",
"starts_at": "2026-12-13T09:00:00Z",
"timezone": "Africa/Harare",
"ticket_types": [
{ "code": "GA", "name": "General Admission", "price": { "amount_minor": 1000, "currency": "USD" }, "availability": "available" },
{ "code": "VIP", "name": "VIP", "price": { "amount_minor": 2500, "currency": "USD" }, "availability": "low" }
]
}Planned resource groups: events, ticket types, inventory, checkout sessions, orders, tickets, attendees, reports and webhooks. Tickets are only ever issued after the payment has been confirmed server-side. The API can't be used to bypass payment.
Authentication overview
PlannedPrefixed pk_. Safe in browsers. Read public event data and create checkouts only.
Prefixed sk_. Server-to-server only, never in client code. Scoped, revocable and shown once at creation.
curl https://api.myticket.co.zw/v1/orgs/{org_id}/orders?limit=50 \
-H "Authorization: Bearer sk_live_your_secret_key"Webhooks overview
PlannedReceive signed HTTPS notifications when things happen: order.paid, order.refunded, ticket.checked_in, event.updated and more. Each delivery carries a stable event ID for de-duplication and is retried with backoff for up to 24 hours.
import crypto from "node:crypto";
export function verifyMyTicketWebhook(rawBody: string, headers: Headers, secret: string) {
const timestamp = headers.get("MyTicket-Timestamp") ?? "";
const signature = (headers.get("MyTicket-Signature") ?? "").replace(/^v1=/, "");
const expected = crypto.createHmac("sha256", secret).update(`${timestamp}.${rawBody}`).digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) < 300;
return fresh && signature.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
}QR ticket secrets are never included in webhook payloads.
Want sandbox access when it opens?
Tell us what you're building and we'll reach out.
Building for an organiser?
Partner with us to deliver ticketing your clients will love.