{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/payments-ai/json-schema/payments-ai-public-checkout-by-plan-response-schema.json",
  "title": "PublicCheckoutByPlanResponse",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/payments-ai-mor-openapi.json#/components/schemas/PublicCheckoutByPlanResponse",
  "type": "object",
  "required": [
    "planId",
    "productId",
    "merchantId",
    "productName",
    "type",
    "amount",
    "initialPrice",
    "currency",
    "checkoutUrl",
    "customization"
  ],
  "properties": {
    "planId": {
      "type": "string"
    },
    "externalPlanId": {
      "type": "string"
    },
    "externalMerchantId": {
      "type": "string"
    },
    "productId": {
      "type": "string"
    },
    "merchantId": {
      "type": "string"
    },
    "productName": {
      "type": "string"
    },
    "productDescription": {
      "type": "string"
    },
    "richDescription": {
      "type": "string",
      "description": "Long-form copy authored on the plan (`plans.rich_description`), rendered as plain text beneath the short description. Newlines are preserved; markup is not interpreted."
    },
    "productImagePath": {
      "type": "string"
    },
    "productImageExpiresAt": {
      "type": "string",
      "format": "date-time",
      "description": "ISO-8601 UTC expiry of `productImagePath`. Present only when the image is a presigned URL."
    },
    "type": {
      "type": "string"
    },
    "billingPeriod": {
      "type": "string",
      "description": "Present for recurring plans; drives checkout recurrence policy copy (day | week | month | year)."
    },
    "lengthOfBillingPeriod": {
      "type": "integer",
      "format": "int32",
      "description": "Number of billing periods per charge cycle (e.g. 3 with month = every 3 months)."
    },
    "amount": {
      "$ref": "#/$defs/SharedTypes.MoneyAmountValue"
    },
    "initialPrice": {
      "allOf": [
        {
          "$ref": "#/$defs/SharedTypes.MoneyAmountValue"
        }
      ],
      "description": "Amount charged at checkout today. Zero for recurring plans with a free trial; otherwise matches amount."
    },
    "currency": {
      "type": "string"
    },
    "checkoutUrl": {
      "type": "string"
    },
    "websiteUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "Merchant store URL from business settings (`merchants.url`). Null when not configured."
    },
    "termsUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "Seller Terms URL or stable API redirect for a PDF. Null when unset (hosted checkout uses the default terms)."
    },
    "privacyUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "Seller Privacy URL or stable API redirect for a PDF. Null when unset (hosted checkout uses the default privacy policy)."
    },
    "returnPolicyUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "Seller Return policy URL or stable API redirect for a PDF. Null when unset (link omitted on checkout)."
    },
    "eulaUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "Seller EULA URL or stable API redirect for a PDF. Null when unset (link omitted on checkout)."
    },
    "customization": {
      "$ref": "#/$defs/CheckoutCustomization"
    }
  },
  "$defs": {
    "CheckoutCustomization": {
      "type": "object",
      "properties": {
        "themeMode": {
          "$ref": "#/$defs/CheckoutThemeMode"
        },
        "backgroundColor": {
          "type": "string"
        },
        "buttonColor": {
          "type": "string"
        },
        "buttonTextColor": {
          "type": "string"
        },
        "fontColor": {
          "type": "string",
          "description": "Primary body/content text color for the merchant product panel."
        },
        "logoUrl": {
          "type": "string",
          "description": "Presigned URL resolved on the read side from the stored `logoPath` S3 key."
        },
        "logoExpiresAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO-8601 UTC expiry of `logoUrl`. Refresh the checkout context before this moment."
        },
        "fontFamily": {
          "$ref": "#/$defs/CheckoutFontFamily"
        },
        "inputStyle": {
          "allOf": [
            {
              "$ref": "#/$defs/CheckoutInputStyle"
            }
          ],
          "description": "Corner radius preset for checkout inputs (`rounded` maps to 8px, `square` to 0)."
        }
      }
    },
    "CheckoutFontFamily": {
      "type": "string",
      "enum": [
        "Inter",
        "Roboto"
      ]
    },
    "CheckoutInputStyle": {
      "type": "string",
      "enum": [
        "rounded",
        "square"
      ]
    },
    "CheckoutThemeMode": {
      "type": "string",
      "enum": [
        "light",
        "dark"
      ]
    },
    "SharedTypes.MoneyAmountValue": {
      "type": "number",
      "format": "decimal",
      "description": "Decimal money amount for financial values."
    }
  }
}