{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://comercioia.cl/ucp/handlers/khipu/2026-10-15.json",
  "name": "cl.comercioia.khipu",
  "version": "2026-10-15",
  "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. Payment initiation is subject to Ley 21.521 and CMF regulation, on the phased calendar that applies to each participant and service; an implementer only creates the charge as payee and redirects the buyer to Khipu, never capturing the buyer's bank credentials. 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. This is an integration proposed by the initiative; its publication here does not mean Khipu has reviewed or endorsed it, or that it is available on its platform. Publishing this schema is not, by itself, operating a financial service: whether an implementation is one depends on the functions it actually performs, including payment processing or initiation, and is not settled only by not holding funds. 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."
        }
      }
    }
  }
}
