---
title: "FastAPI demo"
description: "Explore a FastAPI and Angular ticket checkout built with Inttegro."
canonical: "https://studio.inttegro.com/demos/fastapi"
format: inttegro-machine-docs/v1
language: "Go"
sdk_version: "v11.0.1"
reader_profile: optional
reader_manifest: "https://studio.inttegro.com/machine/go/readers/index.json"
reader_identification: "Optional: declare your client only if known and your current-session capabilities; use reader_manifest for supplemental recommendations."
preamble_estimated_tokens: 374
model_token_report: "https://studio.inttegro.com/machine/token-report.json"
preamble_questions: 5
preamble_source: "general"
recommended_mcp_tools: []
estimated_tokens: 1215
token_estimate_method: "utf8_bytes_divided_by_4"
---

## Machine preamble

**Summary:** Explore a FastAPI and Angular ticket checkout built with Inttegro. This Go representation uses the selected SDK's native names wherever Studio has a verified mapping.

### Five questions

#### Q1. When should the reader use FastAPI demo?

Use this demo guide to inspect a complete working integration and compare it with the application being built.

#### Q2. What is authoritative on this page?

The demo proves one working composition, not the only supported architecture. Follow its linked SDK and API pages for current contracts.

#### Q3. What page-specific constraint matters most?

Do not copy demo credentials, identifiers, or deployment assumptions. Recreate configuration through supported public setup paths.

#### Q4. Can Inttegro MCP materially help with this task?

No catalog ability is sufficiently specific to recommend for this page. Use the documentation directly; consult the MCP catalog only if the task later requires governed live account context or a supported operation.

#### Q5. How should the reader verify the answer and continue?

Open the hosted experience, trace the corresponding source, and verify that its SDK and API usage still matches the current linked documentation. Continue with [Read the Orders API](https://studio.inttegro.com/machine/go/api/orders.md) and [Accept payment with Inttegro Checkout](https://studio.inttegro.com/machine/go/guides/accept-payment-with-inttegro-checkout.md) when those concerns enter scope.

## Document content

# FastAPI demo

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

> Demo Release is interactive content. Use the canonical page to view it.

## What you’ll build

- A [FastAPI](https://fastapi.tiangolo.com/tutorial/) endpoint that validates a
  ticket reservation before creating an order
- Typed order construction with the [Inttegro Python SDK](https://studio.inttegro.com/machine/go/sdks/python.md)
- 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`](https://studio.inttegro.com/machine/go/web/angular.md)

## 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.

> Demo Presentation Gallery is interactive content. Use the canonical page to view it.

## Run the demo

Create a [Python virtual environment](https://docs.python.org/3/library/venv.html),
install the requirements, and start Uvicorn.
The [released README](https://github.com/inttegro/inttegro-demos/blob/fastapi-v1.8.3/fastapi/README.md)
has the exact commands.

## Key files

1. [`src/app/checkout.py`](https://github.com/inttegro/inttegro-demos/blob/fastapi-v1.8.3/fastapi/src/app/checkout.py)
   creates the order and maps safe errors.
2. [`src/app/main.py`](https://github.com/inttegro/inttegro-demos/blob/fastapi-v1.8.3/fastapi/src/app/main.py)
   connects validation to the JSON or `303` response.
3. [`client/checkout-flow.component.ts`](https://github.com/inttegro/inttegro-demos/blob/fastapi-v1.8.3/fastapi/client/checkout-flow.component.ts)
   manages embedded and modal Checkout.
4. [`client/main.ts`](https://github.com/inttegro/inttegro-demos/blob/fastapi-v1.8.3/fastapi/client/main.ts)
   mounts Angular in the server-rendered page.
5. [`src/worker.py`](https://github.com/inttegro/inttegro-demos/blob/fastapi-v1.8.3/fastapi/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

- [Browse the released source](https://github.com/inttegro/inttegro-demos/tree/fastapi-v1.8.3/fastapi)
- [Accept payment with Inttegro Checkout](https://studio.inttegro.com/machine/go/guides/accept-payment-with-inttegro-checkout.md)
- [Read the Orders API](https://studio.inttegro.com/machine/go/api/orders.md)
