fetch — no SDK required.
Prerequisites
- Your tenant
account_id(UUID) from UnderPass onboarding - The API base URL:
https://api.underpass.com.co(dev:https://api-dev.underpass.com.co)
1. List events
Show the buyer what’s for sale.account_id is required so the response is
scoped to your tenant.
data is
{ events: EventDto[], pagination: { page, limit, total, total_pages } }.
2. Fetch event detail (with tickets)
When a buyer picks an event, fetch the detail page. This includes selling stages, ticket types, prices, and locality info.ticket_type has an id, name, price, available, and locality
info. Render the picker, let the buyer select quantities.
3. Start checkout
After the buyer picks tickets + fills in their info, create the order:400 here carries a machine code you should surface to the buyer instead
of a generic failure — notably INSUFFICIENT_TICKETS (inventory ran out),
MAX_PER_ORDER_EXCEEDED / MAX_TICKETS_PER_ORDER_EXCEEDED (per-order purchase
limits), and MAX_TICKETS_PER_EMAIL_EXCEEDED (the email already holds the
maximum tickets allowed for this event). See the API reference for the
{ code, message, detail } error shape.
Redirect the buyer to redirect_url. They pay on the provider’s hosted
checkout page (Bold). When done, they land back on a URL you provide
(success_url / cancel_url — see the API reference for the full payload).
If total_amount === 0 (courtesy / fully discounted), there’s no payment
step — redirect_url will be your confirmation URL directly.
4. Poll order status
After the buyer returns from the payment page, you don’t know yet if the payment cleared. Poll the status endpoint until it resolves:End-to-end
Optional features
These slot into the same flow whenever the event has them enabled. Skip the ones your tenants don’t use.Promo codes
Validate a code before the user submits checkout. Some codes unlock hidden selling stages — re-fetch the event with?unlocked_stages=... to reveal them.
startCheckout payload as promo_code so the
backend re-applies the discount on order creation.
Sales links (private presales / promoter attribution)
A sales link is a per-event code that unlocks private selling stages and/or attributes the sale to a promoter. Validate before showing tickets:?link={code} so the response includes the
unlocked private tickets:
Referrals
Show a referral program panel on event pages so buyers see what they’d earn for sharing:?ref={code}, validate it before checkout:
startCheckout payload as referral_code for
attribution.
What’s next
Full API reference
Every payload field, every response shape, every error code.
Identity & scoping
How
account_id, ticket IDs, and (optionally) API keys gate access.
