{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/studiomeyer-academy/json-schema/studiomeyer-academy-checkout-complete-schema.json",
  "title": "CheckoutComplete",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/studiomeyer-academy-openapi.json#/components/schemas/CheckoutComplete",
  "type": "object",
  "properties": {
    "payment_data": {
      "type": "object",
      "properties": {
        "handler_id": {
          "type": "string",
          "const": "academy.hosted_stripe"
        },
        "instrument": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "hosted_checkout"
            },
            "credential": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "checkout_session"
                },
                "token": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 240
                }
              },
              "required": [
                "type",
                "token"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "type",
            "credential"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "handler_id",
        "instrument"
      ],
      "additionalProperties": false
    },
    "buyer": {
      "type": "object",
      "properties": {
        "first_name": {
          "type": "string",
          "maxLength": 200
        },
        "last_name": {
          "type": "string",
          "maxLength": 200
        },
        "email": {
          "type": "string",
          "format": "email",
          "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "payment_data"
  ],
  "additionalProperties": false
}