{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://comercioia.cl/ucp/handlers/khipu/2026-10-09.json",
  "name": "cl.comercioia.khipu",
  "version": "2026-10-09",
  "title": "Khipu (bank transfer) payment handler",
  "description": "OPEN PROPOSAL, ready to implement and open for comment. Not yet stable. Bank-transfer payment initiated by Khipu. The business creates the payment with its own Khipu API key; the buyer pays from their bank account at the returned payment_url. Confirmation is by signed webhook (retried by Khipu) and status query. Khipu, not the handler author, carries any registration required for payment initiation. Funds go from the buyer to the business's own Khipu account and never pass through the handler author. Published by the Comercio IA initiative until Khipu publishes its own handler; Khipu is invited to review, co-sign or take it over. Not affiliated with or endorsed by Khipu. Spec: https://comercioia.cl/spec/#khipu",
  "$defs": {
    "cl.comercioia.khipu": {
      "payment_instrument": {
        "allOf": [
          {
            "$ref": "https://ucp.dev/2026-08-25/schemas/common/types/payment_instrument.json"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "redirect"
              }
            }
          }
        ]
      },
      "business_schema": {
        "allOf": [
          {
            "$ref": "https://ucp.dev/2026-08-25/schemas/payment_handler.json#/$defs/business_schema"
          },
          {
            "type": "object",
            "properties": {
              "config": {
                "$ref": "#/$defs/business_config"
              }
            }
          }
        ]
      },
      "platform_schema": {
        "allOf": [
          {
            "$ref": "https://ucp.dev/2026-08-25/schemas/payment_handler.json#/$defs/platform_schema"
          },
          {
            "type": "object",
            "properties": {
              "config": {
                "$ref": "#/$defs/platform_config"
              }
            }
          }
        ]
      },
      "response_schema": {
        "allOf": [
          {
            "$ref": "https://ucp.dev/2026-08-25/schemas/payment_handler.json#/$defs/response_schema"
          },
          {
            "type": "object",
            "properties": {
              "config": {
                "$ref": "#/$defs/response_config"
              }
            }
          }
        ]
      }
    },
    "business_config": {
      "type": "object",
      "description": "Public configuration only. Credentials and API keys MUST NOT appear in profiles or responses.",
      "properties": {
        "environment": {
          "type": "string",
          "examples": [
            "production",
            "integration"
          ]
        }
      }
    },
    "platform_config": {
      "type": "object",
      "description": "No platform configuration is required: the platform only follows continue_url."
    },
    "response_config": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "examples": [
            "production",
            "integration"
          ]
        },
        "payment_expires_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the payment link expires, if set."
        }
      }
    }
  }
}
