{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/totalparks-com-au/json-schema/totalparks-com-au-create-cart-request-schema.json",
  "title": "CreateCartRequest",
  "description": "``POST /carts`` body.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/totalparks-com-au-openapi.json#/components/schemas/CreateCartRequest",
  "properties": {
    "single_stay_seed": {
      "anyOf": [
        {
          "$ref": "#/$defs/SingleStaySeed"
        },
        {
          "type": "null"
        }
      ]
    },
    "commit_strategy": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Commit Strategy",
      "description": "Reserved. Only 'atomic' is supported."
    },
    "created_via": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 50
        },
        {
          "type": "null"
        }
      ],
      "title": "Created Via",
      "description": "Creator hint for analytics (e.g. 'gui', 'cursor', 'mcp', 'embed')."
    },
    "watch_landing_token": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ],
      "title": "Watch Landing Token",
      "description": "Signed availability-watch landing token from an alert booking link. A valid token for this property stamps checkout on that alert. A bad or mismatched token is ignored."
    },
    "embed_integrator": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 100
        },
        {
          "type": "null"
        }
      ],
      "title": "Embed Integrator",
      "description": "Embed attribution: the non-secret `data-integrator` id (e.g. 'ccia-nsw') self-reported by the embeddable-checkout iframe. Only meaningful when `created_via='embed'`."
    },
    "embed_parent_origin": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Embed Parent Origin",
      "description": "Embed attribution: the aggregator origin that framed the widget, resolved by the iframe from `ancestorOrigins` / `document.referrer`. Only meaningful when `created_via='embed'`."
    },
    "acquisition_source": {
      "anyOf": [
        {
          "$ref": "#/$defs/AcquisitionSourceInput"
        },
        {
          "type": "null"
        }
      ],
      "description": "Landing source for this booking: external referrer origin and utm labels. Sent even when analytics consent is still unknown. Click ids are ignored."
    }
  },
  "type": "object",
  "$defs": {
    "AcquisitionSourceInput": {
      "properties": {
        "referrer_origin": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ],
          "title": "Referrer Origin"
        },
        "utm_source": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 100
            },
            {
              "type": "null"
            }
          ],
          "title": "Utm Source"
        },
        "utm_medium": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 100
            },
            {
              "type": "null"
            }
          ],
          "title": "Utm Medium"
        },
        "utm_campaign": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 160
            },
            {
              "type": "null"
            }
          ],
          "title": "Utm Campaign"
        },
        "utm_term": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 100
            },
            {
              "type": "null"
            }
          ],
          "title": "Utm Term"
        },
        "utm_content": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 100
            },
            {
              "type": "null"
            }
          ],
          "title": "Utm Content"
        }
      },
      "type": "object",
      "title": "AcquisitionSourceInput",
      "description": "Landing source sent with cart creation. Click ids are ignored."
    },
    "EquipmentSchema": {
      "properties": {
        "type": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 50
            },
            {
              "type": "null"
            }
          ],
          "title": "Type",
          "description": "Canonical equipment type (e.g. caravan, motorhome, camper_trailer)."
        },
        "length_m": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 30,
              "minimum": 1
            },
            {
              "type": "null"
            }
          ],
          "title": "Length M",
          "description": "Equipment length in metres."
        },
        "power_required": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Power Required",
          "description": "Whether powered site is required."
        }
      },
      "type": "object",
      "title": "EquipmentSchema",
      "description": "Per-line equipment declaration (caravan/motorhome details)."
    },
    "PetBreedAttestation": {
      "properties": {
        "attested_at": {
          "type": "string",
          "format": "date-time",
          "title": "Attested At",
          "description": "When the guest confirmed their pet is not a restricted breed."
        },
        "restricted_list_snapshot": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Restricted List Snapshot",
          "description": "Restricted breed slugs shown to the guest at attestation time."
        }
      },
      "type": "object",
      "required": [
        "attested_at",
        "restricted_list_snapshot"
      ],
      "title": "PetBreedAttestation",
      "description": "Guest attestation for property-level restricted breed lists."
    },
    "PetDeclaration": {
      "properties": {
        "traveling_with_pets": {
          "type": "boolean",
          "title": "Traveling With Pets",
          "description": "Whether the guest is travelling with pets.",
          "default": false
        },
        "pet_count": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 6,
              "minimum": 1
            },
            {
              "type": "null"
            }
          ],
          "title": "Pet Count",
          "description": "Number of pets travelling."
        },
        "pet_type": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 50
            },
            {
              "type": "null"
            }
          ],
          "title": "Pet Type",
          "description": "Primary pet type (e.g. dog)."
        },
        "pet_size": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "small",
                "medium",
                "large"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Pet Size",
          "description": "Optional pet size declaration."
        },
        "pet_weight_kg": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 200,
              "minimum": 0.1
            },
            {
              "type": "null"
            }
          ],
          "title": "Pet Weight Kg",
          "description": "Optional pet weight in kilograms."
        },
        "pet_breed_attestation": {
          "anyOf": [
            {
              "$ref": "#/$defs/PetBreedAttestation"
            },
            {
              "type": "null"
            }
          ],
          "description": "Guest attestation against the property's restricted breed list."
        }
      },
      "type": "object",
      "title": "PetDeclaration",
      "description": "Pet declaration captured during checkout."
    },
    "SingleStaySeed": {
      "properties": {
        "property_id": {
          "type": "integer",
          "title": "Property Id",
          "description": "Total Parks property ID."
        },
        "room_type_id": {
          "type": "integer",
          "title": "Room Type Id",
          "description": "Room type to book."
        },
        "check_in": {
          "type": "string",
          "format": "date",
          "title": "Check In",
          "description": "Check-in date."
        },
        "check_out": {
          "type": "string",
          "format": "date",
          "title": "Check Out",
          "description": "Check-out date."
        },
        "adults": {
          "type": "integer",
          "minimum": 1,
          "title": "Adults",
          "default": 2
        },
        "children": {
          "type": "integer",
          "minimum": 0,
          "title": "Children",
          "default": 0
        },
        "infants": {
          "type": "integer",
          "minimum": 0,
          "title": "Infants",
          "default": 0
        },
        "pet_declaration": {
          "anyOf": [
            {
              "$ref": "#/$defs/PetDeclaration"
            },
            {
              "type": "null"
            }
          ]
        },
        "equipment": {
          "anyOf": [
            {
              "$ref": "#/$defs/EquipmentSchema"
            },
            {
              "type": "null"
            }
          ]
        },
        "lead_guest_override": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Lead Guest Override"
        },
        "special_requests": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 500
            },
            {
              "type": "null"
            }
          ],
          "title": "Special Requests"
        },
        "requested_room_name": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "Requested Room Name",
          "description": "What the guest asked for, when an assistant books a different room or site. The site does not send this."
        },
        "promo_code": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 50
            },
            {
              "type": "null"
            }
          ],
          "title": "Promo Code",
          "description": "Optional promo code to attempt to apply on cart creation. Powers the tracked-link pre-apply path (?promo=CODE on a property URL). Failures emit a non-blocking ``CartWarning`` so the cart is created either way."
        }
      },
      "type": "object",
      "required": [
        "property_id",
        "room_type_id",
        "check_in",
        "check_out"
      ],
      "title": "SingleStaySeed",
      "description": "Convenience payload for the existing 'Book Now' path.\n\nPassed as ``single_stay_seed`` on ``POST /carts`` to atomically create\nCart + CartStay + CartLine in one call."
    }
  }
}