CHI Ontwikkelaarsplatform

v1.0.0 • OAS 3.0 • Staging

Aan de slag

Deze API biedt endpoints voor het beheren van evenementen, tickets, organisaties, betalingen en gebruikersaccounts. Integreer CHI-services in je apps en bouw voort op het CHI-ecosysteem.

Staging-omgeving

Base URL: https://api.chi.app

Pagination
GET /events?page=1&limit=20

{
  "data": [...],
  "total": 156,
  "page": 1,
  "lastPage": 8
}

Authenticatie

De meeste endpoints vereisen Bearer-tokenauthenticatie. Voeg het JWT-token toe in de Authorization-header:

Authentication
Authorization: Bearer <your-token>

# Example request
curl -X GET https://api.chi.app/events \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json"

Webhooks

Registreer webhook-endpoints via de API om realtime meldingen te ontvangen voor ticketscans, betalingen en check-ins.

Webhook Payload
POST https://your-server.com/webhook

{
  "event": "ticket.scanned",
  "timestamp": "2025-06-15T14:30:00Z",
  "data": {
    "ticketId": "tkt_abc123",
    "eventId": "evt_xyz789",
    "visitorId": "vis_456def"
  }
}

SDK's

Gebruik onze officiële pakketten om het CHI-platform te integreren in uw voorkeurstaal.

MCP Server
Binnenkort
Nog niet beschikbaar — de CHI MCP-server is nog in ontwikkeling.
REST API
OpenAPI 3.0
Nog niet gepubliceerd — API-toegang is voorlopig alleen op uitnodiging.
React Storefront SDK
Beta · @chi-ecosystem/storefront-react

Build a full event storefront — live ticket pricing, cart and checkout — without touching REST endpoints, auth, retries, rate limits or data normalization. CHI owns the commerce behavior; you own the visual experience. Ships as headless React hooks plus optional components with zero CSS, so your design system stays yours. Lineup hooks arrive together with the public lineup API.

Install (GitHub Packages registry required for the @chi-ecosystem scope)

npm install @chi-ecosystem/storefront-react @tanstack/react-query

# .npmrc - GitHub Packages auth for the @chi-ecosystem scope
@chi-ecosystem:registry=https://npm.pkg.github.com

Lineup + live tickets in ~20 lines

import {
  ChiStorefrontProvider,
  useTicketDefinitions,
  useQuote,
  formatMoney,
  money,
} from '@chi-ecosystem/storefront-react';

// Once, at the root - CHI handles auth, caching, retries,
// outage healing and quote rate-limit budgets from here on.
<ChiStorefrontProvider eventSlug="your-festival" baseUrl="production">
  <App />
</ChiStorefrontProvider>;

function Tickets() {
  const { definitions } = useTicketDefinitions();   // live prices + stock
  const [lines, setLines] = useState([]);           // your cart UI state
  const { quote } = useQuote({ lines });            // debounced + deduped

  return (
    <div className="my-tickets">                    {/* your CSS, your rules */}
      {definitions.map((d) => (
        <button key={d.id} onClick={() => addLine(setLines, d)}>
          {d.name} - {formatMoney(money(d.priceMinor, d.currency))}
        </button>
      ))}
      <Total>{formatMoney(money(quote?.pricing.totalMinor ?? 0, quote?.pricing.currency ?? 'USD'))}</Total>
    </div>
  );
}

Fouten

Fouten retourneren een JSON-object met statusCode, message en error-velden. Behandel 401 (token verlopen), 403 (verboden) en 429 (snelheidsbeperking).

Error Response
{
  "statusCode": 401,
  "message": "Unauthorized",
  "error": "Token expired"
}
CodeBetekenisActie
400Ongeldig VerzoekControleer de verzoekbody en parameters
401Niet GeautoriseerdToken verlopen — vernieuw en probeer opnieuw
403VerbodenOnvoldoende rechten voor deze bron
429SnelheidsbeperkingWacht met exponentiële vertraging
500ServerfoutProbeer later opnieuw of neem contact op met support

Limieten

