{"openapi":"3.1.0","info":{"title":"API Wispyn","version":"1.0.0","description":"API publique des exploitants Wispyn. Authentification : `Authorization: Bearer wk_…` (clé créée dans l’espace équipe, Intégrations). Droits par clé : read, booking, loyalty. Quota par minute et par clé ; chaque appel est journalisé. Montants en centimes TTC. Les créations acceptent `Idempotency-Key` : rejouer un appel renvoie la même réponse."},"servers":[{"url":"/api/v1"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"wk_<préfixe>_<secret>"}},"responses":{"Error":{"description":"Erreur","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}},"schemas":{"Booking":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reference":{"type":"string"},"status":{"type":"string","enum":["held","confirmed","cancelled","expired"]},"start":{"type":"string","example":"20:00"},"end":{"type":"string"},"players":{"type":"integer"},"totalCents":{"type":"integer"}}},"Event":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","example":"booking.confirmed"},"venueId":{"type":["string","null"]},"occurredAt":{"type":"string","format":"date-time"},"data":{"type":"object"}}}}},"paths":{"/venues":{"get":{"summary":"Lieux de l’exploitant","x-scope":"read","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/venues/{venueId}/availability":{"get":{"summary":"Créneaux d’une journée","x-scope":"read","parameters":[{"name":"venueId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/bookings":{"get":{"summary":"Réservations d’une journée","x-scope":"read","parameters":[{"name":"venueId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"bookings":{"type":"array","items":{"$ref":"#/components/schemas/Booking"}}}}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Créer une réservation déjà encaissée par un partenaire","x-scope":"booking","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["venueId","date","start","players","contact"],"properties":{"venueId":{"type":"string","format":"uuid"},"date":{"type":"string","format":"date"},"start":{"type":"string","example":"20:00"},"players":{"type":"integer","minimum":1},"contact":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"}}}}}}}},"responses":{"201":{"description":"Créée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Booking"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/bookings/{id}":{"get":{"summary":"Une réservation","x-scope":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Booking"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/events":{"get":{"summary":"Journal des événements (synchronisation par interrogation)","x-scope":"read","parameters":[{"name":"after","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Dernier événement lu"},{"name":"type","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"next":{"type":["string","null"]}}}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/insight/slots":{"get":{"summary":"Créneaux : remplissage, CA, fréquentation (connecteur PixMy)","x-scope":"read","parameters":[{"name":"venueId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/loyalty/accounts":{"get":{"summary":"Solde de fidélité d’un client","x-scope":"loyalty","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","format":"email"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/loyalty/sales":{"post":{"summary":"Points pour une vente de la caisse du bar","x-scope":"loyalty","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","amountCents","ref"],"properties":{"email":{"type":"string","format":"email"},"amountCents":{"type":"integer"},"ref":{"type":"string"},"label":{"type":"string"}}}}}},"responses":{"201":{"description":"Créditée","content":{"application/json":{"schema":{"type":"object","properties":{"pointsCredited":{"type":"integer"}}}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}}},"webhooks":{"event":{"post":{"summary":"Événement du journal (booking.confirmed, player.checked_in, game.session_ended…)","description":"En-têtes : Wispyn-Event-Id (dédoublonner), Wispyn-Event-Type, Wispyn-Signature: t=<horodatage>,v1=<HMAC-SHA256 hex de \"t.corps\" avec le secret whsec_…>. Répondre 2xx sous 10 s ; sinon nouvelles tentatives pendant ~25 h.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Reçu"}}}}}}