{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/track/json-schema/track-onboarding-schema.json",
  "title": "Onboarding",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/track-payments-api-openapi.yml#/components/schemas/Onboarding",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "customer_type": {
      "$ref": "#/$defs/CustomerTypeEnum"
    },
    "customer_ref": {
      "type": [
        "string",
        "null"
      ]
    },
    "snapshot": {
      "$ref": "#/$defs/OnboardingState"
    },
    "observed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "required": [
    "customer_ref",
    "customer_type",
    "email",
    "id",
    "name",
    "observed_at",
    "snapshot"
  ],
  "$defs": {
    "CustomerTypeEnum": {
      "enum": [
        "individual",
        "business"
      ],
      "type": "string",
      "description": "* `individual` - Individual\n* `business` - Business"
    },
    "OnboardingState": {
      "type": "object",
      "properties": {
        "next_action": {
          "$ref": "#/$defs/OnboardingStateNextActionEnum"
        },
        "agreements": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RequiredAgreement"
          }
        },
        "verification": {
          "allOf": [
            {
              "$ref": "#/$defs/Verification"
            }
          ]
        },
        "feedback": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "unresolved_operation": {
          "type": "boolean"
        }
      },
      "required": [
        "agreements",
        "feedback",
        "next_action",
        "unresolved_operation",
        "verification"
      ]
    },
    "OnboardingStateNextActionEnum": {
      "enum": [
        "correct_registration",
        "accept_agreement",
        "start",
        "resume",
        "wait",
        "complete",
        "support",
        "restart"
      ],
      "type": "string",
      "description": "* `correct_registration` - correct_registration\n* `accept_agreement` - accept_agreement\n* `start` - start\n* `resume` - resume\n* `wait` - wait\n* `complete` - complete\n* `support` - support\n* `restart` - restart"
    },
    "RequiredAgreement": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        }
      },
      "required": [
        "display_name",
        "id",
        "url"
      ]
    },
    "Verification": {
      "type": "object",
      "properties": {
        "reference": {
          "type": "string"
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "reason": {
          "type": "string"
        }
      },
      "required": [
        "reason",
        "reference",
        "url"
      ]
    }
  }
}