{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/carshelpingkids-org/json-schema/carshelpingkids-org-authorized-donation-request-schema.json",
  "title": "AuthorizedDonationRequest",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/carshelpingkids-org-api-openapi.json#/components/schemas/AuthorizedDonationRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "submission_id",
    "donor_authorized",
    "donor",
    "vehicle",
    "pickup"
  ],
  "properties": {
    "submission_id": {
      "type": "string",
      "format": "uuid",
      "description": "Generate once for a new donation attempt and reuse unchanged for retries."
    },
    "donor_authorized": {
      "type": "boolean",
      "const": true,
      "description": "True only after the donor gives the complete authorization described by this operation."
    },
    "donor": {
      "$ref": "#/$defs/Donor"
    },
    "vehicle": {
      "$ref": "#/$defs/Vehicle"
    },
    "pickup": {
      "$ref": "#/$defs/Pickup"
    },
    "notes": {
      "type": "string",
      "maxLength": 500,
      "default": ""
    }
  },
  "$defs": {
    "Donor": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "phone"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "phone": {
          "type": "string",
          "minLength": 10,
          "maxLength": 40,
          "description": "Must contain at least 10 digits."
        },
        "email": {
          "anyOf": [
            {
              "type": "string",
              "format": "email",
              "maxLength": 254
            },
            {
              "type": "string",
              "const": ""
            }
          ],
          "default": ""
        }
      }
    },
    "Pickup": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "zip"
      ],
      "properties": {
        "zip": {
          "type": "string",
          "pattern": "^[0-9]{5}$"
        },
        "city": {
          "type": "string",
          "maxLength": 100,
          "default": ""
        },
        "state": {
          "type": "string",
          "maxLength": 50,
          "default": ""
        },
        "access": {
          "type": "string",
          "enum": [
            "standard_tow_access",
            "limited_or_special_access",
            "unknown"
          ],
          "default": "unknown"
        },
        "timing": {
          "type": "string",
          "enum": [
            "as_soon_as_possible",
            "within_7_days",
            "within_30_days",
            "flexible",
            "unknown"
          ],
          "default": "unknown"
        }
      }
    },
    "Vehicle": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "year",
        "make",
        "model",
        "condition",
        "title_status",
        "lien_status"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Car",
            "Truck",
            "SUV",
            "Motorcycle",
            "RV",
            "Boat",
            "Trailer",
            "Other"
          ]
        },
        "year": {
          "type": "integer",
          "minimum": 1886,
          "maximum": 2028
        },
        "make": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "model": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "condition": {
          "type": "string",
          "enum": [
            "runs_and_drives",
            "starts_not_drivable",
            "does_not_run",
            "wrecked_or_incomplete",
            "unknown"
          ]
        },
        "title_status": {
          "type": "string",
          "enum": [
            "title_in_hand",
            "title_missing",
            "title_issue",
            "unknown"
          ]
        },
        "lien_status": {
          "type": "string",
          "enum": [
            "no_lien",
            "lien_exists",
            "unknown"
          ]
        },
        "keys": {
          "type": "string",
          "enum": [
            "yes",
            "no",
            "unknown"
          ],
          "default": "unknown"
        }
      }
    }
  }
}