{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "TransactionProcessedPayload",
  "type": "object",
  "required": [
    "event",
    "payload"
  ],
  "properties": {
    "event": {
      "type": "string"
    },
    "payload": {
      "type": "object",
      "required": [
        "id",
        "merchant_id",
        "terminal_id",
        "order_id",
        "reference",
        "currency",
        "amount",
        "transaction_type",
        "processing_code",
        "status",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "merchant_id": {
          "type": "string"
        },
        "terminal_id": {
          "type": "string"
        },
        "order_id": {
          "type": "string"
        },
        "payment_link_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "reference": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "currency": {
          "type": "string"
        },
        "amount": {
          "type": "integer"
        },
        "transaction_type": {
          "type": "string"
        },
        "processing_code": {
          "type": "string"
        },
        "response_message": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string"
        },
        "metadata": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "approval_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "reference_number": {
          "type": [
            "string",
            "null"
          ]
        },
        "parent_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "systan": {
          "type": [
            "integer",
            "null"
          ]
        },
        "transaction_initiated_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "authentication_level": {
          "type": [
            "integer",
            "null"
          ]
        },
        "payment_provider_response_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "payment_provider_response_message": {
          "type": [
            "string",
            "null"
          ]
        },
        "normalized_amount": {
          "type": [
            "integer",
            "null"
          ]
        },
        "customer_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "outgoing_amount": {
          "type": [
            "integer",
            "null"
          ]
        },
        "outgoing_currency": {
          "type": [
            "string",
            "null"
          ]
        },
        "payment_method_method": {
          "type": [
            "string",
            "null"
          ]
        },
        "payment_method_hash": {
          "type": [
            "string",
            "null"
          ]
        },
        "payment_method_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "payment_method_brand": {
          "type": [
            "string",
            "null"
          ]
        },
        "payment_method_masked": {
          "type": [
            "string",
            "null"
          ]
        },
        "payment_method_token": {
          "type": [
            "string",
            "null"
          ]
        },
        "customer_first_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "customer_last_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "customer_address": {
          "type": [
            "string",
            "null"
          ]
        },
        "customer_city": {
          "type": [
            "string",
            "null"
          ]
        },
        "customer_country": {
          "type": [
            "string",
            "null"
          ]
        },
        "customer_postal_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "customer_email": {
          "type": [
            "string",
            "null"
          ]
        },
        "customer_phone_number": {
          "type": [
            "string",
            "null"
          ]
        },
        "authentication_status": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}
