{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://b2a.bluepillow.com/ucp/schemas/indirect_transaction.json",
  "name": "com.bluepillow.b2a.lodging.indirect_transaction",
  "version": "2026-10-31",
  "title": "Indirect Transaction Extension (experimental)",
  "description": "EXPERIMENTAL, NOT PART OF UCP. Public test by Blue Pillow of a feature UCP does not define yet: the indirect transaction. The business that exposes the offer over UCP (here a comparator / metasearch) is neither the seller nor the merchant of record. The booking session verifies the rate and ends by handing the buyer off, via continue_url and in status requires_escalation, to the seller's own checkout (typically an online travel agency), which takes the payment, confirms and manages the booking. This extension makes that explicit in the booking session. The escalation message that goes with it uses the freeform code `payment_at_seller` with severity `requires_buyer_input`. Documentation: https://b2a.bluepillow.com/ucp",
  "requires": {
    "protocol": {
      "min": "2026-10-31"
    },
    "capabilities": {
      "dev.ucp.lodging.booking": {
        "min": "2026-10-31"
      }
    }
  },
  "$defs": {
    "merchant_of_record": {
      "type": "object",
      "description": "The seller that takes the payment and is the merchant of record for the booking (for example an online travel agency). It is never the business that serves this UCP session.",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "Display name of the seller, as shown to the buyer on its own checkout."
        }
      }
    },
    "indirect_transaction": {
      "type": "object",
      "title": "Indirect Transaction",
      "description": "Declares that this booking session is an indirect transaction: the business serving the session is not the seller, does not take payment and does not hold the booking. The buyer completes the booking and pays on the seller's own checkout, reached through `handoff_url`.",
      "required": [
        "business_role",
        "merchant_of_record",
        "payment_location",
        "handoff_url"
      ],
      "properties": {
        "business_role": {
          "type": "string",
          "enum": [
            "comparator"
          ],
          "description": "Role of the business serving the UCP session. `comparator`: a comparator / metasearch that lists offers of third-party sellers and hands the buyer off to the seller. It is not the merchant of record."
        },
        "merchant_of_record": {
          "$ref": "#/$defs/merchant_of_record"
        },
        "payment_location": {
          "type": "string",
          "enum": [
            "seller_checkout"
          ],
          "description": "Where the buyer pays. `seller_checkout`: on the seller's own website or app, after the handoff. No payment is collected in the UCP session and no payment handler is involved."
        },
        "handoff_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://",
          "description": "Absolute HTTPS URL that takes the buyer to the seller's checkout for this offer; it may be the business's own outbound link that redirects to the seller. Equal to the session's `continue_url`."
        }
      }
    },
    "dev.ucp.lodging.booking": {
      "title": "Booking with Indirect Transaction",
      "description": "Lodging booking session extended with the indirect transaction declaration.",
      "allOf": [
        {
          "$ref": "https://ucp.dev/schemas/lodging/booking.json"
        },
        {
          "type": "object",
          "properties": {
            "indirect_transaction": {
              "$ref": "#/$defs/indirect_transaction",
              "ucp_request": "omit"
            }
          }
        }
      ]
    }
  }
}
