Skip to main content
This walkthrough takes you from “blank page” to “buyer purchased a ticket” in three calls. All snippets are plain 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.
Render the list however you like — there’s no required UI. Note that 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.
Each ticket_type has an id, name, price, available, and locality info. Render the picker, let the buyer select quantities.
Respect the purchase limits when rendering the picker: cap each ticket type’s selector at ticket_type.max_per_order, and the whole cart at the event’s max_tickets_per_order (both null = unlimited). These limits are also enforced server-side at checkout start — bypassing the UI just earns a 400.

3. Start checkout

After the buyer picks tickets + fills in their info, create the order:
A 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:
Tickets are emailed by UnderPass automatically when the order confirms — you don’t need to deliver them yourself.

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.
Pass the validated code on the startCheckout payload as promo_code so the backend re-applies the discount on order creation. 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:
When valid, fetch the event with ?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:
If the buyer arrived via ?ref={code}, validate it before checkout:
Pass the validated code on the 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.

Need help?

Reach the UnderPass team at developers@underpass.com.co.