{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/curacel/json-schema/curacel-travel-purchase-data-schema.json",
  "title": "TravelPurchaseData",
  "x-generated": "2026-11-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/curacel-openapi-openapi.yml#/components/schemas/TravelPurchaseData",
  "type": "object",
  "required": [
    "product_code",
    "customer_ref",
    "policy_start_date",
    "travel_purpose",
    "travel_duration",
    "passport_number",
    "passport_attachment_id"
  ],
  "properties": {
    "product_code": {
      "type": "string",
      "description": "The code of an approved, non-archived product available to the authenticated partner."
    },
    "customer_ref": {
      "type": "string",
      "description": "The reference of a customer belonging to the authenticated partner."
    },
    "payment_type": {
      "type": "string",
      "enum": [
        "wallet",
        "web_link",
        "card"
      ],
      "description": "How the order will be paid. If omitted, the authenticated partner's configured payment option is used."
    },
    "policy_start_date": {
      "type": "string",
      "format": "date",
      "description": "the start date of the intended policy coverage"
    },
    "asset_ref": {
      "type": [
        "string",
        "null"
      ],
      "description": "An external reference stored on the order and included in relevant webhooks."
    },
    "travel_purpose": {
      "type": "string",
      "description": "Purpose of travel",
      "enum": [
        "Business",
        "Tourism",
        "Study",
        "Pilgrimage"
      ]
    },
    "travel_duration": {
      "type": "integer",
      "minimum": 1,
      "maximum": 365,
      "description": "The number of travel days."
    },
    "passport_number": {
      "type": "string",
      "description": "international passport number"
    },
    "passport_attachment_id": {
      "type": "integer",
      "description": "upload the internation passport using the attachments endpoint and supply the Id"
    },
    "nationality": {
      "type": "string",
      "description": "Optional- The nationality of customer next of kin. Provide if missing from the customer record"
    },
    "address": {
      "type": "string",
      "description": "Optional- The address of customer Provide if `residential_address` is  missing from the customer record"
    },
    "state": {
      "type": "string",
      "description": "Optional- The state of customer''s address. Provide if missing from the customer record"
    },
    "country": {
      "type": "string",
      "description": "Optional- The country of customer''s address. Provide if missing from the customer record"
    },
    "next_of_kin_name": {
      "type": "string",
      "description": "Optional- The name of customer''s next of kin. Provide if missing from the customer record"
    },
    "next_of_kin_phone": {
      "type": "string",
      "description": "Optional- The phone of customers''s next of kin. Provide if missing from the customer record"
    },
    "travellers": {
      "type": "array",
      "description": "If the customer is travelling with others and wishes to purchase same insurance for them, then the detials of the extra travellers should be specified here.",
      "items": {
        "type": "object",
        "required": [
          "personal_info",
          "contact_info",
          "travel_info"
        ],
        "properties": {
          "personal_info": {
            "type": "object",
            "required": [
              "first_name",
              "last_name",
              "sex",
              "birth_date",
              "nationality",
              "next_of_kin_name",
              "next_of_kin_phone"
            ],
            "properties": {
              "first_name": {
                "type": "string"
              },
              "last_name": {
                "type": "string"
              },
              "sex": {
                "type": "string",
                "enum": [
                  "M",
                  "F"
                ],
                "description": "Must be either M or F"
              },
              "birth_date": {
                "type": "string",
                "format": "date",
                "description": "Traveller's date of birth e.g 1990-10-10"
              },
              "nationality": {
                "type": "string"
              },
              "next_of_kin_name": {
                "type": "string",
                "description": "The name of traveller's next of kin"
              },
              "next_of_kin_phone": {
                "type": "string",
                "description": "The phone of traveller's next of kin"
              }
            }
          },
          "contact_info": {
            "type": "object",
            "required": [
              "email",
              "phone",
              "address",
              "state",
              "country"
            ],
            "properties": {
              "email": {
                "type": "string",
                "format": "email",
                "description": "traveller's email address."
              },
              "phone": {
                "type": "string",
                "description": "Traveller's phone number."
              },
              "address": {
                "type": "string"
              },
              "state": {
                "type": "string"
              },
              "country": {
                "type": "string"
              }
            }
          },
          "travel_info": {
            "type": "object",
            "required": [
              "travel_purpose",
              "passport_number",
              "passport_attachment_id"
            ],
            "properties": {
              "travel_purpose": {
                "type": "string",
                "description": "Purpose of travel",
                "enum": [
                  "Business",
                  "Tourism",
                  "Study",
                  "Pilgrimage"
                ]
              },
              "passport_number": {
                "type": "string",
                "description": "international passport number"
              },
              "passport_attachment_id": {
                "type": "integer",
                "description": "upload the internation passport using the attachments endpoint and supply the Id"
              }
            }
          }
        }
      }
    },
    "child_partner_id": {
      "type": "string",
      "description": "The key of a child partner belonging to the authenticated parent partner."
    }
  }
}