{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://shopify.dev/ucp/shop-pay-handler/2026-08-25/schema.json",
  "title": "Shop Pay Handler Schema",
  "description": "Schema for the dev.shopify.shop_pay payment handler.",
  "name": "dev.shopify.shop_pay",
  "version": "2026-08-25",
  "requires": { "protocol": { "min": "2026-08-25" } },
  "$defs": {
    "shop_token": {
      "$ref": "https://shopify.dev/ucp/shop-pay-handler/2026-08-25/shop_token.json"
    },
    "shop_pay": {
      "$ref": "https://shopify.dev/ucp/shop-pay-handler/2026-08-25/shop_pay.json"
    },
    "dev.shopify.shop_pay": {
      "payment_instrument": {
        "title": "Shop Pay Payment Instrument",
        "description": "Payment instrument for the Shop Pay handler.",
        "$ref": "#/$defs/shop_pay"
      },
      "platform_schema": {
        "title": "Shop Pay Handler (Platform)",
        "description": "Platform-level handler declaration for discovery. Shop Pay defines no platform configuration: platform credentials are exchanged with Shop Pay out of band and are never advertised in UCP.",
        "allOf": [
          {
            "$ref": "https://ucp.dev/2026-08-25/schemas/payment_handler.json#/$defs/platform_schema"
          },
          {
            "type": "object",
            "properties": {
              "available_instruments": {
                "items": {
                  "$ref": "https://shopify.dev/ucp/shop-pay-handler/2026-08-25/shop_pay.json#/$defs/available_instrument"
                }
              }
            }
          }
        ]
      },
      "business_schema": {
        "title": "Shop Pay Handler (Business)",
        "description": "Business-level handler configuration for discovery.",
        "allOf": [
          {
            "$ref": "https://ucp.dev/2026-08-25/schemas/payment_handler.json#/$defs/business_schema"
          },
          {
            "type": "object",
            "required": [
              "config"
            ],
            "properties": {
              "available_instruments": {
                "items": {
                  "$ref": "https://shopify.dev/ucp/shop-pay-handler/2026-08-25/shop_pay.json#/$defs/available_instrument"
                }
              },
              "config": {
                "$ref": "https://shopify.dev/ucp/shop-pay-handler/2026-08-25/business_config.json"
              }
            }
          }
        ]
      },
      "response_schema": {
        "title": "Shop Pay Handler (Response)",
        "description": "Runtime handler configuration in checkout responses.",
        "allOf": [
          {
            "$ref": "https://ucp.dev/2026-08-25/schemas/payment_handler.json#/$defs/response_schema"
          },
          {
            "type": "object",
            "required": [
              "config"
            ],
            "properties": {
              "available_instruments": {
                "items": {
                  "$ref": "https://shopify.dev/ucp/shop-pay-handler/2026-08-25/shop_pay.json#/$defs/available_instrument"
                }
              },
              "config": {
                "$ref": "https://shopify.dev/ucp/shop-pay-handler/2026-08-25/business_config.json"
              }
            }
          }
        ]
      }
    }
  }
}
