{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.elimi.africa/contracts/events/payment.failed.v1.json",
  "title": "payment.failed data",
  "description": "data payload for payment.failed. Emitted by Orchestrator when a provider webhook reports failure.",
  "type": "object",
  "additionalProperties": false,
  "required": ["paymentId", "referenceType", "referenceId"],
  "properties": {
    "paymentId": {
      "type": "string"
    },
    "referenceType": {
      "type": "string"
    },
    "referenceId": {
      "type": "string"
    },
    "amount": {
      "type": "integer",
      "description": "Minor currency units (kobo)"
    },
    "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "reason": {
      "type": "string"
    },
    "userId": {
      "type": "string"
    }
  }
}
