Passer au contenu principal

Endpoint

GET https://pay.sandbox.yabetoopay.com/v1/account/{accountId}/webhooks/{id}   # Sandbox
GET https://pay.api.yabetoopay.com/v1/account/{accountId}/webhooks/{id}       # Production

Authentification

Utilisez votre clé secrète dans l’en-tête Authorization :
Authorization: Bearer YOUR_SECRET_KEY

Paramètres de chemin

ParamètreTypeDescription
accountIdstringVotre ID de compte
idstringL’ID du webhook

Exemple de requête

curl https://pay.sandbox.yabetoopay.com/v1/account/YOUR_ACCOUNT_ID/webhooks/whk_123456789 \
  -H "Authorization: Bearer YOUR_SECRET_KEY"

Réponse

200 OK

{
  "id": "whk_123456789",
  "object": "webhook",
  "url": "https://example.com/webhooks",
  "description": "Webhook de production",
  "status": "active",
  "enabled_events": [
    "intent.completed",
    "disbursement.completed"
  ],
  "metadata": {
    "environment": "production"
  },
  "created_at": "2023-05-12T10:12:32Z",
  "last_error": null,
  "stats": {
    "successful_deliveries": 150,
    "failed_deliveries": 2,
    "average_response_time": 245
  }
}

Statuts du webhook

StatutDescription
activeWebhook actif et fonctionnel
disabledWebhook désactivé manuellement
failedWebhook désactivé après trop d’échecs

Types d’erreurs

TypeDescription
connection_errorImpossible de se connecter à l’URL
timeout_errorDélai de réponse dépassé
invalid_responseRéponse non valide (code != 200)
ssl_errorErreur de certificat SSL

404 Not Found

{
  "message": "Webhook not found"
}

401 Non autorisé

{
  "message": "Unauthorized"
}