Skip to main content

FastAPI demo

Build a FastAPI ticket service with an Angular checkout. One server-created order supports embedded, modal, and hosted payment.

What you’ll build

  • A FastAPI endpoint that validates a ticket reservation before creating an order
  • Typed order construction with the Inttegro Python SDK
  • Non-blocking API calls through AsyncInttegroClient
  • One ASGI application packaged for containers and Cloudflare Python Workers
  • Server-held credentials and safe error messages
  • An Angular 21 payment island using @inttegro/angular

See the flow

The gallery shows the same order in all three Checkout presentations. The Python SDK, API key, Product, and Price remain on the server.

Select any image to view it full screen.

Run the demo

Create a Python virtual environment, install the requirements, and start Uvicorn. The released README has the exact commands.

Key files

  1. src/app/checkout.py creates the order and maps safe errors.
  2. src/app/main.py connects validation to the JSON or 303 response.
  3. client/checkout-flow.component.ts manages embedded and modal Checkout.
  4. client/main.ts mounts Angular in the server-rendered page.
  5. src/worker.py exposes the app to Cloudflare Workers.

Before you ship

Store the reservation and Inttegro order ID together. Verify payment on the server before issuing the ticket.

Next