4. Créer une application

Une application = une intégration distincte (site, application mobile, terminal). Chacune a ses clés, son webhook, son solde et ses liens de paiement. Son identifiant se passe dans X-Application-ID.

Créer une application

POST/applicationsJeton de session

Corps de la requête
{
  "name": "Boutique en ligne",
  "webhook_url": "https://mon-site.cm/webhooks/kratospay",
  "country_id": 1
}
Réponse 201
{
  "success": true,
  "data": {
    "application": {
      "id": 12,
      "name": "Boutique en ligne",
      "webhook_url": "https://mon-site.cm/webhooks/kratospay",
      "has_webhook": true,
      "is_active": true,
      "created_at": "2026-11-02T08:00:00Z"
    },
    "webhook_secret": "whsec_<secret>"
  },
  "meta": {
    "request_id": "...",
    "timestamp": "..."
  }
}
CodeQuand
401Jeton expiré.
422Nom manquant ou URL de webhook invalide.
  • webhook_secret n'est affiché qu'une fois, même sans webhook_url. Le régénérer : POST /applications/{id}/webhook/rotate-secret.
  • Gérer : GET /applications, GET /applications/{id}, PATCH /applications/{id} (name, webhook_url, is_active), DELETE /applications/{id}. Pays ayant transigé : GET /applications/{id}/countries.