{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/ibanfirst/main/json-schema/ibanfirst-webhook-schema.json",
  "title": "Webhook",
  "description": "Representation of a webhook subscription.\n",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ibanfirst-webhook-subscriptions-api-openapi.yml#/components/schemas/Webhook",
  "type": "object",
  "properties": {
    "webhookId": {
      "$ref": "#/$defs/webhookId"
    },
    "events": {
      "description": "List of subscribed events.\n",
      "type": "array",
      "items": {
        "$ref": "#/$defs/events"
      }
    },
    "url": {
      "$ref": "#/$defs/url"
    }
  },
  "$defs": {
    "events": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "PAYMENT_CREATED",
          "PAYMENT_PLANIFIED",
          "PAYMENT_FINALIZED",
          "PAYMENT_WAITING_SIGNATURE",
          "PAYMENT_AWAITING_CONFIRMATION",
          "PAYMENT_CANCELED",
          "PAYMENT_BLOCKED",
          "PAYMENT_WAITING_JUSTIFICATION",
          "PAYMENT_INCOMING",
          "TRADE_PLANIFIED",
          "TRADE_FINALIZED",
          "TRADE_CANCELED",
          "TRADE_BLOCKED"
        ]
      }
    },
    "url": {
      "type": "string",
      "description": "Notifications are sent to this url.\n",
      "pattern": "^(https?:\\/\\/)[^\\s/$.?#].[^\\s]*$"
    },
    "webhookId": {
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$",
      "description": "ID of the webhook subscription.\n"
    }
  }
}