100 verzoeken per minuut per API-sleutel. Gebruik exponentiële backoff bij 429-responses.

NiveauSnelheidBurst
Standaard100 req/min20 req/s
Enterprise1000 req/min100 req/s

LLM- & Agent-integratie

Standaard Contextbestanden

Wij bieden gestandaardiseerde contextbestanden conform de llms.txt-specificatie. Verwijs uw AI-agents naar deze URLs om de volledige CHI-ecosysteemcontext direct te laden.

Agent Systeemprompt (agent.md)

Om uw programmeerassistent (Cursor, Windsurf, Copilot) volledig bewust te maken van het CHI-platform, maak een agent.md-bestand in uw projectroot en plak het volgende blok. Dit zorgt ervoor dat de AI onze design tokens en API-patronen volgt.

agent.md
# CHI Ecosystem API Context for AI Agents

You are integrating with the CHI Ecosystem (EventCHI) REST API.
Base URL: https://api.chi.app (production) | https://api.staging.chi.app (staging)
Auth: Bearer token via Authorization header.

## Resources
- Full Context: https://chi.app/llms-full.txt
- Minimal Context: https://chi.app/llms-minimal.txt
- Developeroverzicht: https://chi.app/nl/developers
- Aggregatorcontext: https://chi.app/llms-aggregators.txt
- Nog niet gepubliceerd — API-toegang is voorlopig alleen op uitnodiging.
- MCP Server: Nog niet beschikbaar — de CHI MCP-server is nog in ontwikkeling.

## API Guidelines
1. **Authentication**: All requests require a Bearer token. Obtain tokens via POST /auth/login.
2. **REST Patterns**: Use strict RESTful conventions — resource-based URLs, proper HTTP methods, JSON request/response bodies.
3. **Pagination**: List endpoints support `?page=` and `?limit=` query params. Responses include `total`, `page`, and `lastPage`.
4. **Error Handling**: Errors return `{ statusCode, message, error }`. Handle 401 (token expired), 403 (forbidden), 429 (rate limited).
5. **Webhooks**: Register webhook endpoints via the API to receive real-time event notifications (ticket scans, payments, check-ins).
6. **Rate Limits**: 100 req/min per API key. Use exponential backoff on 429 responses.

## Key Resources
- **Events**: /events — create, manage, and query events.
- **Tickets**: /tickets — issue, validate, and scan tickets.
- **Payments**: /payments — process and track transactions.
- **Visitors**: /visitors — attendee profiles and wallet data.
- **Coupons**: /coupons — create and redeem discount codes.
- **Organizations**: /organizations — manage org settings and team members.

## Key Terminology
- **Visitor App**: The mobile wallet for attendees.
- **Crew App**: POS and access control for staff.
- **Backstage**: The organizer dashboard.

Event-aggregatoren

Haal CHI-evenementen op om weer te geven op je platform. We bieden meerdere feedformaten en een speciaal AI-contextbestand voor aggregatoren.

JSON-feed
GET /feeds/events.json

Gestructureerde JSON voor moderne applicaties en API's

https://api.chi.app/feeds/events.json
Example
fetch('https://api.chi.app/feeds/events.json')
  .then(res => res.json())
  .then(data => {
    console.log(data.items);
  });

// Organization-scoped
fetch('https://api.chi.app/feeds/organizations/{orgId}/events.json')

// Single event JSON-LD
fetch('https://api.chi.app/feeds/events/{eventId}.json')
Aggregator LLMs.txt
/llms-aggregators.txt

Speciaal contextbestand voor AI-gestuurde aggregatoren om CHI-eventdatastructuren te begrijpen

Aggregator-partnerschap

Verdien commissie op elke ticketverkoop die via jouw app of platform komt. Neem contact met ons op om deel te nemen aan ons aggregator-partnerprogramma en beloond te worden voor het genereren van verkopen.

Neem contact op

API-toegang — Alleen op uitnodiging

Onze API is momenteel alleen beschikbaar op uitnodiging. We werken eraan om de toegang binnenkort voor iedereen open te stellen.