{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aisle-wedding/json-schema/aisle-wedding-payment-schema.json",
  "title": "Payment",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aisle-wedding-payments-api-openapi.yml#/components/schemas/Payment",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^pay_.+$"
    },
    "guest_id": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^gst_.+$"
        },
        {
          "type": "null"
        }
      ]
    },
    "type": {
      "type": "string"
    },
    "amount": {
      "type": "string",
      "pattern": "^\\d+(?:\\.\\d{2})$",
      "description": "A decimal currency amount serialized as a string."
    },
    "platform_fee": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^\\d+(?:\\.\\d{2})$",
          "description": "A decimal currency amount serialized as a string."
        },
        {
          "type": "null"
        }
      ]
    },
    "fee_paid_by_guest": {
      "type": "boolean"
    },
    "currency": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "completed",
        "failed",
        "refunded"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "instalment": {
      "type": [
        "string",
        "null"
      ]
    },
    "charge_total": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^\\d+(?:\\.\\d{2})$",
          "description": "A decimal currency amount serialized as a string."
        },
        {
          "type": "null"
        }
      ]
    },
    "registry_contribution_id": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^rct_.+$"
        },
        {
          "type": "null"
        }
      ]
    },
    "accommodation_id": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^acc_.+$"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_id": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^evt_.+$"
        },
        {
          "type": "null"
        }
      ]
    },
    "refunded_at": {
      "oneOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "refund_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "$ref": "#/$defs/Timestamp"
    },
    "updated_at": {
      "$ref": "#/$defs/Timestamp"
    }
  },
  "required": [
    "id",
    "guest_id",
    "type",
    "amount",
    "platform_fee",
    "fee_paid_by_guest",
    "currency",
    "status",
    "description",
    "instalment",
    "charge_total",
    "registry_contribution_id",
    "accommodation_id",
    "event_id",
    "refunded_at",
    "refund_reason",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "Timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "An RFC 3339 UTC timestamp with milliseconds."
    }
  }
}