{"openapi":"3.1.0","info":{"title":"vitef API","version":"0.1.0","description":"API de vitef.com : lettres administratives conformes, calculateurs, outils IA, envoi postal (lettre simple, recommandé, recommandé AR) avec suivi, preuves et webhooks.\n\nGuides, exemples (curl, JavaScript, Python) et tarifs : https://vitef.com/developpeurs/documentation\n\n## Authentification\n`Authorization: Bearer vf_test_…` (bac à sable) ou `vf_live_…` (production). Clés créées dans l’espace développeur (https://vitef.com/espace/api) ; la production s’ouvre après validation du compte.\n\n## Bac à sable\nClé `vf_test_` : rien n’est posté ni facturé, IA simulée, preuves fictives, 1 000 appels par jour ; `POST /v1/test/mailings/{id}/advance` fait avancer un envoi pour recevoir ses webhooks.\n\n## Erreurs\n`{ \"error\": { \"code\", \"message\", \"details?\" } }`. Codes fréquents : `invalid_api_key`, `revoked_api_key` (401) ; `account_suspended`, `live_not_enabled`, `test_only` (403) ; `insufficient_balance` (402) ; `address_invalid`, `signature_required` (422) ; `payload_too_large` (413, corps de plus de 1 Mo) ; `rate_limited`, `test_quota_exceeded` (429) ; `upstream_error` (502).\n\n## Limites\n120 requêtes par minute et par clé (en-têtes `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset`).\n\n## Facturation\n`/v1` : crédit **prépayé**, rechargé par carte, Apple Pay ou Google Pay depuis l’espace développeur (facture Stripe à chaque recharge). Chaque unité payante est débitée du solde avant exécution (402 `insufficient_balance` sinon, rien n’est exécuté) ; solde restant dans l’en-tête `X-Vitef-Balance` (centimes HT). Données et calculs : quota gratuit mensuel, puis 1 à 2 centimes. Montants en centimes d’euro **HT**. `/app` : montants TTC (grand public).\n\n## Webhooks\nÉvénements `mailing.*` signés : en-tête `Vitef-Signature: t=<horodatage>,v1=<HMAC-SHA256(secret, \"<t>.<corps brut>\")>`.","contact":{"name":"vitef","email":"contact@vitef.com","url":"https://vitef.com/developpeurs"}},"servers":[{"url":"https://app.vitef.com","description":"Production"},{"url":"https://app-preprod.vitef.com","description":"Préproduction"},{"url":"http://localhost:8787","description":"Local"}],"tags":[{"name":"B2B (v1)","description":"Nos API (clé d’API, facturation à l’usage). Jamais de rupture sans nouvelle version majeure."},{"name":"Application","description":"Web et mobile vitef (JWT Supabase)."},{"name":"Application (public)","description":"Sans authentification, limité par IP."},{"name":"Espace développeur","description":"Libre-service B2B : compte entreprise, clés, webhooks, facturation (JWT d’un compte vitef identifié)."},{"name":"Back-office","description":"Administration interne (apps/admin) : réservé à l’équipe vitef."},{"name":"Webhooks","description":"Entrants : Stripe et prestataire postal (signés ou relus, idempotents)."},{"name":"Système","description":"Santé et documentation."}],"components":{"securitySchemes":{"supabaseJwt":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Jeton d’accès Supabase (session anonyme ou compte)."},"apiKey":{"type":"http","scheme":"bearer","description":"Clé d’API vitef : `vf_live_…` (production) ou `vf_test_…` (simulation)."}},"schemas":{"Health":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"version":{"type":"string"},"time":{"type":"string"},"providers":{"type":"object","properties":{"repo":{"type":"string"},"payments":{"type":"string"},"postal":{"type":"string"},"email":{"type":"string"},"ai":{"type":"string"},"geo":{"type":"string"},"rateLimit":{"type":"string"}},"required":["repo","payments","postal","email","ai","geo","rateLimit"]}},"required":["status","version","time","providers"]},"WebhookReceived":{"type":"object","properties":{"received":{"type":"boolean","enum":[true]},"duplicate":{"type":"boolean"},"handled":{"type":"boolean"}},"required":["received","duplicate","handled"]},"ApiError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"not_found"},"message":{"type":"string","example":"Cette ressource est introuvable."},"details":{}},"required":["code","message"]}},"required":["error"]},"StripeEvent":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"],"additionalProperties":{}},"MySendingBoxWebhook":{"type":"object","properties":{},"additionalProperties":{}},"MerciFacteurWebhookForm":{"type":"object","properties":{"event":{"type":"string"},"detail":{"type":"string"}},"required":["event","detail"]},"MerciFacteurWebhookJson":{"type":"object","properties":{},"additionalProperties":{}},"Catalogue":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"icon":{"type":"string"},"title":{"type":"string"},"short":{"type":"string"},"url":{"type":"string"}},"required":["slug","icon","title","short","url"]}},"letters":{"type":"array","items":{"$ref":"#/components/schemas/LetterSummary"}},"calculators":{"type":"array","items":{"$ref":"#/components/schemas/CalculatorSummary"}},"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolSummary"}},"quotes":{"type":"array","items":{"$ref":"#/components/schemas/QuoteSummary"}},"lookups":{"type":"array","items":{"$ref":"#/components/schemas/LookupSummary"}},"pricing":{"type":"object","properties":{"delivery":{"type":"array","items":{"type":"object","properties":{"mode":{"type":"string","enum":["pdf","simple","rec","ar","lre"]},"icon":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"priceCents":{"type":"integer"},"recommended":{"type":"boolean"},"channel":{"type":"string","enum":["none","postal","electronic"]},"professionalOnly":{"type":"boolean","description":"Réservé à un destinataire professionnel (LRE)."}},"required":["mode","icon","label","description","priceCents","recommended"]}}},"required":["delivery"]}},"required":["categories","letters","calculators","tools","quotes","lookups","pricing"]},"LetterSummary":{"type":"object","properties":{"slug":{"type":"string"},"category":{"type":"string"},"icon":{"type":"string"},"title":{"type":"string"},"short":{"type":"string"},"h1":{"type":"string"},"badge":{"type":"string"},"url":{"type":"string"},"providerLabel":{"type":["string","null"]},"providers":{"type":"array","items":{"$ref":"#/components/schemas/LetterProvider"}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}}},"required":["slug","category","icon","title","short","h1","badge","url","providerLabel","providers","fields"]},"LetterProvider":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"address":{"type":["array","null"],"items":{"type":"string"}},"url":{"type":"string"}},"required":["slug","name","address","url"]},"Field":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","date","tel","email","textarea","radio","select","tabs"]},"optional":{"type":"boolean"},"placeholder":{"type":"string"},"hint":{"type":"string"},"suffix":{"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]}},"default":{"type":"string"},"rows":{"type":"integer"},"autocomplete":{"type":"string","enum":["address","company","commune"]}},"required":["key","label","type","optional"]},"CalculatorSummary":{"type":"object","properties":{"slug":{"type":"string"},"group":{"type":"string"},"icon":{"type":"string"},"title":{"type":"string"},"short":{"type":"string"},"h1":{"type":"string"},"intro":{"type":"string"},"url":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}},"presets":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"slug":{"type":"string"},"values":{"$ref":"#/components/schemas/Values"},"url":{"type":"string"}},"required":["label","slug","values","url"]}},"initialValues":{"allOf":[{"$ref":"#/components/schemas/Values"},{"description":"Valeurs initiales du jour (dates relatives résolues)."}]},"letter":{"type":["string","null"]},"route":{"$ref":"#/components/schemas/CalculatorRoute"},"fuelPrice":{"type":["object","null"],"properties":{"fuel":{"type":"string"},"price":{"type":"string"}},"required":["fuel","price"],"description":"Champ carburant et champ prix (€/L) prérempli avec le prix moyen du jour (`/app/fuel/prices`)."}},"required":["slug","group","icon","title","short","h1","intro","url","fields","presets","initialValues","letter","route","fuelPrice"]},"Values":{"type":"object","additionalProperties":{"type":"string","maxLength":5000},"description":"Valeurs du formulaire, par clé de champ."},"CalculatorRoute":{"type":["object","null"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"distance":{"type":"string"},"roundTrips":{"type":"string"}},"required":["from","to","distance"],"description":"Itinéraire routier (OSRM) entre les champs adresse `from` et `to`, qui remplit le champ `distance` (km, aller simple ; × 2 × `roundTrips` si ce champ est renseigné). `POST …/compute` le calcule si `distance` est absent."},"ToolSummary":{"type":"object","properties":{"slug":{"type":"string"},"icon":{"type":"string"},"title":{"type":"string"},"short":{"type":"string"},"h1":{"type":"string"},"intro":{"type":"string"},"url":{"type":"string"},"inputs":{"type":"array","items":{"$ref":"#/components/schemas/Field"}}},"required":["slug","icon","title","short","h1","intro","url","inputs"]},"QuoteSummary":{"type":"object","properties":{"slug":{"type":"string"},"icon":{"type":"string"},"title":{"type":"string"},"short":{"type":"string"},"h1":{"type":"string"},"intro":{"type":"string"},"url":{"type":"string"},"trade":{"type":"string"},"route":{"type":["object","null"],"properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"description":"Champs adresse entre lesquels l’itinéraire est calculé."},"steps":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}}},"required":["title","fields"]}},"lead":{"$ref":"#/components/schemas/QuoteLead"}},"required":["slug","icon","title","short","h1","intro","url","trade","route","steps","lead"]},"QuoteLead":{"type":"object","properties":{"offer":{"type":"string","description":"Offre portée par le formulaire du devis (catalogue offers.ts)."},"phoneRule":{"type":"string","enum":["standard","enr"],"description":"`enr` : rénovation énergétique, rappel sous 5 jours ouvrés."},"consents":{"type":"array","items":{"type":"object","properties":{"recipient":{"type":"string"},"channel":{"type":"string","enum":["email","phone"]},"version":{"type":"string","description":"À renvoyer dans `consents` de POST /app/leads."},"label":{"type":"string","description":"Libellé de la case, à afficher tel quel (jamais pré-cochée)."},"notice":{"type":"string","description":"Précision sous la case, à afficher telle quelle."}},"required":["recipient","channel","version","label","notice"]}}},"required":["offer","phoneRule","consents"],"description":"Demande de mise en relation du devis : une case par canal, textes versionnés."},"LookupSummary":{"type":"object","properties":{"slug":{"type":"string"},"icon":{"type":"string"},"title":{"type":"string"},"short":{"type":"string"},"h1":{"type":"string"},"intro":{"type":"string"},"url":{"type":"string"},"api":{"type":"object","properties":{"search":{"type":"string"},"detail":{"type":"string"}},"required":["search","detail"],"description":"Opérations /v1 du service (recherche, puis fiche)."}},"required":["slug","icon","title","short","h1","intro","url","api"],"description":"Vérification gratuite (référentiel public), par exemple « Vérifier une entreprise »."},"LetterDetail":{"type":"object","properties":{"slug":{"type":"string"},"category":{"type":"string"},"icon":{"type":"string"},"title":{"type":"string"},"short":{"type":"string"},"h1":{"type":"string"},"badge":{"type":"string"},"url":{"type":"string"},"providerLabel":{"type":["string","null"]},"providers":{"type":"array","items":{"$ref":"#/components/schemas/LetterProvider"}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}},"intro":{"type":"string"},"explain":{"type":"string"},"tip":{"type":"object","properties":{"title":{"type":"string"},"text":{"type":"string"}},"required":["title","text"]},"faq":{"type":"array","items":{"$ref":"#/components/schemas/Faq"}},"provider":{"allOf":[{"$ref":"#/components/schemas/LetterProvider"},{"type":["object","null"]}]},"senderFields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}},"calculator":{"type":["string","null"]}},"required":["slug","category","icon","title","short","h1","badge","url","providerLabel","providers","fields","intro","explain","tip","faq","provider","senderFields","calculator"]},"Faq":{"type":"object","properties":{"q":{"type":"string"},"a":{"type":"string"}},"required":["q","a"]},"LetterRender":{"type":"object","properties":{"letter":{"type":"string"},"provider":{"type":["string","null"]},"doc":{"$ref":"#/components/schemas/LetterDoc"},"plain":{"$ref":"#/components/schemas/PlainLetter"},"text":{"type":"string"},"missing":{"type":"array","items":{"$ref":"#/components/schemas/MissingField"}},"complete":{"type":"boolean"}},"required":["letter","provider","doc","plain","text","missing","complete"]},"LetterDoc":{"type":"object","properties":{"title":{"type":"string"},"sender":{"type":"array","items":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}}},"recipient":{"type":"array","items":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}}},"place":{"$ref":"#/components/schemas/Segment"},"date":{"$ref":"#/components/schemas/Segment"},"subject":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}},"body":{"type":"array","items":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}}},"signature":{"$ref":"#/components/schemas/Segment"}},"required":["title","sender","recipient","place","date","subject","body","signature"]},"Segment":{"type":"object","properties":{"text":{"type":"string"},"hole":{"type":"boolean","description":"true : champ à compléter (text = son libellé)."}},"required":["text","hole"]},"PlainLetter":{"type":"object","properties":{"title":{"type":"string","maxLength":200},"sender":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":8},"recipient":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":8},"place":{"type":"string","maxLength":120},"date":{"type":"string","maxLength":60},"subject":{"type":"string","maxLength":300},"body":{"type":"array","items":{"type":"string","maxLength":5000},"maxItems":40},"signature":{"type":"string","maxLength":120},"signatureImage":{"$ref":"#/components/schemas/SignatureImage"}},"required":["title","sender","recipient","place","date","subject","body","signature"],"description":"Lettre entièrement textuelle (sans champ à compléter), telle qu’imprimée et envoyée."},"SignatureImage":{"type":"string","maxLength":200000,"description":"Signature dessinée, en data URL PNG (fond transparent conseillé, 200 k caractères au plus). Imprimée au-dessus du nom.","example":"data:image/png;base64,iVBORw0KGgo…"},"MissingField":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"]},"LetterRenderRequest":{"type":"object","properties":{"values":{"$ref":"#/components/schemas/Values"},"sender":{"$ref":"#/components/schemas/Sender"},"provider":{"type":"string"}}},"Sender":{"type":"object","properties":{"name":{"type":"string","maxLength":120,"example":"Camille Martin"},"street":{"type":"string","maxLength":200,"example":"12 rue des Lilas"},"city":{"type":"string","maxLength":120,"example":"69003 Lyon"}},"default":{}},"CalculatorResult":{"type":"object","properties":{"calculator":{"type":"string"},"values":{"$ref":"#/components/schemas/Values"},"result":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"unit":{"type":"string"},"caption":{"type":["string","null"]},"rows":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]}}},"required":["label","value","unit","caption","rows"]},"route":{"type":"object","properties":{"distanceKm":{"type":"number"},"durationMin":{"type":"integer"}},"required":["distanceKm","durationMin"],"description":"Itinéraire calculé entre les deux adresses, quand la distance n’était pas fournie."},"fuelPrice":{"type":"object","properties":{"fuel":{"type":"string"},"avgCents":{"type":"number"},"updatedAt":{"type":["string","null"]}},"required":["fuel","avgCents","updatedAt"],"description":"Prix moyen du jour utilisé, quand le prix du carburant n’était pas fourni."}},"required":["calculator","values","result"]},"ComputeRequest":{"type":"object","properties":{"values":{"$ref":"#/components/schemas/Values"},"today":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Date de référence (défaut : aujourd’hui à Paris)."}}},"QuoteEstimate":{"type":"object","properties":{"service":{"type":"string"},"trade":{"type":"string"},"low":{"type":"number","description":"Bas de fourchette, euros TTC."},"high":{"type":"number","description":"Haut de fourchette, euros TTC."},"label":{"type":"string"},"caption":{"type":"string"},"rows":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]}},"items":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"detail":{"type":"string"}},"required":["title","detail"]}},"values":{"$ref":"#/components/schemas/Values"},"distanceKm":{"type":"number"},"durationMin":{"type":"number"}},"required":["service","trade","low","high","label","rows","items","values"]},"QuoteEstimateRequest":{"type":"object","properties":{"values":{"$ref":"#/components/schemas/Values"}}},"SearchResults":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"sub":{"type":"string"},"icon":{"type":"string"},"kind":{"type":"string","example":"Lettre","description":"Lettre, Calcul, IA, Devis, Page…"},"path":{"type":"string"},"url":{"type":"string"}},"required":["title","sub","icon","kind","path","url"]}},"mode":{"type":"string","enum":["hybrid","lexical"],"description":"Moteur effectivement utilisé : `hybrid` (mots-clés + sémantique) ou `lexical` (mots-clés seuls, y compris en repli)."}},"required":["results","mode"]},"Shipment":{"type":"object","properties":{"title":{"type":"string"},"mode":{"$ref":"#/components/schemas/ShipmentMode"},"modeLabel":{"type":"string"},"status":{"$ref":"#/components/schemas/ShipmentStatus"},"statusLabel":{"type":"string"},"step":{"type":"integer"},"lastStep":{"type":"integer","description":"4 (simple, recommandé) ou 5 (recommandé avec AR)."},"trackingNumber":{"type":"string"},"createdAt":{"type":"string"},"events":{"type":"array","items":{"$ref":"#/components/schemas/ShipmentEvent"}},"id":{"type":"string"},"orderId":{"type":["string","null"]},"recipient":{"type":"array","items":{"type":"string"}},"recipientEmail":{"type":"string","description":"LRE : adresse e-mail du destinataire."},"amountCents":{"type":"integer"},"reference":{"type":["string","null"]},"test":{"type":"boolean","description":"Envoi simulé (clé vf_test_) : rien n’est posté."},"proofs":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/ProofKind"},"label":{"type":"string"}},"required":["kind","label"]},"description":"Preuves disponibles (dépôt, accusé de réception…), à télécharger via …/proofs/{kind}."},"document":{"$ref":"#/components/schemas/PlainLetter"}},"required":["title","mode","modeLabel","status","statusLabel","step","lastStep","createdAt","events","id","orderId","recipient","amountCents","reference","test","proofs"],"example":{"id":"8f2c1f0e-5b7a-4c1e-9a3d-2f6b8e1c4d20","orderId":null,"title":"Résiliation Free","mode":"ar","modeLabel":"Recommandé avec AR","status":"posted","statusLabel":"Remise à La Poste","step":2,"lastStep":5,"trackingNumber":"1A12345678901","createdAt":"2026-09-24T08:12:03.000Z","events":[{"step":0,"status":"paid","label":"Payée","at":"2026-09-24T08:12:03.000Z"},{"step":1,"status":"printed","label":"Imprimée","at":"2026-09-24T09:40:00.000Z"},{"step":2,"status":"posted","label":"Remise à La Poste","at":"2026-09-24T15:02:00.000Z"}],"recipient":["Free – Service Résiliation","TSA 20001","75371 Paris Cedex 08"],"amountCents":940,"reference":"CRM-4812","test":false,"proofs":[{"kind":"filing","label":"Preuve de dépôt"}]}},"ShipmentMode":{"type":"string","enum":["simple","rec","ar","lre"]},"ShipmentStatus":{"type":"string","enum":["paid","printed","posted","in_transit","delivered","ar_signed","returned","error","canceled"]},"ShipmentEvent":{"type":"object","properties":{"step":{"type":"integer","description":"0 payée, 1 imprimée, 2 remise à La Poste, 3 acheminement, 4 distribuée, 5 AR signé."},"status":{"$ref":"#/components/schemas/ShipmentStatus"},"label":{"type":"string"},"at":{"type":"string"}},"required":["step","status","label","at"]},"ProofKind":{"type":"string","enum":["filing","delivery","return","download","rejection","negligence"]},"MailingRequest":{"type":"object","properties":{"letter":{"type":"string","description":"Slug de la lettre du catalogue.","example":"resiliation-box"},"provider":{"type":"string","description":"Slug du fournisseur (facultatif).","example":"free"},"values":{"$ref":"#/components/schemas/Values"},"sender":{"$ref":"#/components/schemas/Sender"},"doc":{"allOf":[{"$ref":"#/components/schemas/PlainLetter"},{"description":"Lettre libre (IA, sur mesure) : à la place de letter/values."}]},"signatureImage":{"allOf":[{"$ref":"#/components/schemas/SignatureImage"},{"description":"Signature dessinée à imprimer sur la lettre (catalogue ou lettre libre)."}]},"mode":{"$ref":"#/components/schemas/PostalMode"},"reference":{"type":"string","maxLength":30,"pattern":"^[A-Za-z0-9 _-]*$","description":"Votre référence (30 caractères, lettres, chiffres, espace, _ et -)."}},"required":["mode"],"example":{"letter":"resiliation-box","provider":"free","values":{"ref":"55443322","motif":"Déménagement"},"sender":{"name":"Camille Martin","street":"12 rue des Lilas","city":"69003 Lyon"},"mode":"ar","reference":"CRM-4812"}},"PostalMode":{"type":"string","enum":["simple","rec","ar"]},"ProofLink":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/ProofKind"},"label":{"type":"string"},"url":{"type":"string","format":"uri","description":"Lien de téléchargement chez le prestataire, valable quelques minutes : à ouvrir aussitôt."}},"required":["kind","label","url"]},"V1TestAdvance":{"type":"object","properties":{"to":{"type":"string","enum":["printed","posted","in_transit","delivered","ar_signed","returned","error"]}}},"CompanyResults":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/CompanyResult"}}},"required":["results"]},"CompanyResult":{"type":"object","properties":{"name":{"type":"string","description":"Enseigne, à défaut dénomination."},"siret":{"type":"string"},"address":{"type":"string","description":"Adresse de l’établissement, sur une ligne.","example":"12 Rue des Ardennes, 69100 Villeurbanne"},"city":{"type":"string"},"naf":{"type":"string"},"siren":{"type":"string"},"headquarters":{"type":"boolean","description":"Établissement siège social."},"active":{"type":"boolean","description":"Établissement ouvert (SIRET actif)."},"professional":{"type":"boolean","description":"Destinataire professionnel : établissement actif d’une entreprise hors personnes publiques et associations. La lettre recommandée électronique ne requiert pas son accord préalable (art. L100 CPCE)."}},"required":["name","siret","address","siren","headquarters","active","professional"]},"CompanyProfile":{"type":"object","properties":{"name":{"type":"string","description":"Enseigne, à défaut dénomination."},"siret":{"type":"string"},"address":{"type":"string","description":"Adresse de l’établissement, sur une ligne.","example":"12 Rue des Ardennes, 69100 Villeurbanne"},"city":{"type":"string"},"naf":{"type":"string"},"siren":{"type":"string"},"headquarters":{"type":"boolean","description":"Établissement siège social."},"active":{"type":"boolean","description":"Établissement ouvert (SIRET actif)."},"professional":{"type":"boolean","description":"Destinataire professionnel : établissement actif d’une entreprise hors personnes publiques et associations. La lettre recommandée électronique ne requiert pas son accord préalable (art. L100 CPCE)."},"legalName":{"type":"string","description":"Dénomination de l’entreprise (unité légale) : le destinataire juridique."},"tradeName":{"type":["string","null"]},"companyActive":{"type":"boolean","description":"Entreprise en activité (non cessée)."},"legalForm":{"$ref":"#/components/schemas/CodeLabel"},"activity":{"$ref":"#/components/schemas/CodeLabel"},"foundedOn":{"type":["string","null"],"description":"Date de création de l’entreprise (AAAA-MM-JJ)."},"headcount":{"type":["string","null"],"description":"Tranche d’effectif salarié.","example":"20 à 49 salariés"},"seat":{"type":["object","null"],"properties":{"siret":{"type":"string"},"address":{"type":"string"}},"required":["siret","address"],"description":"Siège social actif : adresse des courriers juridiques à l’entreprise."},"establishments":{"type":"integer"},"dataAsOf":{"type":"object","properties":{"sourceRelease":{"type":["string","null"]},"refreshedAt":{"type":["string","null"]}},"required":["sourceRelease","refreshedAt"],"description":"Fraîcheur de l’annuaire : millésime SIRENE (INSEE) et dernier chargement."}},"required":["name","siret","address","siren","headquarters","active","professional","legalName","tradeName","companyActive","legalForm","activity","foundedOn","headcount","seat","establishments","dataAsOf"]},"CodeLabel":{"type":["object","null"],"properties":{"code":{"type":"string"},"label":{"type":"string"}},"required":["code","label"]},"FuelPrices":{"type":"object","properties":{"asOf":{"type":"string","description":"Calcul des statistiques (ISO 8601)."},"updatedAt":{"type":["string","null"],"description":"Dernière relecture du flux prix-carburants.gouv.fr (ISO 8601)."},"source":{"type":"string","example":"prix-carburants.gouv.fr"},"maxAgeDays":{"type":"integer","description":"Seuls les prix publiés depuis moins de N jours comptent."},"national":{"type":"array","items":{"$ref":"#/components/schemas/FuelStat"}},"department":{"type":["object","null"],"properties":{"code":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FuelStat"}}},"required":["code","items"]}},"required":["asOf","updatedAt","source","maxAgeDays","national","department"]},"FuelStat":{"type":"object","properties":{"slug":{"type":"string"},"code":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer","description":"Stations dont le prix compte dans la moyenne."},"avgCents":{"type":"number","description":"Centimes TTC par litre (une décimale possible : 240,5)."},"medianCents":{"type":"number","description":"Centimes TTC par litre (une décimale possible : 240,5)."},"minCents":{"type":"number","description":"Centimes TTC par litre (une décimale possible : 240,5)."},"maxCents":{"type":"number","description":"Centimes TTC par litre (une décimale possible : 240,5)."},"latestReportedAt":{"type":["string","null"]}},"required":["slug","code","label","count","avgCents","medianCents","minCents","maxCents","latestReportedAt"]},"FuelStations":{"type":"object","properties":{"fuel":{"$ref":"#/components/schemas/FuelRef"},"scope":{"type":"string","enum":["nearby","city","around"],"description":"`around` : commune avec trop peu de stations, recherche élargie autour de son centre."},"total":{"type":"integer"},"summary":{"type":["object","null"],"properties":{"count":{"type":"integer"},"avgCents":{"type":"number","description":"Centimes TTC par litre (une décimale possible : 240,5)."},"medianCents":{"type":"number","description":"Centimes TTC par litre (une décimale possible : 240,5)."},"minCents":{"type":"number","description":"Centimes TTC par litre (une décimale possible : 240,5)."},"maxCents":{"type":"number","description":"Centimes TTC par litre (une décimale possible : 240,5)."}},"required":["count","avgCents","medianCents","minCents","maxCents"],"description":"Sur toutes les stations trouvées (100 au plus)."},"stations":{"type":"array","items":{"$ref":"#/components/schemas/FuelStation"}},"source":{"type":"string"},"maxAgeDays":{"type":"integer"}},"required":["fuel","scope","total","summary","stations","source","maxAgeDays"]},"FuelRef":{"type":"object","properties":{"slug":{"type":"string","example":"gazole"},"code":{"type":"string","description":"Code du service commun (B7, SP95_E10, SP98, E85, GPL)."},"label":{"type":"string","example":"Gazole"}},"required":["slug","code","label"]},"FuelStation":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"],"description":"Nom publié, sinon l’enseigne ; `null` si inconnus."},"brand":{"type":["string","null"]},"address":{"type":"string"},"postcode":{"type":"string"},"city":{"type":"string"},"insee":{"type":["string","null"]},"department":{"type":["string","null"]},"lat":{"type":"number"},"lon":{"type":"number"},"distanceM":{"type":["number","null"],"description":"Distance au point recherché, en mètres (recherche de proximité)."},"prices":{"type":"array","items":{"type":"object","properties":{"fuel":{"type":"string"},"cents":{"type":"number","description":"Centimes TTC par litre (une décimale possible : 240,5)."},"updatedAt":{"type":"string"}},"required":["fuel","cents","updatedAt"]}},"open24h":{"type":"boolean","description":"La station ne ferme jamais."},"automat24h":{"type":"boolean","description":"Pompe accessible à toute heure par carte bancaire."},"onHighway":{"type":"boolean"},"services":{"type":"array","items":{"type":"string"},"description":"LAVAGE, RESTAURATION, BOUTIQUE, DOUCHE, PARKING_PL."},"hours":{"type":["array","null"],"items":{"type":"object","properties":{"day":{"type":"integer","description":"1 = lundi … 7 = dimanche."},"closed":{"type":"boolean"},"ranges":{"type":"array","items":{"type":"string"}}},"required":["day","closed","ranges"]}}},"required":["id","name","brand","address","postcode","city","insee","department","lat","lon","distanceM","prices","open24h","automat24h","onHighway","services","hours"]},"AddressResults":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"street":{"type":"string"},"postcode":{"type":"string"},"city":{"type":"string"},"lat":{"type":"number"},"lon":{"type":"number"}},"required":["label","street","postcode","city","lat","lon"]}}},"required":["results"]},"CityResults":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"postcode":{"type":"string"},"city":{"type":"string"},"label":{"type":"string"}},"required":["postcode","city","label"]}}},"required":["results"]},"RouteResult":{"type":"object","properties":{"distanceKm":{"type":"number"},"durationMin":{"type":"integer"},"from":{"$ref":"#/components/schemas/GeoPoint"},"to":{"$ref":"#/components/schemas/GeoPoint"},"geometry":{"type":"array","items":{"type":"array","items":{"type":"number"}},"description":"Tracé simplifié : points [lon, lat] (avec `geometry=true`)."}},"required":["distanceKm","durationMin","from","to"]},"GeoPoint":{"type":"object","properties":{"lat":{"type":"number"},"lon":{"type":"number"},"label":{"type":"string"}},"required":["lat","lon","label"]},"Settlement":{"type":"object","properties":{"total":{"type":"integer","description":"Total des dépenses, centimes."},"paid":{"type":"array","items":{"type":"integer"},"description":"Avancé par chacun (index des participants)."},"share":{"type":"array","items":{"type":"integer"},"description":"Part due par chacun."},"balance":{"type":"array","items":{"type":"integer"},"description":"Solde : positif, on lui doit ; négatif, il doit."},"transfers":{"type":"array","items":{"type":"object","properties":{"from":{"type":"integer"},"to":{"type":"integer"},"amount":{"type":"integer"}},"required":["from","to","amount"]},"description":"Remboursements, en nombre minimal."},"gaps":{"type":"array","items":{"type":"object","properties":{"expense":{"type":"integer"},"diff":{"type":"integer"}},"required":["expense","diff"]},"description":"Dépenses en montants précis dont la somme diffère du montant (écart en centimes)."}},"required":["total","paid","share","balance","transfers","gaps"]},"ExpenseGroup":{"type":"object","properties":{"people":{"type":"array","items":{"type":"string","maxLength":40},"minItems":2,"maxItems":50,"description":"Participants ; désignés ensuite par leur index (0, 1, 2…).","example":["Camille","Léo","Inès"]},"expenses":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":80},"amount":{"type":"integer","minimum":0,"maximum":100000000,"description":"Centimes."},"payer":{"type":"integer","minimum":0,"description":"Index du participant qui a payé."},"split":{"type":"object","properties":{"kind":{"type":"string","enum":["equal","exact"],"description":"`equal` : parts égales entre `among` ; `exact` : montants de `amounts`."},"among":{"type":"array","items":{"type":"integer","minimum":0},"maxItems":50,"description":"`equal` : index des participants concernés (absent ou vide : tous)."},"amounts":{"type":"array","items":{"type":"integer","minimum":0},"maxItems":50,"description":"`exact` : part de chacun en centimes, par index (0 : non concerné)."}},"default":{"kind":"equal"},"required":["kind"]}},"required":["label","amount","payer"]},"maxItems":500}},"required":["people","expenses"],"example":{"people":["Camille","Léo","Inès"],"expenses":[{"label":"Location","amount":90000,"payer":0,"split":{"kind":"equal","among":[]}},{"label":"Courses","amount":12000,"payer":1,"split":{"kind":"equal","among":[0,1]}}]}},"V1AiToolResult":{"type":"object","properties":{"slug":{"type":"string"},"text":{"type":"string"}},"required":["slug","text"]},"AiToolRequest":{"type":"object","properties":{"inputs":{"$ref":"#/components/schemas/Values"}},"required":["inputs"]},"V1AiFillResult":{"type":"object","properties":{"values":{"$ref":"#/components/schemas/Values"},"filled":{"type":"integer"}},"required":["values","filled"]},"AiFillRequest":{"type":"object","properties":{"letter":{"type":"string"},"provider":{"type":"string"},"text":{"type":"string","minLength":3,"maxLength":2000}},"required":["letter","text"]},"V1AiLetterResult":{"type":"object","properties":{"title":{"type":"string"},"recipient":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"body":{"type":"array","items":{"type":"string"}},"tip":{"type":"string"},"doc":{"$ref":"#/components/schemas/PlainLetter"}},"required":["title","recipient","subject","body","tip","doc"]},"AiLetterRequest":{"type":"object","properties":{"text":{"type":"string","minLength":10,"maxLength":4000},"sender":{"$ref":"#/components/schemas/Sender"}},"required":["text"]},"ServiceRequest":{"type":"object","properties":{"id":{"type":"string"},"kind":{"$ref":"#/components/schemas/ServiceRequestKind"},"message":{"type":"string"},"query":{"type":"string"},"status":{"type":"string","enum":["new","planned","done","rejected"],"description":"new : reçue ; planned : prévue ; done : en ligne ; rejected : non retenue."},"createdAt":{"type":"string"}},"required":["id","kind","message","status","createdAt"]},"ServiceRequestKind":{"type":"string","enum":["letter","calculator","ai_tool","other"],"description":"Nature du service demandé : lettre, calculateur, outil IA ou autre."},"ServiceRequestInput":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/ServiceRequestKind"},"message":{"type":"string","minLength":5,"maxLength":2000,"example":"Un calculateur de frais de notaire pour un terrain à bâtir."},"query":{"type":"string","maxLength":200,"description":"Recherche d’origine, si la demande suit une recherche sans résultat."},"source":{"type":"string","maxLength":300,"description":"Page d’où vient la demande (chemin)."},"email":{"type":"string","format":"email","description":"Facultatif : prévenu quand le service est en ligne."}},"required":["message"]},"ServiceRequestList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ServiceRequest"}}},"required":["data"]},"Tracking":{"type":"object","properties":{"title":{"type":"string"},"mode":{"$ref":"#/components/schemas/ShipmentMode"},"modeLabel":{"type":"string"},"status":{"$ref":"#/components/schemas/ShipmentStatus"},"statusLabel":{"type":"string"},"step":{"type":"integer"},"lastStep":{"type":"integer","description":"4 (simple, recommandé) ou 5 (recommandé avec AR)."},"trackingNumber":{"type":"string"},"createdAt":{"type":"string"},"events":{"type":"array","items":{"$ref":"#/components/schemas/ShipmentEvent"}}},"required":["title","mode","modeLabel","status","statusLabel","step","lastStep","createdAt","events"],"description":"Suivi public : ni destinataire ni contenu."},"LeadCreated":{"type":"object","properties":{"id":{"type":"string"},"duplicate":{"type":"boolean","description":"Demande déjà reçue (30 jours, même vertical) : la demande existante est renvoyée."},"callbackBefore":{"type":"string","description":"Rappel au plus tard (AAAA-MM-JJ), rénovation énergétique."},"estimate":{"allOf":[{"$ref":"#/components/schemas/QuoteEstimate"},{"description":"Devis seulement : estimation recalculée."}]}},"required":["id","duplicate"]},"LeadRequest":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/LeadSource"},"service":{"type":"string","minLength":1,"maxLength":80,"description":"Ancien champ : slug du devis (= source { kind: quote })."},"offer":{"type":"string","minLength":1,"maxLength":80,"description":"Offre du catalogue (offers.ts). Facultative pour un devis : celle de son formulaire."},"trade":{"type":"string","maxLength":80,"description":"Ignoré : le métier vient du catalogue."},"values":{"allOf":[{"$ref":"#/components/schemas/Values"},{"description":"Valeurs saisies dans le service source (devis : l’estimation est recalculée)."}]},"qualification":{"type":"object","additionalProperties":{"type":"string","maxLength":300},"description":"Réponses aux champs de qualification de l’offre (les autres clés sont ignorées)."},"estimate":{"type":"object","properties":{"low":{"type":"number"},"high":{"type":"number"}},"required":["low","high"],"description":"Ignorée : l’estimation est recalculée côté serveur."},"contact":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"email":{"type":"string","format":"email"},"phone":{"type":"string","minLength":6,"maxLength":30,"description":"Obligatoire si le consentement téléphonique est donné."},"postcode":{"type":"string","pattern":"^\\d{5}$","description":"Ignoré : remplacé par la commune du chantier (champ `commune`, ou adresse de départ), vérifiée dans la base adresse nationale."}},"required":["name","email"]},"consents":{"type":"array","items":{"$ref":"#/components/schemas/LeadConsent"},"minItems":1,"maxItems":4,"description":"Une entrée par case cochée (destinataire × canal). Jamais pré-cochée."},"consent":{"type":"boolean","enum":[true],"description":"Ancien champ (clients d’avant le 24/09/2026), remplacé par `consents`."}},"required":["contact"]},"LeadSource":{"type":"object","properties":{"kind":{"type":"string","enum":["quote","calculator","letter","tool"]},"slug":{"type":"string","minLength":1,"maxLength":80}},"required":["kind","slug"],"description":"Service d’où vient la demande (après son résultat)."},"LeadConsent":{"type":"object","properties":{"recipient":{"type":"string","minLength":1,"maxLength":80,"description":"`vitef` tant qu’aucun partenaire n’est nommé (catalogue partners.ts).","example":"vitef"},"channel":{"type":"string","enum":["email","phone"]},"version":{"type":"string","minLength":1,"maxLength":80,"description":"Version du texte affiché (catalogue consents.ts). Le serveur conserve le texte exact.","example":"vitef.email.2026-09-24"}},"required":["recipient","channel","version"]},"Ok":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"OfferEventRequest":{"type":"object","properties":{"event":{"type":"string","enum":["offer_impression","offer_click"]},"offer":{"type":"string","minLength":1,"maxLength":80},"source":{"$ref":"#/components/schemas/LeadSource"}},"required":["event","offer","source"]},"StatsRecorded":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"recorded":{"type":"integer"}},"required":["ok","recorded"]},"StatsBatch":{"type":"object","properties":{"platform":{"type":"string","enum":["web","embed","mobile"]},"sessionId":{"type":"string","format":"uuid"},"visitorId":{"type":"string","format":"uuid"},"device":{"type":"string","enum":["mobile","tablet","desktop"]},"events":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":40},"service":{"type":"string","maxLength":120},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"path":{"type":"string","maxLength":500},"referrer":{"type":"string","maxLength":500},"search":{"type":"string","maxLength":1000},"hash":{"type":"string","maxLength":20},"at":{"type":"string","maxLength":40}},"required":["event"]},"minItems":1,"maxItems":25}},"required":["platform","events"]},"ContactRequest":{"type":"object","properties":{"email":{"type":"string","format":"email"},"message":{"type":"string","minLength":5,"maxLength":5000},"name":{"type":"string","maxLength":120},"subject":{"type":"string","maxLength":200}},"required":["email","message"]},"SearchMissInput":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"source":{"type":"string","maxLength":300}},"required":["q"]},"Me":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"isAnonymous":{"type":"boolean"},"displayName":{"type":"string"},"sender":{"type":"object","properties":{"name":{"type":"string"},"street":{"type":"string"},"city":{"type":"string"}},"required":["name","street","city"]},"credits":{"type":"integer"},"freeTrialsLeft":{"type":"integer","deprecated":true,"description":"Ancien nom de aiLeftToday (app mobile)."},"aiUnlimited":{"type":"boolean","deprecated":true,"description":"Toujours false : l’IA est plafonnée par jour."},"aiLeftToday":{"type":"integer","description":"Utilisations IA restantes aujourd’hui (0 pour une session anonyme)."},"aiDailyLimit":{"type":"integer","description":"Utilisations IA par jour pour ce compte (0 pour une session anonyme)."},"developer":{"type":"boolean","description":"Membre d’un compte développeur (API B2B) : onglet « Nos API » de l’espace."},"createdAt":{"type":"string"}},"required":["id","isAnonymous","credits","freeTrialsLeft","aiUnlimited","aiLeftToday","aiDailyLimit","developer","createdAt"]},"UpdateMeRequest":{"type":"object","properties":{"displayName":{"type":"string","maxLength":120},"sender":{"$ref":"#/components/schemas/Sender"}}},"AccountExport":{"type":"object","properties":{"exported_at":{"type":"string"}},"additionalProperties":{},"description":"Données du compte, par catégorie (profile, documents, orders, shipments, invoices, leads…)."},"ClaimResult":{"type":"object","properties":{"orders":{"type":"integer"},"documents":{"type":"integer"},"shipments":{"type":"integer"},"ledger":{"type":"integer"}},"required":["orders","documents","shipments","ledger"]},"ClaimRequest":{"type":"object","properties":{"anonymousToken":{"type":"string","minLength":20}},"required":["anonymousToken"]},"DocumentItem":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"createdAt":{"type":"string"},"letter":{"type":"string"},"provider":{"type":"string"},"doc":{"$ref":"#/components/schemas/PlainLetter"}},"required":["id","title","createdAt","doc"]},"CreateDocumentRequest":{"type":"object","properties":{"letter":{"type":"string","description":"Slug de la lettre du catalogue.","example":"resiliation-box"},"provider":{"type":"string","description":"Slug du fournisseur (facultatif).","example":"free"},"values":{"$ref":"#/components/schemas/Values"},"sender":{"$ref":"#/components/schemas/Sender"},"doc":{"allOf":[{"$ref":"#/components/schemas/PlainLetter"},{"description":"Lettre libre (IA, sur mesure) : à la place de letter/values."}]},"signatureImage":{"allOf":[{"$ref":"#/components/schemas/SignatureImage"},{"description":"Signature dessinée à imprimer sur la lettre (catalogue ou lettre libre)."}]},"title":{"type":"string","maxLength":200}}},"DocumentList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DocumentItem"}}},"required":["items"]},"PdfRequest":{"type":"object","properties":{"letter":{"type":"string","description":"Slug de la lettre du catalogue.","example":"resiliation-box"},"provider":{"type":"string","description":"Slug du fournisseur (facultatif).","example":"free"},"values":{"$ref":"#/components/schemas/Values"},"sender":{"$ref":"#/components/schemas/Sender"},"doc":{"allOf":[{"$ref":"#/components/schemas/PlainLetter"},{"description":"Lettre libre (IA, sur mesure) : à la place de letter/values."}]},"signatureImage":{"allOf":[{"$ref":"#/components/schemas/SignatureImage"},{"description":"Signature dessinée à imprimer sur la lettre (catalogue ou lettre libre)."}]}}},"Checkout":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/Order"},"clientSecret":{"type":"string","description":"À confirmer avec Stripe (Payment Element / PaymentSheet). Absent si rien à payer."},"publishableKey":{"type":"string"}},"required":["order"]},"Order":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["delivery","white_label","ai_unit","ai_pack","plus"],"description":"delivery ; white_label (licence marque blanche) ; ai_unit, ai_pack et plus : anciennes commandes (crédits IA, abonnement), plus vendus."},"status":{"type":"string","enum":["pending","paid","failed","refunded","canceled"]},"fulfilled":{"type":"boolean","description":"Commande exécutée (lettre déposée, PDF envoyé, crédits ajoutés)."},"mode":{"$ref":"#/components/schemas/DeliveryMode"},"amountCents":{"type":"integer"},"email":{"type":"string"},"label":{"type":"string"},"letter":{"type":"string","description":"Slug de la lettre du catalogue (absent pour une lettre sur mesure)."},"credits":{"type":"integer"},"createdAt":{"type":"string"},"paidAt":{"type":"string"},"document":{"$ref":"#/components/schemas/PlainLetter"},"shipment":{"$ref":"#/components/schemas/Shipment"},"invoiceUrl":{"type":"string","format":"uri","description":"Facture PDF (lien signé). Absente tant que la facturation n’est pas active ou si rien n’a été payé."},"creditNoteUrl":{"type":"string","format":"uri","description":"Avoir PDF (lien signé), après un remboursement."},"withdrawalUrl":{"type":"string","format":"uri","description":"Page « Renoncer au contrat ici » (lien signé) d’une commande payante : rétractation en ligne (art. L221-21 C. conso.)."}},"required":["id","kind","status","fulfilled","amountCents","label","credits","createdAt"]},"DeliveryMode":{"type":"string","enum":["pdf","simple","rec","ar","lre"]},"CreateOrderRequest":{"type":"object","properties":{"letter":{"type":"string","description":"Slug de la lettre du catalogue.","example":"resiliation-box"},"provider":{"type":"string","description":"Slug du fournisseur (facultatif).","example":"free"},"values":{"$ref":"#/components/schemas/Values"},"sender":{"$ref":"#/components/schemas/Sender"},"doc":{"allOf":[{"$ref":"#/components/schemas/PlainLetter"},{"description":"Lettre libre (IA, sur mesure) : à la place de letter/values."}]},"signatureImage":{"allOf":[{"$ref":"#/components/schemas/SignatureImage"},{"description":"Signature dessinée à imprimer sur la lettre (catalogue ou lettre libre)."}]},"mode":{"$ref":"#/components/schemas/DeliveryMode"},"email":{"type":"string","format":"email","description":"E-mail saisi au paiement (obligatoire pour une session anonyme sans e-mail)."},"createAccount":{"type":"boolean","description":"Indicatif : la création du compte se fait côté client (OTP Supabase)."},"documentId":{"type":"string","format":"uuid","description":"Document déjà enregistré, à la place de letter/doc."},"waiveWithdrawal":{"type":"boolean","description":"Envoi postal : le client demande l’envoi immédiat et renonce à la rétractation une fois la lettre remise à La Poste (art. L221-28 C. conso.). Horodaté comme preuve."},"recipientEmail":{"type":"string","format":"email","description":"Recommandé électronique (mode lre) : e-mail du destinataire."},"recipientProfessional":{"type":"boolean","description":"Recommandé électronique : le client atteste que le destinataire est un professionnel (sinon son accord préalable est requis)."}},"required":["mode"]},"OrderList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}},"required":["items"]},"AiFillResult":{"type":"object","properties":{"values":{"$ref":"#/components/schemas/Values"},"filled":{"type":"integer"},"credits":{"type":"integer"},"freeTrialsLeft":{"type":"integer","deprecated":true},"aiLeftToday":{"type":"integer"},"aiDailyLimit":{"type":"integer"}},"required":["values","filled","credits","freeTrialsLeft","aiLeftToday","aiDailyLimit"]},"AppAiFillRequest":{"type":"object","properties":{"letter":{"type":"string"},"provider":{"type":"string"},"text":{"type":"string","minLength":3,"maxLength":2000}},"required":["letter","text"]},"AiLetterResult":{"type":"object","properties":{"title":{"type":"string"},"recipient":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"body":{"type":"array","items":{"type":"string"}},"tip":{"type":"string"},"doc":{"$ref":"#/components/schemas/PlainLetter"},"credits":{"type":"integer"},"freeTrialsLeft":{"type":"integer","deprecated":true},"aiLeftToday":{"type":"integer"},"aiDailyLimit":{"type":"integer"}},"required":["title","recipient","subject","body","tip","doc","credits","freeTrialsLeft","aiLeftToday","aiDailyLimit"]},"AppAiLetterRequest":{"type":"object","properties":{"text":{"type":"string","minLength":10,"maxLength":4000},"sender":{"$ref":"#/components/schemas/Sender"}},"required":["text"]},"AiToolResult":{"type":"object","properties":{"slug":{"type":"string"},"text":{"type":"string"},"credits":{"type":"integer"},"freeTrialsLeft":{"type":"integer","deprecated":true},"aiLeftToday":{"type":"integer"},"aiDailyLimit":{"type":"integer"}},"required":["slug","text","credits","freeTrialsLeft","aiLeftToday","aiDailyLimit"]},"AppAiToolRequest":{"type":"object","properties":{"inputs":{"$ref":"#/components/schemas/Values"}},"required":["inputs"]},"ShipmentList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Shipment"}}},"required":["items"]},"InvoiceList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}},"required":["items"]},"Invoice":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string","example":"F2026-000001"},"kind":{"type":"string","enum":["invoice","credit_note"]},"orderId":{"type":"string"},"issuedAt":{"type":"string"},"label":{"type":"string"},"totalHtCents":{"type":"integer"},"totalVatCents":{"type":"integer"},"totalTtcCents":{"type":"integer","description":"Négatif pour un avoir."},"url":{"type":"string","format":"uri","description":"PDF (lien signé, sans authentification)."}},"required":["id","number","kind","issuedAt","label","totalHtCents","totalVatCents","totalTtcCents","url"]},"Withdrawal":{"type":"object","properties":{"orderId":{"type":"string"},"kind":{"type":"string"},"label":{"type":"string"},"amountCents":{"type":"integer"},"paidAt":{"type":"string"},"deadline":{"type":"string","description":"Dernier jour (inclus, heure de Paris) pour se rétracter, AAAA-MM-JJ."},"state":{"type":"string","enum":["open","done","closed"],"description":"open : rétractation possible ; done : déjà déclarée ; closed : impossible (motif dans reason)."},"reason":{"type":"string"},"refundCents":{"type":"integer","description":"Remboursement dû (open) ou accordé (done), en centimes TTC."},"declaredAt":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","description":"Adresse de l’accusé de réception."}},"required":["orderId","kind","label","amountCents","state","refundCents"]},"WithdrawalRequest":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120,"description":"Nom et prénom du consommateur."}},"required":["name"]},"WhiteLabelLicenses":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WhiteLabelLicense"}},"priceCents":{"type":"integer","description":"Prix TTC d’une licence, en centimes."},"months":{"type":"integer"},"fonts":{"type":"array","items":{"type":"string"},"description":"Polices proposées (data-police)."},"available":{"type":"boolean","description":"false : vente fermée sur cet environnement."}},"required":["items","priceCents","months","fonts","available"]},"WhiteLabelLicense":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string","example":"exemple.fr","description":"Domaine couvert, sous-domaines compris."},"expiresAt":{"type":"string","description":"Échéance ; pas de renouvellement automatique."},"active":{"type":"boolean"},"token":{"type":["string","null"],"description":"Jeton à mettre dans data-licence (signé Ed25519, vérifié par l’iframe sans appel réseau). null si la vente est fermée."}},"required":["id","domain","expiresAt","active","token"]},"WhiteLabelCheckoutRequest":{"type":"object","properties":{"domain":{"type":"string","minLength":3,"maxLength":300,"example":"exemple.fr","description":"Domaine du site (schéma, www et chemin ignorés)."},"startNow":{"type":"boolean","description":"Le client demande l’activation immédiate (art. L221-25 C. conso.) : obligatoire, horodaté."},"billing":{"type":"object","properties":{"company":{"type":"string","maxLength":200},"address":{"type":"string","maxLength":400,"description":"Une ligne par retour à la ligne."},"siren":{"type":"string","maxLength":20},"vatNumber":{"type":"string","maxLength":20}},"description":"Facture au nom d’une entreprise (facultatif)."}},"required":["domain","startNow"]},"AdminOrganizationPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminOrganizationSummary"}},"total":{"type":"integer"}},"required":["items","total"]},"AdminOrganizationSummary":{"allOf":[{"$ref":"#/components/schemas/AdminOrganization"},{"type":"object","properties":{"activeKeys":{"type":"integer"},"lastUsedAt":{"type":"string"},"monthCalls":{"type":"integer","description":"Mois en cours, clés live."},"monthMailings":{"type":"integer"},"monthAmountCents":{"type":"integer","description":"Consommation facturable du mois (tarif catalogue)."}},"required":["activeKeys","monthCalls","monthMailings","monthAmountCents"]}]},"AdminOrganization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"contactEmail":{"type":"string"},"siren":{"type":"string"},"notes":{"type":"string"},"stripeCustomerId":{"type":"string"},"createdAt":{"type":"string"},"status":{"type":"string","enum":["sandbox","review","live","suspended"]},"address":{"type":"string"},"vatNumber":{"type":"string"},"website":{"type":"string"},"useCase":{"type":"string"},"balanceCents":{"type":"integer","description":"Crédit prépayé restant, centimes HT."},"liveRequestedAt":{"type":"string"},"liveApprovedAt":{"type":"string"},"reviewNote":{"type":"string"}},"required":["id","name","createdAt","status","balanceCents"]},"AdminOrganizationDetail":{"type":"object","properties":{"organization":{"$ref":"#/components/schemas/AdminOrganization"},"keys":{"type":"array","items":{"$ref":"#/components/schemas/AdminApiKey"}},"usage":{"type":"array","items":{"$ref":"#/components/schemas/AdminUsageRow"},"description":"12 derniers mois, par mois (Europe/Paris), environnement et unité."},"shipments":{"type":"array","items":{"$ref":"#/components/schemas/AdminShipment"}},"requests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","kind","message","status","createdAt"]}},"audit":{"type":"array","items":{"$ref":"#/components/schemas/AdminAudit"}},"monthSpentCents":{"type":"integer"},"webhooks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"env":{"type":"string","enum":["live","test"]},"enabled":{"type":"boolean"},"events":{"type":"array","items":{"type":"string"}},"failureStreak":{"type":"integer"},"lastSuccessAt":{"type":"string"},"lastFailureAt":{"type":"string"}},"required":["id","url","env","enabled","events","failureStreak"]}},"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"lastStatusCode":{"type":"integer"},"lastError":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","eventType","status","attempts","createdAt"]}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["topup","adjustment"]},"status":{"type":"string","enum":["pending","paid","failed","void"]},"amountHtCents":{"type":"integer"},"vatCents":{"type":"integer"},"totalTtcCents":{"type":"integer"},"invoiceNumber":{"type":"string"},"hasInvoice":{"type":"boolean"},"note":{"type":"string"},"paidAt":{"type":"string"},"createdAt":{"type":"string"},"stripeInvoiceId":{"type":"string"}},"required":["id","kind","status","amountHtCents","vatCents","totalTtcCents","hasInvoice","createdAt"]},"description":"Recharges (factures Stripe) et ajustements, les plus récents d’abord."}},"required":["organization","keys","usage","shipments","requests","audit","monthSpentCents","webhooks","deliveries","credits"]},"AdminApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"env":{"type":"string","enum":["live","test"]},"createdAt":{"type":"string"},"lastUsedAt":{"type":"string"},"revokedAt":{"type":"string"}},"required":["id","name","prefix","env","createdAt"]},"AdminUsageRow":{"type":"object","properties":{"month":{"type":"string"},"env":{"type":"string","enum":["live","test"]},"unit":{"type":"string"},"calls":{"type":"integer"},"errors":{"type":"integer"},"quantity":{"type":"integer"},"amountCents":{"type":"integer"}},"required":["month","env","unit","calls","errors","quantity","amountCents"]},"AdminShipment":{"type":"object","properties":{"id":{"type":"string"},"orderId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"mode":{"$ref":"#/components/schemas/ShipmentMode"},"env":{"type":"string","enum":["live","test"]},"provider":{"type":"string"},"providerRef":{"type":"string"},"trackingNumber":{"type":"string"},"status":{"$ref":"#/components/schemas/ShipmentStatus"},"statusLabel":{"type":"string"},"title":{"type":"string"},"recipient":{"type":"array","items":{"type":"string"}},"recipientEmail":{"type":"string"},"priceCents":{"type":"integer"},"providerCostCents":{"type":"integer"},"marginCents":{"type":"integer","description":"Prix HT − coût prestataire − frais Stripe estimés."},"proofs":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/ProofKind"},"label":{"type":"string"}},"required":["kind","label"]}},"terminal":{"type":"boolean"},"lastSyncedAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","mode","env","provider","status","statusLabel","title","recipient","priceCents","proofs","terminal","createdAt"]},"AdminAudit":{"type":"object","properties":{"id":{"type":"string"},"adminId":{"type":["string","null"]},"adminEmail":{"type":"string"},"action":{"type":"string"},"targetType":{"type":"string"},"targetId":{"type":["string","null"]},"payload":{},"createdAt":{"type":"string"}},"required":["id","adminId","adminEmail","action","targetType","targetId","createdAt"]},"AdminOrganizationInput":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":200},"contactEmail":{"type":["string","null"],"format":"email"},"siren":{"type":["string","null"],"pattern":"^\\d{9}$"},"notes":{"type":["string","null"],"maxLength":2000}},"required":["name"]},"AdminOrganizationPatch":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":200},"contactEmail":{"type":["string","null"],"format":"email"},"siren":{"type":["string","null"],"pattern":"^\\d{9}$"},"notes":{"type":["string","null"],"maxLength":2000}}},"AdminCreatedApiKey":{"type":"object","properties":{"key":{"type":"string","description":"À transmettre au client : elle ne sera plus jamais affichée."},"apiKey":{"$ref":"#/components/schemas/AdminApiKey"}},"required":["key","apiKey"]},"AdminOrganizationReview":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","refuse","suspend","reactivate"]},"note":{"type":"string","maxLength":500}},"required":["decision"]},"AdminCreditAdjust":{"type":"object","properties":{"amountCents":{"type":"integer","minimum":-10000000,"maximum":10000000,"description":"Centimes HT ; négatif pour retirer du crédit."},"note":{"type":"string","minLength":3,"maxLength":500}},"required":["amountCents","note"]},"AdminCreditRefresh":{"type":"object","properties":{}},"AdminInvoiceLink":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]},"AdminB2bReviews":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminOrganization"}}},"required":["items"]},"AdminStatsOverview":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"totals":{"type":"object","additionalProperties":{"type":"number"},"description":"events, pageViews, sessions, visitors, uses, shares, sharedLandings, purchases, revenue (€), leads, pdfs, notFound."},"daily":{"type":"array","items":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}},"description":"Par jour (Paris) : pageViews, sessions, visitors, uses, shares, sharedLandings, purchases."},"hours":{"type":"array","items":{"type":"object","properties":{"hour":{"type":"integer"},"events":{"type":"integer"}},"required":["hour","events"]}},"tools":{"type":"array","items":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"null"}]}},"description":"Par outil (type:slug) : views, uses, sessions, shares, sharedLandings, shareOpens, pdfs, sends, purchases, leads, embedUses, lastAt."},"events":{"type":"object","additionalProperties":{"type":"number"}},"shareMethods":{"type":"object","additionalProperties":{"type":"number"}},"shareContents":{"type":"object","additionalProperties":{"type":"number"}},"sharedLandingSources":{"type":"object","additionalProperties":{"type":"number"}},"referrers":{"type":"object","additionalProperties":{"type":"number"}},"utmSources":{"type":"object","additionalProperties":{"type":"number"}},"platforms":{"type":"object","additionalProperties":{"type":"number"}},"devices":{"type":"object","additionalProperties":{"type":"number"}},"countries":{"type":"object","additionalProperties":{"type":"number"}},"searches":{"type":"object","properties":{"total":{"type":"integer"},"withResults":{"type":"integer"}},"required":["total","withResults"]},"notFound":{"type":"object","additionalProperties":{"type":"number"}},"letterFunnel":{"type":"object","additionalProperties":{"type":"number"}}},"required":["from","to","totals"]},"AdminStatsEventPage":{"type":"object","properties":{"total":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminStatsEvent"}}},"required":["total","items"]},"AdminStatsEvent":{"type":"object","properties":{"id":{"type":"integer"},"occurred_at":{"type":"string"},"event":{"type":"string"},"service":{"type":["string","null"]},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"path":{"type":["string","null"]},"referrer_host":{"type":["string","null"]},"utm_source":{"type":["string","null"]},"utm_medium":{"type":["string","null"]},"utm_campaign":{"type":["string","null"]},"shared_landing":{"type":"boolean"},"platform":{"type":"string"},"device":{"type":["string","null"]},"country":{"type":["string","null"]},"session_id":{"type":["string","null"]}},"required":["occurred_at","event","service","params","path","referrer_host","utm_source","utm_medium","utm_campaign","shared_landing","platform","device","country","session_id"]},"AdminSystem":{"type":"object","properties":{"nodeEnv":{"type":"string"},"repo":{"type":"string"},"payments":{"type":"string"},"postal":{"type":"string"},"postalMode":{"type":"string","enum":["live","test"]},"email":{"type":"string"},"ai":{"type":"string"},"search":{"type":"string"},"invoicing":{"type":"boolean"},"lreEnabled":{"type":"boolean"},"opsEmail":{"type":"string"},"webhooks":{"type":"object","properties":{"stripe":{"type":"string"},"postal":{"type":"string"}},"required":["stripe"]},"admin":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"}},"required":["id","email"]}},"required":["nodeEnv","repo","payments","postal","email","ai","search","invoicing","lreEnabled","opsEmail","webhooks","admin"]},"AdminDashboard":{"type":"object","properties":{"since":{"type":"string"},"revenueCents":{"type":"integer"},"revenueHtCents":{"type":"integer"},"refundedCents":{"type":"integer"},"grossMarginCents":{"type":"integer"},"ordersPaid":{"type":"integer"},"ordersByKind":{"type":"object","additionalProperties":{"type":"number"}},"ordersByMode":{"type":"object","additionalProperties":{"type":"number"}},"shipmentsByStatus":{"type":"object","additionalProperties":{"type":"number"}},"providerCostCents":{"type":"integer"},"incidents":{"type":"integer"},"usersTotal":{"type":"integer"},"usersNew":{"type":"integer"},"anonymousTotal":{"type":"integer"},"leadsNew":{"type":"integer"},"leadsPeriod":{"type":"integer"},"aiRunsPeriod":{"type":"integer"},"aiRunsFailedPeriod":{"type":"integer"},"messagesPeriod":{"type":"integer"},"requestsNew":{"type":"integer"},"b2b":{"type":"object","properties":{"organizations":{"type":"integer"},"activeOrganizations":{"type":"integer"},"calls":{"type":"integer"},"mailings":{"type":"integer"},"amountCents":{"type":"integer"}},"required":["organizations","activeOrganizations","calls","mailings","amountCents"]},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"revenueCents":{"type":"integer"},"orders":{"type":"integer"},"shipments":{"type":"integer"},"signups":{"type":"integer"}},"required":["day","revenueCents","orders","shipments","signups"]}}},"required":["since","revenueCents","revenueHtCents","refundedCents","grossMarginCents","ordersPaid","ordersByKind","ordersByMode","shipmentsByStatus","providerCostCents","incidents","usersTotal","usersNew","anonymousTotal","leadsNew","leadsPeriod","aiRunsPeriod","aiRunsFailedPeriod","messagesPeriod","requestsNew","b2b","days"]},"AdminFreshness":{"type":"object","properties":{"today":{"type":"string"},"total":{"type":"integer"},"stale":{"type":"array","items":{"type":"object","properties":{"file":{"type":"string"},"line":{"type":"integer"},"verified":{"type":"string"},"label":{"type":"string"},"source":{"type":"string"},"rule":{"type":"string"},"ruleLabel":{"type":"string"},"reasons":{"type":"array","items":{"type":"string"}},"next":{"type":"string"}},"required":["file","line","verified","label","reasons"]}},"soon":{"type":"array","items":{"type":"object","properties":{"file":{"type":"string"},"line":{"type":"integer"},"verified":{"type":"string"},"label":{"type":"string"},"source":{"type":"string"},"rule":{"type":"string"},"ruleLabel":{"type":"string"},"reasons":{"type":"array","items":{"type":"string"}},"next":{"type":"string"}},"required":["file","line","verified","label","reasons"]}}},"required":["today","total","stale","soon"]},"AdminPricing":{"type":"object","properties":{"provider":{"type":"string"},"modes":{"type":"array","items":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/ShipmentMode"},"label":{"type":"string"},"onSale":{"type":"boolean"},"priceCents":{"type":"integer"},"priceHtCents":{"type":"integer"},"stripeFeeCents":{"type":"integer"},"providerCostCents":{"type":"integer"},"postageCents":{"type":"integer"},"serviceCents":{"type":"integer"},"marginCents":{"type":"integer"},"error":{"type":"string"}},"required":["mode","label","onSale","priceCents","priceHtCents","stripeFeeCents"]}}},"required":["provider","modes"]},"AdminOrderPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminOrder"}},"total":{"type":"integer"}},"required":["items","total"]},"AdminOrder":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["delivery","white_label","ai_unit","ai_pack","plus"]},"status":{"type":"string","enum":["pending_payment","paid","fulfilled","failed","canceled","refunded"]},"mode":{"type":"string","enum":["pdf","simple","rec","ar","lre"]},"label":{"type":"string"},"amountCents":{"type":"integer"},"email":{"type":"string"},"userId":{"type":"string"},"letter":{"type":"string"},"provider":{"type":"string"},"recipientEmail":{"type":"string"},"paymentIntentId":{"type":"string"},"failureReason":{"type":"string"},"createdAt":{"type":"string"},"paidAt":{"type":"string"}},"required":["id","kind","status","label","amountCents","createdAt"]},"AdminOrderDetail":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/AdminOrder"},"document":{"$ref":"#/components/schemas/PlainLetter"},"shipment":{"$ref":"#/components/schemas/AdminShipment"},"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"kind":{"type":"string","enum":["invoice","credit_note"]},"totalTtcCents":{"type":"integer"},"issuedAt":{"type":"string"}},"required":["id","number","kind","totalTtcCents","issuedAt"]}},"withdrawal":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"declaredAt":{"type":"string"},"refundCents":{"type":"integer"},"shipmentCanceled":{"type":"boolean"}},"required":["name","declaredAt","refundCents","shipmentCanceled"],"description":"Rétractation déclarée en ligne par le client (preuve horodatée)."},"audit":{"type":"array","items":{"$ref":"#/components/schemas/AdminAudit"}}},"required":["order","invoices","audit"]},"AdminNote":{"type":"object","properties":{"note":{"type":"string","maxLength":500,"description":"Note facultative (journal d’audit)."}}},"AdminShipmentPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminShipment"}},"total":{"type":"integer"}},"required":["items","total"]},"AdminShipmentDetail":{"type":"object","properties":{"shipment":{"$ref":"#/components/schemas/AdminShipment"},"letter":{"$ref":"#/components/schemas/PlainLetter"},"events":{"type":"array","items":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/ShipmentStatus"},"label":{"type":"string"},"at":{"type":"string"},"raw":{}},"required":["status","label","at"]}},"audit":{"type":"array","items":{"$ref":"#/components/schemas/AdminAudit"}}},"required":["shipment","letter","events","audit"]},"AdminUserPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminUser"}},"total":{"type":"integer"}},"required":["items","total"]},"AdminUser":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"displayName":{"type":"string"},"isAnonymous":{"type":"boolean"},"stripeCustomerId":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","isAnonymous","createdAt"]},"AdminUserDetail":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/AdminUser"},"credits":{"type":"integer"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/AdminOrder"}},"shipments":{"type":"array","items":{"$ref":"#/components/schemas/AdminShipment"}},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","title","createdAt"]}},"whiteLabel":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"expiresAt":{"type":"string","description":"Absente : jamais payée."},"createdAt":{"type":"string"}},"required":["id","domain","createdAt"]},"description":"Licences marque blanche."},"audit":{"type":"array","items":{"$ref":"#/components/schemas/AdminAudit"}}},"required":["user","credits","orders","shipments","documents","whiteLabel","audit"]},"AdminLeadPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminLead"}},"total":{"type":"integer"}},"required":["items","total"]},"AdminLead":{"type":"object","properties":{"id":{"type":"string"},"sourceKind":{"type":"string"},"service":{"type":"string"},"offer":{"type":"string"},"vertical":{"type":"string"},"trade":{"type":["string","null"]},"values":{"type":"object","additionalProperties":{"type":"string"}},"qualification":{"type":"object","additionalProperties":{"type":"string"}},"estimateLow":{"type":["number","null"]},"estimateHigh":{"type":["number","null"]},"contact":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"postcode":{"type":"string"},"city":{"type":"string"}},"required":["name","email"]},"phoneRule":{"type":"string"},"callbackBefore":{"type":["string","null"]},"lastContactAt":{"type":"string"},"status":{"type":"string","enum":["new","qualified","routed","accepted","returned","won"]},"createdAt":{"type":"string"}},"required":["id","sourceKind","service","offer","vertical","trade","values","qualification","estimateLow","estimateHigh","contact","phoneRule","callbackBefore","lastContactAt","status","createdAt"]},"AdminMessagePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminMessage"}},"total":{"type":"integer"}},"required":["items","total"]},"AdminMessage":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"},"subject":{"type":["string","null"]},"message":{"type":"string"},"userId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","name","email","subject","message","userId","createdAt"]},"AdminRequestPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminServiceRequest"}},"total":{"type":"integer"}},"required":["items","total"]},"AdminServiceRequest":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"message":{"type":"string"},"query":{"type":["string","null"]},"source":{"type":["string","null"]},"email":{"type":["string","null"]},"organizationId":{"type":["string","null"]},"status":{"type":"string","enum":["new","planned","done","rejected"]},"createdAt":{"type":"string"}},"required":["id","kind","message","query","source","email","organizationId","status","createdAt"]},"DeveloperAccount":{"type":"object","properties":{"organization":{"$ref":"#/components/schemas/DeveloperOrganization"},"role":{"type":"string","enum":["owner","admin","member"]},"keys":{"type":"array","items":{"$ref":"#/components/schemas/DeveloperApiKey"}},"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/DeveloperWebhook"}},"month":{"type":"object","properties":{"spentCents":{"type":"integer"}},"required":["spentCents"],"description":"Consommation HT du mois en cours (clés live), débitée du crédit."},"limits":{"$ref":"#/components/schemas/DeveloperLimits"},"credit":{"$ref":"#/components/schemas/DeveloperCreditRules"}},"required":["organization","limits","credit"]},"DeveloperOrganization":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["sandbox","review","live","suspended"],"description":"sandbox : clés test ; review : production demandée ; live ; suspended."},"contactEmail":{"type":"string"},"siren":{"type":"string"},"address":{"type":"string"},"vatNumber":{"type":"string"},"website":{"type":"string"},"useCase":{"type":"string"},"balanceCents":{"type":"integer","description":"Crédit prépayé restant, centimes HT."},"liveRequestedAt":{"type":"string"},"liveApprovedAt":{"type":"string"},"reviewNote":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","status","balanceCents","createdAt"]},"DeveloperApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"env":{"type":"string","enum":["live","test"]},"createdAt":{"type":"string"},"lastUsedAt":{"type":"string"},"revokedAt":{"type":"string"}},"required":["id","name","prefix","env","createdAt"]},"DeveloperWebhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"},"description":"Vide : tous les événements."},"env":{"type":"string","enum":["live","test"]},"enabled":{"type":"boolean"},"failureStreak":{"type":"integer"},"lastSuccessAt":{"type":"string"},"lastFailureAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","url","events","env","enabled","failureStreak","createdAt"]},"DeveloperLimits":{"type":"object","properties":{"testCallsPerDay":{"type":"integer"},"testKeysMax":{"type":"integer"},"liveKeysMax":{"type":"integer"},"webhooksMax":{"type":"integer"},"ratePerMinute":{"type":"integer"}},"required":["testCallsPerDay","testKeysMax","liveKeysMax","webhooksMax","ratePerMinute"]},"DeveloperCreditRules":{"type":"object","properties":{"presetsHtCents":{"type":"array","items":{"type":"integer"},"description":"Montants proposés (centimes HT)."},"minHtCents":{"type":"integer"},"maxHtCents":{"type":"integer"},"lowBalanceHtCents":{"type":"integer","description":"Seuil de l’e-mail d’alerte de solde bas."}},"required":["presetsHtCents","minHtCents","maxHtCents","lowBalanceHtCents"]},"DeveloperCreatedAccount":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/DeveloperAccount"},"key":{"type":"string"}},"required":["account","key"]},"DeveloperCreateAccount":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":200},"website":{"type":"string","maxLength":300,"format":"uri"},"useCase":{"type":"string","maxLength":1000}},"required":["name"]},"DeveloperUpdateOrganization":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":200},"contactEmail":{"type":"string","format":"email"},"website":{"type":["string","null"],"maxLength":300,"format":"uri"},"useCase":{"type":["string","null"],"maxLength":1000},"address":{"type":["string","null"],"maxLength":300},"vatNumber":{"type":["string","null"],"maxLength":20}}},"DeveloperCreatedKey":{"type":"object","properties":{"key":{"type":"string","description":"Clé complète : affichée une seule fois."},"apiKey":{"$ref":"#/components/schemas/DeveloperApiKey"}},"required":["key","apiKey"]},"DeveloperCreateKey":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":100},"env":{"type":"string","enum":["live","test"]}},"required":["name","env"]},"DeveloperEmpty":{"type":"object","properties":{}},"DeveloperTopUp":{"type":"object","properties":{"creditId":{"type":"string"},"clientSecret":{"type":"string"},"publishableKey":{"type":"string"},"amountHtCents":{"type":"integer"},"vatCents":{"type":"integer"},"totalTtcCents":{"type":"integer"}},"required":["creditId","clientSecret","amountHtCents","vatCents","totalTtcCents"]},"DeveloperTopUpRequest":{"type":"object","properties":{"amountHtCents":{"type":"integer","description":"Montant HT à créditer (5 € au moins) ; la TVA s’ajoute au paiement.","example":5000}},"required":["amountHtCents"]},"DeveloperTopUpConfirm":{"type":"object","properties":{}},"DeveloperCredits":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DeveloperCredit"}}},"required":["items"]},"DeveloperCredit":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["topup","adjustment"],"description":"topup : recharge par carte ; adjustment : ajustement par l’équipe vitef."},"status":{"type":"string","enum":["pending","paid","failed","void"]},"amountHtCents":{"type":"integer","description":"Crédité au solde (négatif pour un ajustement à la baisse)."},"vatCents":{"type":"integer"},"totalTtcCents":{"type":"integer"},"invoiceNumber":{"type":"string"},"hasInvoice":{"type":"boolean","description":"Facture Stripe téléchargeable (recharge payée)."},"note":{"type":"string"},"paidAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","kind","status","amountHtCents","vatCents","totalTtcCents","hasInvoice","createdAt"]},"DeveloperInvoiceLink":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]},"DeveloperLiveRequest":{"type":"object","properties":{"siren":{"type":"string","minLength":9,"maxLength":11},"address":{"type":"string","minLength":8,"maxLength":300},"vatNumber":{"type":"string","maxLength":20},"contactEmail":{"type":"string","format":"email"},"useCase":{"type":"string","minLength":20,"maxLength":1000,"description":"Usage prévu : volumes, types de lettres, destinataires."}},"required":["siren","address","contactEmail","useCase"]},"DeveloperMailings":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Shipment"}}},"required":["items"]},"DeveloperUsage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DeveloperUsageRow"}}},"required":["items"]},"DeveloperUsageRow":{"type":"object","properties":{"month":{"type":"string"},"env":{"type":"string","enum":["live","test"]},"unit":{"type":"string"},"calls":{"type":"integer"},"errors":{"type":"integer"},"quantity":{"type":"integer"},"amountCents":{"type":"integer"}},"required":["month","env","unit","calls","errors","quantity","amountCents"]},"DeveloperCreatedWebhook":{"type":"object","properties":{"secret":{"type":"string"},"webhook":{"$ref":"#/components/schemas/DeveloperWebhook"}},"required":["secret","webhook"]},"DeveloperCreateWebhook":{"type":"object","properties":{"url":{"type":"string","maxLength":500,"format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["mailing.created","mailing.printed","mailing.posted","mailing.in_transit","mailing.delivered","mailing.ar_signed","mailing.returned","mailing.error","mailing.canceled","mailing.proof_available"]},"default":[]},"env":{"type":"string","enum":["live","test"],"default":"live"}},"required":["url"]},"DeveloperUpdateWebhook":{"type":"object","properties":{"enabled":{"type":"boolean"},"events":{"type":"array","items":{"type":"string","enum":["mailing.created","mailing.printed","mailing.posted","mailing.in_transit","mailing.delivered","mailing.ar_signed","mailing.returned","mailing.error","mailing.canceled","mailing.proof_available"]}}}},"DeveloperDeleteWebhook":{"type":"object","properties":{}},"DeveloperPing":{"type":"object","properties":{"eventId":{"type":"string"}},"required":["eventId"]},"DeveloperPingWebhook":{"type":"object","properties":{}},"DeveloperWebhookDeliveries":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DeveloperWebhookDelivery"}}},"required":["items"]},"DeveloperWebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"eventType":{"type":"string"},"status":{"type":"string","enum":["pending","sending","succeeded","failed"]},"attempts":{"type":"integer"},"lastStatusCode":{"type":"integer"},"lastError":{"type":"string"},"createdAt":{"type":"string"},"deliveredAt":{"type":"string"},"nextAttemptAt":{"type":"string"}},"required":["id","eventId","eventType","status","attempts","createdAt"]}},"parameters":{}},"paths":{"/health":{"get":{"operationId":"health","summary":"État du service (sonde Kubernetes) et fournisseurs actifs (réels ou simulés)","tags":["Système"],"responses":{"200":{"description":"Service opérationnel","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}},"/webhooks/stripe":{"post":{"operationId":"stripeWebhook","summary":"Événements Stripe (paiements, remboursements, factures de crédit B2B) — signature stripe-signature","tags":["Webhooks"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"stripe-signature","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeEvent"}}}},"responses":{"200":{"description":"Reçu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookReceived"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/webhooks/mysendingbox":{"post":{"operationId":"mySendingBoxWebhook","summary":"Événements MySendingBox (impression, dépôt, distribution, AR, retour) — jeton ?token= ; état relu par GET /letters/{id}","tags":["Webhooks"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"token","in":"query"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MySendingBoxWebhook"}}}},"responses":{"200":{"description":"Reçu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookReceived"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/webhooks/merci-facteur":{"post":{"operationId":"merciFacteurWebhook","summary":"Événements Merci Facteur (impression, dépôt, distribution, AR) — en-tête X-Mf-Webhook-Secret-Key","tags":["Webhooks"],"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/MerciFacteurWebhookForm"}},"application/json":{"schema":{"$ref":"#/components/schemas/MerciFacteurWebhookJson"}}}},"responses":{"200":{"description":"Reçu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookReceived"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/catalogue":{"get":{"operationId":"v1GetCatalogue","summary":"Catalogue complet : catégories, lettres (fournisseurs, champs), calculateurs, outils IA, devis, tarifs","description":"Réponse mise en cache côté client : en-têtes ETag et Cache-Control ; renvoyez If-None-Match pour obtenir 304.","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"if-none-match","in":"header"}],"responses":{"200":{"description":"Catalogue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalogue"}}}},"304":{"description":"Non modifié"},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/letters/{slug}":{"get":{"operationId":"v1GetLetter","summary":"Détail d’une lettre (champs exacts pour un fournisseur donné)","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":80},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string"},"required":false,"name":"provider","in":"query"}],"responses":{"200":{"description":"Lettre","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LetterDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/letters/{slug}/render":{"post":{"operationId":"v1RenderLetter","summary":"Rendu d’une lettre : document structuré (segments avec champs à compléter), texte, champs manquants","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":80},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LetterRenderRequest"}}}},"responses":{"200":{"description":"Lettre rendue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LetterRender"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/calculators/{slug}/compute":{"post":{"operationId":"v1Compute","summary":"Exécute un calculateur (valeurs par défaut complétées ; distance calculée par itinéraire et prix moyen du carburant du jour si le calculateur en a)","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":80},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComputeRequest"}}}},"responses":{"200":{"description":"Résultat","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalculatorResult"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/quotes/{slug}/estimate":{"post":{"operationId":"v1EstimateQuote","summary":"Estimation d’un devis (itinéraire routier calculé si le service en a un)","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":80},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteEstimateRequest"}}}},"responses":{"200":{"description":"Estimation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteEstimate"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/search":{"get":{"operationId":"v1Search","summary":"Recherche dans le catalogue, en mots-clés ou en langage naturel","description":"Recherche hybride : mots-clés et alias (instantané) fusionnés avec une recherche sémantique (« mon propriétaire garde ma caution » → dépôt de garantie). Le sémantique n’intervient que si la requête le justifie (aucun résultat par mots-clés, ou 3 mots et plus) ; en cas d’indisponibilité, la réponse reste lexicale (`mode: lexical`).","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":8},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["hybrid","lexical"],"default":"hybrid","description":"`lexical` : mots-clés seuls (sans appel au moteur sémantique)."},"required":false,"description":"`lexical` : mots-clés seuls (sans appel au moteur sémantique).","name":"mode","in":"query"}],"responses":{"200":{"description":"Résultats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResults"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/letters/{slug}/pdf":{"post":{"operationId":"v1LetterPdf","summary":"PDF d’une lettre complète (A4)","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":80},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LetterRenderRequest"}}}},"responses":{"200":{"description":"Fichier PDF","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/mailings":{"post":{"operationId":"v1CreateMailing","summary":"Envoi postal d’une lettre (catalogue ou libre). Clé vf_test_ : simulé, non facturé.","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailingRequest"}}}},"responses":{"201":{"description":"Envoi créé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Shipment"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/mailings/{id}":{"get":{"operationId":"v1GetMailing","summary":"Suivi d’un envoi postal","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Envoi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Shipment"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/mailings/{id}/proofs/{kind}":{"get":{"operationId":"v1GetMailingProof","summary":"Lien de téléchargement d’une preuve (dépôt, accusé de réception…), valable quelques minutes","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"$ref":"#/components/schemas/ProofKind"},"required":true,"name":"kind","in":"path"}],"responses":{"200":{"description":"Preuve","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProofLink"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/test/mailings/{id}/advance":{"post":{"operationId":"v1TestAdvanceMailing","summary":"Bac à sable (clé vf_test_ seulement) : fait passer un envoi de test à l’étape suivante, ou à l’étape demandée","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1TestAdvance"}}}},"responses":{"200":{"description":"Envoi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Shipment"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/companies":{"get":{"operationId":"v1SearchCompanies","summary":"Recherche d’entreprise dans l’annuaire SIRENE (nom, enseigne, SIREN ou SIRET)","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":200,"description":"Nom, enseigne, SIREN ou SIRET."},"required":true,"description":"Nom, enseigne, SIREN ou SIRET.","name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":10,"default":5},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["active","all"],"default":"active","description":"`all` : établissements fermés compris."},"required":false,"description":"`all` : établissements fermés compris.","name":"status","in":"query"}],"responses":{"200":{"description":"Entreprises","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResults"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/companies/{siret}":{"get":{"operationId":"v1GetCompany","summary":"Fiche d’un établissement : statut, entreprise, siège social, activité, effectif, fraîcheur des données","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^\\d{14}$","example":"39315281200029"},"required":true,"name":"siret","in":"path"}],"responses":{"200":{"description":"Fiche entreprise","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyProfile"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/fuel/prices":{"get":{"operationId":"v1GetFuelPrices","summary":"Prix moyens du jour par carburant, en France et dans un département (prix-carburants.gouv.fr)","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^(\\d{2,3}|2[AB])$","description":"Département (69, 2A, 974) : ajoute ses moyennes à celles de la France."},"required":false,"description":"Département (69, 2A, 974) : ajoute ses moyennes à celles de la France.","name":"department","in":"query"}],"responses":{"200":{"description":"Prix moyens","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FuelPrices"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/fuel/stations":{"get":{"operationId":"v1SearchFuelStations","summary":"Stations-service les moins chères autour d’un point ou dans une commune","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","enum":["gazole","sp95-e10","sp98","e85","gplc"],"default":"gazole"},"required":false,"name":"fuel","in":"query"},{"schema":{"type":["number","null"],"minimum":-90,"maximum":90},"required":false,"name":"lat","in":"query"},{"schema":{"type":["number","null"],"minimum":-180,"maximum":180},"required":false,"name":"lon","in":"query"},{"schema":{"type":"string","pattern":"^(\\d{5}|2[AB]\\d{3})$","description":"Code commune INSEE (Lyon : 69123). Avec `lat`/`lon` (centre), élargit autour si la commune a moins de 3 stations."},"required":false,"description":"Code commune INSEE (Lyon : 69123). Avec `lat`/`lon` (centre), élargit autour si la commune a moins de 3 stations.","name":"insee","in":"query"},{"schema":{"type":"number","minimum":1,"maximum":30,"default":10},"required":false,"name":"radiusKm","in":"query"},{"schema":{"type":"string","enum":["price","distance"],"default":"price","description":"`price` : les moins chères d’abord, puis les plus proches."},"required":false,"description":"`price` : les moins chères d’abord, puis les plus proches.","name":"sort","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Stations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FuelStations"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/geo/address":{"get":{"operationId":"v1SearchAddress","summary":"Autocomplétion et géocodage d’adresse (base adresse nationale)","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":200},"required":true,"name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":10,"default":5},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Adresses","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddressResults"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/geo/city":{"get":{"operationId":"v1SearchCity","summary":"Commune par code postal ou par nom (base adresse nationale)","description":"Un code postal à 5 chiffres renvoie toutes les communes qui le partagent. Le `label` (« 69003 Lyon ») est la valeur attendue dans le champ `commune` d’un devis ou d’un calculateur.","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":2,"maxLength":100},"required":true,"name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":20,"default":8},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Communes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CityResults"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/route":{"get":{"operationId":"v1ComputeRoute","summary":"Itinéraire routier en voiture : distance et durée entre deux adresses ou coordonnées","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":300,"example":"12 rue des Lilas, 69003 Lyon","description":"Adresse (géocodée par Addok) ou « lon,lat »."},"required":true,"description":"Adresse (géocodée par Addok) ou « lon,lat ».","name":"from","in":"query"},{"schema":{"type":"string","minLength":3,"maxLength":300,"example":"2.3674,48.8656"},"required":true,"name":"to","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false","description":"`true` : ajoute le tracé simplifié de l’itinéraire (pour une carte)."},"required":false,"description":"`true` : ajoute le tracé simplifié de l’itinéraire (pour une carte).","name":"geometry","in":"query"}],"responses":{"200":{"description":"Itinéraire","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteResult"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/expenses/settle":{"post":{"operationId":"v1SettleExpenses","summary":"Partage de dépenses : qui doit combien à qui (soldes et remboursements en nombre minimal)","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseGroup"}}}},"responses":{"200":{"description":"Répartition","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Settlement"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ai/tools/{slug}":{"post":{"operationId":"v1AiTool","summary":"Outil IA du catalogue (facturé à l’usage ; simulé avec une clé vf_test_)","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":80},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiToolRequest"}}}},"responses":{"200":{"description":"Texte généré","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1AiToolResult"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ai/fill":{"post":{"operationId":"v1AiFill","summary":"Remplit les champs d’une lettre à partir d’une phrase (facturé à l’usage)","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiFillRequest"}}}},"responses":{"200":{"description":"Valeurs extraites","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1AiFillResult"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ai/letter":{"post":{"operationId":"v1AiLetter","summary":"Rédige une lettre sur mesure (facturé à l’usage)","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiLetterRequest"}}}},"responses":{"200":{"description":"Lettre rédigée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1AiLetterResult"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Crédits ou paiement requis","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/requests":{"post":{"operationId":"v1CreateServiceRequest","summary":"Demande un service absent du catalogue (lettre, calculateur, outil IA) pour votre organisation (gratuit)","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceRequestInput"}}}},"responses":{"201":{"description":"Demande enregistrée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceRequest"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"operationId":"v1ListServiceRequests","summary":"Demandes de service de votre organisation et leur statut (gratuit)","tags":["B2B (v1)"],"security":[{"apiKey":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Demandes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceRequestList"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/tracking/{number}":{"get":{"operationId":"trackShipment","summary":"Suivi public d’un envoi par numéro (sans destinataire ni contenu)","tags":["Application (public)"],"parameters":[{"schema":{"type":"string","minLength":6,"maxLength":40},"required":true,"name":"number","in":"path"}],"responses":{"200":{"description":"Suivi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tracking"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/geo/address":{"get":{"operationId":"searchAddress","summary":"Autocomplétion d’adresse (Addok, base adresse nationale)","tags":["Application (public)"],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":200},"required":true,"name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":10,"default":5},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Adresses","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddressResults"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/geo/city":{"get":{"operationId":"searchCity","summary":"Recherche de commune (Addok, base adresse nationale) par code postal ou par nom","description":"Un code postal à 5 chiffres renvoie toutes les communes qui le partagent. Le `label` (« 69003 Lyon ») est la valeur attendue dans le champ `commune` d’un devis.","tags":["Application (public)"],"parameters":[{"schema":{"type":"string","minLength":2,"maxLength":100},"required":true,"name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":20,"default":8},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Communes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CityResults"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/companies":{"get":{"operationId":"searchCompanies","summary":"Recherche d’entreprise (annuaire SIRENE) : destinataire d’une lettre, vérification d’une entreprise","tags":["Application (public)"],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":200,"description":"Nom, enseigne, SIREN ou SIRET."},"required":true,"description":"Nom, enseigne, SIREN ou SIRET.","name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":10,"default":5},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["active","all"],"default":"active","description":"`all` : établissements fermés compris."},"required":false,"description":"`all` : établissements fermés compris.","name":"status","in":"query"}],"responses":{"200":{"description":"Entreprises","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResults"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/companies/{siret}":{"get":{"operationId":"getCompany","summary":"Fiche d’un établissement : statut, entreprise, siège social, activité, effectif, fraîcheur des données","tags":["Application (public)"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{14}$","example":"39315281200029"},"required":true,"name":"siret","in":"path"}],"responses":{"200":{"description":"Fiche entreprise","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyProfile"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/route":{"get":{"operationId":"computeRoute","summary":"Itinéraire routier (OSRM France, voiture) entre deux adresses ou coordonnées « lon,lat »","tags":["Application (public)"],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":300,"example":"12 rue des Lilas, 69003 Lyon","description":"Adresse (géocodée par Addok) ou « lon,lat »."},"required":true,"description":"Adresse (géocodée par Addok) ou « lon,lat ».","name":"from","in":"query"},{"schema":{"type":"string","minLength":3,"maxLength":300,"example":"2.3674,48.8656"},"required":true,"name":"to","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false","description":"`true` : ajoute le tracé simplifié de l’itinéraire (pour une carte)."},"required":false,"description":"`true` : ajoute le tracé simplifié de l’itinéraire (pour une carte).","name":"geometry","in":"query"}],"responses":{"200":{"description":"Itinéraire","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteResult"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/fuel/prices":{"get":{"operationId":"getFuelPrices","summary":"Prix moyens du jour par carburant, en France et dans un département (prix-carburants.gouv.fr)","tags":["Application (public)"],"parameters":[{"schema":{"type":"string","pattern":"^(\\d{2,3}|2[AB])$","description":"Département (69, 2A, 974) : ajoute ses moyennes à celles de la France."},"required":false,"description":"Département (69, 2A, 974) : ajoute ses moyennes à celles de la France.","name":"department","in":"query"}],"responses":{"200":{"description":"Prix moyens","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FuelPrices"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/fuel/stations":{"get":{"operationId":"searchFuelStations","summary":"Stations-service les moins chères autour d’un point ou dans une commune","tags":["Application (public)"],"parameters":[{"schema":{"type":"string","enum":["gazole","sp95-e10","sp98","e85","gplc"],"default":"gazole"},"required":false,"name":"fuel","in":"query"},{"schema":{"type":["number","null"],"minimum":-90,"maximum":90},"required":false,"name":"lat","in":"query"},{"schema":{"type":["number","null"],"minimum":-180,"maximum":180},"required":false,"name":"lon","in":"query"},{"schema":{"type":"string","pattern":"^(\\d{5}|2[AB]\\d{3})$","description":"Code commune INSEE (Lyon : 69123). Avec `lat`/`lon` (centre), élargit autour si la commune a moins de 3 stations."},"required":false,"description":"Code commune INSEE (Lyon : 69123). Avec `lat`/`lon` (centre), élargit autour si la commune a moins de 3 stations.","name":"insee","in":"query"},{"schema":{"type":"number","minimum":1,"maximum":30,"default":10},"required":false,"name":"radiusKm","in":"query"},{"schema":{"type":"string","enum":["price","distance"],"default":"price","description":"`price` : les moins chères d’abord, puis les plus proches."},"required":false,"description":"`price` : les moins chères d’abord, puis les plus proches.","name":"sort","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Stations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FuelStations"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/leads":{"post":{"operationId":"createLead","summary":"Demande de mise en relation (devis, calculateur, lettre, outil IA) : consentement par canal, preuve conservée","description":"Aucun partenaire n’est signé : la demande est collectée pour vitef, qui recontacte la personne ; aucune transmission sans un nouvel accord pour un professionnel nommé. Dédoublonnage : même e-mail ou téléphone et même vertical sur 30 jours → `duplicate: true` (la preuve du nouvel accord est gardée). Compatibilité : `service` + `consent: true` (anciens clients) valent `source: { kind: quote }` et le texte de consentement de 2026-09-23. Devis : la localisation est obligatoire, champ `commune` (« 69003 Lyon », cf. `GET /app/geo/city`) ou les deux adresses d’un devis à itinéraire, vérifiée dans la base adresse nationale (422 sinon).","tags":["Application (public)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadRequest"}}}},"responses":{"201":{"description":"Demande enregistrée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadCreated"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/events":{"post":{"operationId":"recordOfferEvent","summary":"Mesure d’une offre « Et maintenant ? » (affichage, clic), sans donnée personnelle","tags":["Application (public)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferEventRequest"}}}},"responses":{"202":{"description":"Enregistré","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/stats":{"post":{"operationId":"recordStats","summary":"Statistiques d’utilisation anonymes (site, calculateurs intégrés, app), par lots","description":"Mesure d’audience exemptée de consentement : liste fermée d’événements (catalogue, stats.ts), paramètres filtrés, chemin nettoyé, aucune IP conservée (pays seul). Identifiants de visiteur et de session aléatoires.","tags":["Application (public)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsBatch"}}}},"responses":{"202":{"description":"Enregistré","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsRecorded"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/contact":{"post":{"operationId":"contact","summary":"Message au support (JWT facultatif)","tags":["Application (public)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactRequest"}}}},"responses":{"201":{"description":"Message reçu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/requests":{"post":{"operationId":"createServiceRequest","summary":"Demande d’un service absent du catalogue (lettre, calculateur, outil IA) ; JWT facultatif","tags":["Application (public)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceRequestInput"}}}},"responses":{"201":{"description":"Demande enregistrée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceRequest"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/search-misses":{"post":{"operationId":"recordSearchMiss","summary":"Signale une recherche sans résultat (sert à prioriser les services à créer)","tags":["Application (public)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchMissInput"}}}},"responses":{"202":{"description":"Pris en compte","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/me":{"get":{"operationId":"getMe","summary":"Profil et quota IA du jour","tags":["Application"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Profil","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"updateMe","summary":"Met à jour le nom affiché et l’expéditeur par défaut","tags":["Application"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMeRequest"}}}},"responses":{"200":{"description":"Profil","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"deleteMe","summary":"Supprime le compte et efface les données personnelles (seules les factures sont conservées, 10 ans, obligation légale)","tags":["Application"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Compte supprimé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/me/export":{"get":{"operationId":"exportMe","summary":"Exporte toutes les données personnelles du compte (RGPD : droit d’accès et portabilité)","description":"Profil, documents, commandes, envois et leur suivi, factures, crédits et historique IA, demandes de mise en relation et preuves de consentement, messages et demandes de service. JSON lisible par machine.","tags":["Application"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Données du compte","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountExport"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/me/claim":{"post":{"operationId":"claimAnonymous","summary":"Rattache au compte connecté les commandes, documents et crédits d’une session anonyme","tags":["Application"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRequest"}}}},"responses":{"200":{"description":"Données rattachées","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimResult"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/documents":{"post":{"operationId":"createDocument","summary":"Enregistre une lettre dans l’espace (catalogue ou libre)","tags":["Application"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDocumentRequest"}}}},"responses":{"201":{"description":"Document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentItem"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"operationId":"listDocuments","summary":"Lettres enregistrées","tags":["Application"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Documents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentList"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/pdf":{"post":{"operationId":"downloadPdf","summary":"Télécharge le PDF d’une lettre complète (gratuit avec un compte) et l’enregistre dans l’espace","description":"Compte identifié obligatoire : une session anonyme reçoit 403 `login_required`.","tags":["Application"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfRequest"}}}},"responses":{"200":{"description":"Fichier PDF","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/orders":{"post":{"operationId":"createOrder","summary":"Commande d’une livraison (pdf gratuit par e-mail, simple, recommandé, AR) ; crée le paiement si nécessaire","tags":["Application"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"201":{"description":"Commande créée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Checkout"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"operationId":"listOrders","summary":"Commandes de l’utilisateur","tags":["Application"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Commandes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderList"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/orders/{id}":{"get":{"operationId":"getOrder","summary":"Commande (avec envoi et lettre) — page de confirmation","tags":["Application"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Commande","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/ai/fill":{"post":{"operationId":"aiFill","summary":"Remplir en une phrase : extrait les champs d’une lettre (compte identifié, quota quotidien)","tags":["Application"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppAiFillRequest"}}}},"responses":{"200":{"description":"Valeurs extraites","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiFillResult"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Service indisponible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/ai/letter":{"post":{"operationId":"aiLetter","summary":"Lettre sur mesure rédigée par l’IA (compte identifié, quota quotidien)","tags":["Application"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppAiLetterRequest"}}}},"responses":{"200":{"description":"Lettre rédigée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiLetterResult"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Service indisponible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/ai/tools/{slug}":{"post":{"operationId":"aiTool","summary":"Outil IA du catalogue (compte identifié, quota quotidien)","tags":["Application"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":80},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppAiToolRequest"}}}},"responses":{"200":{"description":"Texte généré","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiToolResult"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Service indisponible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/shipments":{"get":{"operationId":"listShipments","summary":"Envois postaux de l’utilisateur","tags":["Application"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Envois","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentList"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/shipments/{id}":{"get":{"operationId":"getShipment","summary":"Suivi détaillé d’un envoi","tags":["Application"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Envoi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Shipment"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/shipments/{id}/proofs/{kind}":{"get":{"operationId":"getShipmentProof","summary":"Lien de téléchargement d’une preuve (dépôt, accusé de réception…), valable quelques minutes","tags":["Application"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"$ref":"#/components/schemas/ProofKind"},"required":true,"name":"kind","in":"path"}],"responses":{"200":{"description":"Preuve","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProofLink"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/invoices":{"get":{"operationId":"listInvoices","summary":"Factures et avoirs de l’utilisateur","tags":["Application"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Factures","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceList"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/invoices/{id}/pdf":{"get":{"operationId":"downloadInvoice","summary":"PDF d’une facture ou d’un avoir (lien signé reçu par e-mail ou dans l’espace client)","tags":["Application"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":64,"description":"Jeton du lien signé."},"required":true,"description":"Jeton du lien signé.","name":"t","in":"query"}],"responses":{"200":{"description":"Fichier PDF","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/orders/{id}/withdrawal":{"get":{"operationId":"getWithdrawal","summary":"Rétractation d’une commande : possible ou non, délai, remboursement","tags":["Application"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":64,"description":"Jeton du lien signé (reçu par e-mail). Sans jeton : JWT du compte de la commande."},"required":false,"description":"Jeton du lien signé (reçu par e-mail). Sans jeton : JWT du compte de la commande.","name":"t","in":"query"}],"responses":{"200":{"description":"État de la rétractation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Withdrawal"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"declareWithdrawal","summary":"Confirmer la rétractation (annule l’envoi non posté, rembourse, accusé de réception horodaté par e-mail)","tags":["Application"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":64,"description":"Jeton du lien signé (reçu par e-mail). Sans jeton : JWT du compte de la commande."},"required":false,"description":"Jeton du lien signé (reçu par e-mail). Sans jeton : JWT du compte de la commande.","name":"t","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawalRequest"}}}},"responses":{"200":{"description":"Rétractation enregistrée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Withdrawal"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/white-label":{"get":{"operationId":"listWhiteLabel","summary":"Licences marque blanche du compte (domaine, échéance, jeton)","tags":["Marque blanche"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Licences","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhiteLabelLicenses"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/white-label/checkout":{"post":{"operationId":"createWhiteLabelCheckout","summary":"Achat ou prolongation (12 mois) d’une licence marque blanche pour un domaine","tags":["Marque blanche"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhiteLabelCheckoutRequest"}}}},"responses":{"201":{"description":"Commande créée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Checkout"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Service indisponible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/b2b/organizations":{"get":{"operationId":"adminListOrganizations","summary":"Clients B2B et leur consommation du mois","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"kind","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Clients","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrganizationPage"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"adminCreateOrganization","summary":"Crée un client B2B","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrganizationInput"}}}},"responses":{"201":{"description":"Client","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrganizationDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/b2b/organizations/{id}":{"get":{"operationId":"adminGetOrganization","summary":"Fiche client : clés, consommation par mois, envois, demandes, journal","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Client","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrganizationDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"adminUpdateOrganization","summary":"Modifie la fiche client","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrganizationPatch"}}}},"responses":{"200":{"description":"Client","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrganizationDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/b2b/organizations/{id}/suspend":{"post":{"operationId":"adminSuspendOrganization","summary":"Suspend le client : toutes ses clés actives sont révoquées","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500,"description":"Motif (journal d’audit)."}},"required":["reason"]}}}},"responses":{"200":{"description":"Client","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrganizationDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/b2b/organizations/{id}/keys":{"post":{"operationId":"adminCreateApiKey","summary":"Crée une clé d’API ; la valeur complète n’est renvoyée qu’une fois","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":100},"env":{"type":"string","enum":["live","test"]}},"required":["name","env"]}}}},"responses":{"201":{"description":"Clé créée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreatedApiKey"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/b2b/organizations/{id}/review":{"post":{"operationId":"adminReviewOrganization","summary":"Ouvre la production, refuse la demande, suspend ou réactive un client","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrganizationReview"}}}},"responses":{"200":{"description":"Client","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrganizationDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/b2b/organizations/{id}/credit":{"post":{"operationId":"adminAdjustCredit","summary":"Ajuste le crédit prépayé du client (geste commercial, virement reçu, correction), avec motif","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreditAdjust"}}}},"responses":{"200":{"description":"Client","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrganizationDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/b2b/credits/{id}/refresh":{"post":{"operationId":"adminRefreshCredit","summary":"Relit chez Stripe une recharge en attente (crédite le solde si la facture est payée)","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreditRefresh"}}}},"responses":{"200":{"description":"Client","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrganizationDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/b2b/credits/{id}/invoice":{"get":{"operationId":"adminCreditInvoice","summary":"Lien de téléchargement de la facture Stripe (PDF) d’une recharge","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Lien","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminInvoiceLink"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/b2b/reviews":{"get":{"operationId":"adminB2bReviews","summary":"Demandes de production en attente","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Demandes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminB2bReviews"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/b2b/keys/{id}/revoke":{"post":{"operationId":"adminRevokeApiKey","summary":"Révoque une clé d’API (effet immédiat, irréversible)","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500,"description":"Motif (journal d’audit)."}},"required":["reason"]}}}},"responses":{"200":{"description":"Clé révoquée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminApiKey"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/stats":{"get":{"operationId":"adminStatsOverview","summary":"Statistiques d’utilisation : totaux, jours, outils, partages, sources, entonnoir","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Vue d’ensemble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminStatsOverview"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/stats/events":{"get":{"operationId":"adminStatsEvents","summary":"Journal brut des événements (filtrable par événement, outil, session)","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"event","in":"query"},{"schema":{"type":"string","maxLength":120},"required":false,"name":"service","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"session","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Événements","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminStatsEventPage"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/system":{"get":{"operationId":"adminSystem","summary":"Configuration effective et compte administrateur","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Système","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSystem"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/dashboard":{"get":{"operationId":"adminDashboard","summary":"Indicateurs sur une période (CA, marge, envois, comptes, leads, IA)","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":365,"default":30},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Tableau de bord","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDashboard"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/freshness":{"get":{"operationId":"adminFreshness","summary":"Barèmes, références de loi et adresses à revérifier (calendrier de revalorisation du catalogue)","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Fraîcheur des données réglementaires","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminFreshness"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/pricing":{"get":{"operationId":"adminPricing","summary":"Rentabilité par mode : prix, coût prestataire en direct, frais, marge","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Rentabilité","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPricing"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/orders":{"get":{"operationId":"adminListOrders","summary":"Commandes (recherche : e-mail, identifiant, PaymentIntent)","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"kind","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Commandes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrderPage"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/orders/{id}":{"get":{"operationId":"adminGetOrder","summary":"Commande, envoi, factures et journal","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Commande","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrderDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/orders/{id}/refund":{"post":{"operationId":"adminRefundOrder","summary":"Rembourse (total ou partiel) : Stripe, avoir, e-mail au client","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amountCents":{"type":"integer","exclusiveMinimum":0},"reason":{"type":"string","minLength":3,"maxLength":500,"description":"Motif (journal d’audit)."}},"required":["reason"]}}}},"responses":{"200":{"description":"Commande","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrderDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/orders/{id}/fulfill":{"post":{"operationId":"adminFulfillOrder","summary":"Reprend l’exécution d’une commande payée","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminNote"}}}},"responses":{"200":{"description":"Commande","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrderDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/shipments":{"get":{"operationId":"adminListShipments","summary":"Envois (recherche : n° de suivi, référence prestataire, destinataire)","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"kind","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Envois","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminShipmentPage"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/shipments/{id}":{"get":{"operationId":"adminGetShipment","summary":"Envoi, étapes (brutes), lettre et journal ; `refresh=1` relit le prestataire","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["0","1"]},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Envoi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminShipmentDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/shipments/{id}/sync":{"post":{"operationId":"adminSyncShipment","summary":"Relit l’état chez le prestataire","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminNote"}}}},"responses":{"200":{"description":"Envoi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminShipmentDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/shipments/{id}/redeposit":{"post":{"operationId":"adminRedepositShipment","summary":"Nouveau dépôt après un échec","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminNote"}}}},"responses":{"200":{"description":"Envoi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminShipmentDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/shipments/{id}/cancel":{"post":{"operationId":"adminCancelShipment","summary":"Annule (fenêtre d’annulation du prestataire), remboursement en option","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":500,"description":"Motif (journal d’audit)."},"refund":{"type":"boolean","default":true}},"required":["reason"]}}}},"responses":{"200":{"description":"Envoi","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminShipmentDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/shipments/{id}/proofs/{kind}":{"get":{"operationId":"adminShipmentProof","summary":"Lien de téléchargement d’une preuve (quelques minutes)","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"$ref":"#/components/schemas/ProofKind"},"required":true,"name":"kind","in":"path"}],"responses":{"200":{"description":"Preuve","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProofLink"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/users":{"get":{"operationId":"adminListUsers","summary":"Comptes (kind : identified | anonymous)","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"kind","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Comptes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserPage"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/users/{id}":{"get":{"operationId":"adminGetUser","summary":"Compte, commandes, envois, documents","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Compte","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/leads":{"get":{"operationId":"adminListLeads","summary":"Demandes de mise en relation (kind = vertical)","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"kind","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Leads","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLeadPage"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/leads/{id}/status":{"post":{"operationId":"adminSetLeadStatus","summary":"Change le statut d’une demande (qualifiée, transmise…)","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["new","qualified","routed","accepted","returned","won"]},"note":{"type":"string","maxLength":500}},"required":["status"]}}}},"responses":{"200":{"description":"Lead","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLead"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/messages":{"get":{"operationId":"adminListMessages","summary":"Messages du formulaire de contact","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"kind","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Messages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMessagePage"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/requests":{"get":{"operationId":"adminListRequests","summary":"Demandes de services absents du catalogue","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"kind","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Demandes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRequestPage"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/requests/{id}/status":{"post":{"operationId":"adminSetRequestStatus","summary":"Change le statut d’une demande de service","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["new","planned","done","rejected"]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/audit":{"get":{"operationId":"adminAudit","summary":"Journal des actions du back-office","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Journal","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AdminAudit"}}},"required":["items"]}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/admin/webhooks":{"get":{"operationId":"adminWebhooks","summary":"Derniers webhooks reçus (Stripe, prestataire postal) et recherches sans résultat","tags":["Back-office"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Journal technique","content":{"application/json":{"schema":{"type":"object","properties":{"webhooks":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"eventId":{"type":"string"},"type":{"type":"string"},"status":{"type":"string","enum":["processing","done"]},"receivedAt":{"type":"string"},"processedAt":{"type":["string","null"]}},"required":["provider","eventId","type","status","receivedAt","processedAt"]}},"searchMisses":{"type":"array","items":{"type":"object","properties":{"query":{"type":"string"},"hits":{"type":"integer"},"lastSource":{"type":["string","null"]},"lastSeenAt":{"type":["string","null"]}},"required":["query","hits","lastSource","lastSeenAt"]}}},"required":["webhooks","searchMisses"]}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer":{"get":{"operationId":"developerAccount","summary":"Compte développeur : entreprise, clés, webhooks, consommation du mois","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Compte","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperAccount"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/organization":{"post":{"operationId":"developerCreateAccount","summary":"Crée le compte entreprise (bac à sable) et sa première clé test","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperCreateAccount"}}}},"responses":{"201":{"description":"Compte créé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperCreatedAccount"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/organization/update":{"post":{"operationId":"developerUpdateOrganization","summary":"Modifie la fiche de l’entreprise","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperUpdateOrganization"}}}},"responses":{"200":{"description":"Compte","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperAccount"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/keys":{"post":{"operationId":"developerCreateKey","summary":"Crée une clé d’API (live seulement si la production est ouverte) ; valeur affichée une fois","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperCreateKey"}}}},"responses":{"201":{"description":"Clé créée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperCreatedKey"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/keys/{id}/revoke":{"post":{"operationId":"developerRevokeKey","summary":"Révoque une clé (effet immédiat)","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperEmpty"}}}},"responses":{"200":{"description":"Clé révoquée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperApiKey"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/credits":{"post":{"operationId":"developerStartTopUp","summary":"Recharge du crédit prépayé : facture Stripe à payer par carte dans le navigateur (Payment Element)","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperTopUpRequest"}}}},"responses":{"200":{"description":"Facture à payer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperTopUp"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"operationId":"developerCredits","summary":"Recharges et ajustements du crédit","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"responses":{"200":{"description":"Recharges","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperCredits"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/credits/{id}/confirm":{"post":{"operationId":"developerConfirmTopUp","summary":"Après paiement : crédite le solde dès que Stripe confirme la facture","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperTopUpConfirm"}}}},"responses":{"200":{"description":"Compte","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperAccount"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/credits/{id}/invoice":{"get":{"operationId":"developerCreditInvoice","summary":"Lien de téléchargement de la facture (PDF Stripe) d’une recharge","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Lien","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperInvoiceLink"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/live-request":{"post":{"operationId":"developerRequestLive","summary":"Demande l’ouverture de la production (SIREN vérifié, usage déclaré)","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperLiveRequest"}}}},"responses":{"200":{"description":"Compte (statut review)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperAccount"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/mailings":{"get":{"operationId":"developerMailings","summary":"Envois de l’entreprise (test et live)","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Envois","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperMailings"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/mailings/{id}/proofs/{kind}":{"get":{"operationId":"developerMailingProof","summary":"Lien de téléchargement d’une preuve (quelques minutes)","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"$ref":"#/components/schemas/ProofKind"},"required":true,"name":"kind","in":"path"}],"responses":{"200":{"description":"Preuve","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProofLink"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Service partenaire en erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/usage":{"get":{"operationId":"developerUsage","summary":"Consommation par mois, environnement et unité","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":24,"default":12},"required":false,"name":"months","in":"query"}],"responses":{"200":{"description":"Consommation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperUsage"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/webhooks":{"post":{"operationId":"developerCreateWebhook","summary":"Ajoute un webhook (HTTPS public) ; le secret de signature est affiché une fois","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperCreateWebhook"}}}},"responses":{"201":{"description":"Webhook créé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperCreatedWebhook"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/webhooks/{id}":{"post":{"operationId":"developerUpdateWebhook","summary":"Active, désactive un webhook ou change ses événements","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperUpdateWebhook"}}}},"responses":{"200":{"description":"Webhook","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperWebhook"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Requête impossible à traiter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/webhooks/{id}/delete":{"post":{"operationId":"developerDeleteWebhook","summary":"Supprime un webhook","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperDeleteWebhook"}}}},"responses":{"200":{"description":"Supprimé","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/webhooks/{id}/ping":{"post":{"operationId":"developerPingWebhook","summary":"Envoie un événement de test « ping »","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperPingWebhook"}}}},"responses":{"200":{"description":"Envoi programmé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperPing"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/developer/webhooks/{id}/deliveries":{"get":{"operationId":"developerWebhookDeliveries","summary":"50 dernières livraisons d’un webhook (statut, code HTTP, erreur)","tags":["Espace développeur"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Livraisons","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperWebhookDeliveries"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Accès refusé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/sandbox/proof.pdf":{"get":{"operationId":"sandboxProof","summary":"Preuve fictive (PDF « spécimen ») des envois du bac à sable","tags":["Espace développeur"],"parameters":[{"schema":{"$ref":"#/components/schemas/ProofKind"},"required":false,"name":"kind","in":"query"}],"responses":{"200":{"description":"PDF","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/catalogue":{"get":{"operationId":"appGetCatalogue","summary":"Catalogue complet : catégories, lettres (fournisseurs, champs), calculateurs, outils IA, devis, tarifs","description":"Réponse mise en cache côté client : en-têtes ETag et Cache-Control ; renvoyez If-None-Match pour obtenir 304.","tags":["Application"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"if-none-match","in":"header"}],"responses":{"200":{"description":"Catalogue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalogue"}}}},"304":{"description":"Non modifié"},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/letters/{slug}":{"get":{"operationId":"appGetLetter","summary":"Détail d’une lettre (champs exacts pour un fournisseur donné)","tags":["Application"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":80},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string"},"required":false,"name":"provider","in":"query"}],"responses":{"200":{"description":"Lettre","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LetterDetail"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/letters/{slug}/render":{"post":{"operationId":"appRenderLetter","summary":"Rendu d’une lettre : document structuré (segments avec champs à compléter), texte, champs manquants","tags":["Application"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":80},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LetterRenderRequest"}}}},"responses":{"200":{"description":"Lettre rendue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LetterRender"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/calculators/{slug}/compute":{"post":{"operationId":"appCompute","summary":"Exécute un calculateur (valeurs par défaut complétées ; distance calculée par itinéraire et prix moyen du carburant du jour si le calculateur en a)","tags":["Application"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":80},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComputeRequest"}}}},"responses":{"200":{"description":"Résultat","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalculatorResult"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/quotes/{slug}/estimate":{"post":{"operationId":"appEstimateQuote","summary":"Estimation d’un devis (itinéraire routier calculé si le service en a un)","tags":["Application"],"security":[{"supabaseJwt":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":80},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteEstimateRequest"}}}},"responses":{"200":{"description":"Estimation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteEstimate"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Ressource introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/app/search":{"get":{"operationId":"appSearch","summary":"Recherche dans le catalogue, en mots-clés ou en langage naturel","description":"Recherche hybride : mots-clés et alias (instantané) fusionnés avec une recherche sémantique (« mon propriétaire garde ma caution » → dépôt de garantie). Le sémantique n’intervient que si la requête le justifie (aucun résultat par mots-clés, ou 3 mots et plus) ; en cas d’indisponibilité, la réponse reste lexicale (`mode: lexical`).","tags":["Application (public)"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":8},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["hybrid","lexical"],"default":"hybrid","description":"`lexical` : mots-clés seuls (sans appel au moteur sémantique)."},"required":false,"description":"`lexical` : mots-clés seuls (sans appel au moteur sémantique).","name":"mode","in":"query"}],"responses":{"200":{"description":"Résultats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResults"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentification requise ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Trop de requêtes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Erreur interne","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"webhooks":{}}