zuuppaDEV
Swift SDK

Add checkout

There are two equivalent ways to present the flow. Both take an eventId and run the complete purchase experience.

Option A — the view modifier (recommended)

.zuuppaTickets(isPresented:eventId:) wires up a full-screen cover for you and flips the binding back to false when the buyer closes the flow.

SwiftUI
import SwiftUI
import zsdk_swift

struct EventButton: View {
    @State private var showTickets = false

    var body: some View {
        Button("Buy Tickets") { showTickets = true }
            .zuuppaTickets(
                isPresented: $showTickets,
                eventId: "your-event-uuid"
            )
    }
}

Modifier signature

swift
func zuuppaTickets(
    isPresented: Binding<Bool>,
    eventId: String,
    config: ZuuppaConfig = .default,
    onWalletPayment: ZuuppaWalletPaymentHandler? = nil
) -> some View
ParameterTypeDescription
isPresentedBinding<Bool>Controls presentation. The SDK sets it to false when the buyer closes the flow.
eventIdStringThe Zuuppa event UUID to sell tickets for. Required.
configZuuppaConfigBackend configuration. Defaults to production — see Configuration.
onWalletPaymentZuuppaWalletPaymentHandler?Optional in-app wallet handler. See In-app wallet payments.

Option B — present the screen yourself

Use ZuuppaTicketsScreen directly when you want to control presentation or run code in onFinish.

SwiftUI
.fullScreenCover(isPresented: $showTickets) {
    ZuuppaTicketsScreen(eventId: "your-event-uuid") {
        // onFinish — buyer closed the flow
        showTickets = false
    }
}

Initializer signature

swift
public init(
    eventId: String,
    config: ZuuppaConfig = .default,
    onWalletPayment: ZuuppaWalletPaymentHandler? = nil,
    onFinish: @escaping () -> Void = {}
)
ParameterTypeDescription
eventIdStringThe Zuuppa event UUID. Required.
configZuuppaConfigBackend configuration. Defaults to production.
onWalletPaymentZuuppaWalletPaymentHandler?Optional in-app wallet handler.
onFinish() -> VoidCalled when the buyer dismisses the flow (unlike the modifier, this is exposed here).
The buyer signs in inside the SDK. You don’t pass an auth token or API key — the SDK runs its own secure sign-in and issues tickets to that authenticated buyer. All you provide is the eventId.

What the buyer sees

The flow adapts to how the event is configured on the Zuuppa backend:

  • Card / Apple Pay when Stripe is enabled.
  • Crypto (QR deposit) when crypto is enabled — the buyer sends funds to a per-order address.
  • Pay with app wallet — only if you supply an onWalletPayment handler and the event is crypto-enabled.
  • RSVP for free events.

Next

→ In-app wallet payments