{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cookiy-ai/json-schema/cookiy-ai-v1-study-checkout-response-dto-schema.json",
  "title": "V1StudyCheckoutResponseDto",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cookiy-ai-openapi.yml#/components/schemas/V1StudyCheckoutResponseDto",
  "type": "object",
  "properties": {
    "study_id": {
      "type": "string",
      "x-nestjs_zod-uses-3-point-1-syntax": true
    },
    "outcome": {
      "type": "string",
      "enum": [
        "started",
        "partially_started"
      ],
      "x-nestjs_zod-uses-3-point-1-syntax": true
    },
    "quote": {
      "type": "object",
      "properties": {
        "balance_cents_before": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "real_cost_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "synthetic_cost_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "total_cost_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "balance_cents_before",
        "real_cost_cents",
        "synthetic_cost_cents",
        "total_cost_cents"
      ],
      "x-nestjs_zod-uses-3-point-1-syntax": true,
      "x-nestjs_zod-self-required": true
    },
    "synthetic": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "skipped",
            "queued",
            "failed"
          ]
        },
        "result": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "study_id": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "running",
                    "ready",
                    "failed"
                  ]
                },
                "batch_target": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "batch_completed": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "recruit_progress_webpage_url": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "study_id",
                "status",
                "batch_target",
                "batch_completed",
                "recruit_progress_webpage_url"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "error": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "status_code": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "code": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "message": {
                  "type": "string"
                },
                "details": {
                  "anyOf": [
                    {},
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "status_code",
                "code",
                "message",
                "details"
              ]
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "status",
        "result",
        "error"
      ],
      "x-nestjs_zod-uses-3-point-1-syntax": true,
      "x-nestjs_zod-self-required": true
    },
    "real": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "skipped",
            "started",
            "failed"
          ]
        },
        "result": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "status": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "workflow_state": {
                  "type": "string"
                },
                "target_participants": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "incremental_participants": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "total_participants_after": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "launched": {
                  "anyOf": [
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "recruit_progress_webpage_url": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "status",
                "workflow_state",
                "target_participants",
                "total_participants_after",
                "launched"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "error": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "status_code": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "code": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "message": {
                  "type": "string"
                },
                "details": {
                  "anyOf": [
                    {},
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "status_code",
                "code",
                "message",
                "details"
              ]
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "status",
        "result",
        "error"
      ],
      "x-nestjs_zod-uses-3-point-1-syntax": true,
      "x-nestjs_zod-self-required": true
    }
  },
  "required": [
    "study_id",
    "outcome",
    "quote",
    "synthetic",
    "real"
  ]
}