{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/autohost/json-schema/autohost-payment-event-request-schema.json",
  "title": "PaymentEventRequest",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/autohost-openapi.json#/components/schemas/PaymentEventRequest",
  "required": [
    "reservation_id",
    "event_id",
    "event_source",
    "event_type",
    "event_status"
  ],
  "properties": {
    "reservation_id": {
      "type": "string"
    },
    "event_source": {
      "type": "string",
      "enum": [
        "adyen",
        "stripe"
      ]
    },
    "event_id": {
      "type": "string"
    },
    "event_type": {
      "type": "string",
      "enum": [
        "authorization",
        "charge",
        "refund",
        "dispute",
        "chargeback"
      ]
    },
    "event_status": {
      "type": "string",
      "enum": [
        "info",
        "warning",
        "success",
        "failure"
      ]
    },
    "customer_id": {
      "type": "string"
    },
    "processor_status_code": {
      "type": "string"
    },
    "processor_message": {
      "type": "string"
    },
    "network_status_code": {
      "type": "string"
    },
    "amount": {
      "type": "number",
      "minimum": 0
    },
    "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "charge_descriptor": {
      "type": "string"
    },
    "name_on_card": {
      "type": "string"
    },
    "payment_method": {
      "type": "string",
      "enum": [
        "card",
        "ach"
      ]
    },
    "card_type": {
      "type": "string",
      "enum": [
        "credit",
        "debit",
        "prepaid"
      ]
    },
    "card_provider": {
      "type": "string",
      "enum": [
        "visa",
        "mastercard",
        "amex",
        "discover",
        "jcb",
        "diners",
        "maestro",
        "unionpay",
        "other"
      ]
    },
    "card_iin": {
      "type": "string",
      "minLength": 4,
      "maxLength": 6
    },
    "card_last4": {
      "type": "string",
      "minLength": 4,
      "maxLength": 4
    },
    "card_expiry_month": {
      "type": "string",
      "minLength": 2,
      "maxLength": 2
    },
    "card_expiry_year": {
      "type": "string",
      "minLength": 4,
      "maxLength": 4
    },
    "card_fingerprint": {
      "type": "string"
    },
    "billing_country_code": {
      "type": "string",
      "minLength": 2,
      "maxLength": 2
    },
    "billing_address": {
      "type": "string"
    },
    "billing_city": {
      "type": "string"
    },
    "billing_state_code": {
      "type": "string"
    },
    "billing_postal_code": {
      "type": "string"
    },
    "billing_phone": {
      "type": "string"
    },
    "billing_email": {
      "type": "string",
      "format": "email"
    },
    "billing_name": {
      "type": "string"
    },
    "ip_address": {
      "type": "string",
      "format": "ipv4"
    },
    "user_agent": {
      "type": "string"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    }
  }
}