{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/totalparks-com-au/json-schema/totalparks-com-au-booking-detail-response-schema.json",
  "title": "BookingDetailResponse",
  "description": "Detailed booking response for confirmation page.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/totalparks-com-au-openapi.json#/components/schemas/BookingDetailResponse",
  "properties": {
    "booking_id": {
      "type": "integer",
      "title": "Booking Id",
      "description": "Total Parks booking ID"
    },
    "confirmation_number": {
      "type": "string",
      "title": "Confirmation Number",
      "description": "Bearer-secret confirmation number. Used in `?ref=...` URLs and the unauthenticated `GET /bookings/ref/{confirmation_number}` lookup. **Do not display to humans — use `booking_code` instead.**"
    },
    "pms_confirmation_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pms Confirmation Id",
      "description": "PMS confirmation/reservation ID"
    },
    "status": {
      "type": "string",
      "title": "Status",
      "description": "Reservation status (e.g., 'confirmed')"
    },
    "payment_status": {
      "type": "string",
      "title": "Payment Status",
      "description": "Payment status (e.g., 'succeeded')"
    },
    "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",
      "title": "Adults",
      "description": "Number of adults"
    },
    "children": {
      "type": "integer",
      "title": "Children",
      "description": "Number of children",
      "default": 0
    },
    "infants": {
      "type": "integer",
      "title": "Infants",
      "description": "Number of infants",
      "default": 0
    },
    "total": {
      "type": "string",
      "title": "Total",
      "description": "Accommodation subtotal (PMS nightly rates only). Excludes pet_fee_total and service_fee."
    },
    "pet_fee_total": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pet Fee Total",
      "description": "Pet fee charged to the guest (park revenue, refundable). None for legacy bookings; treat as zero."
    },
    "service_fee": {
      "type": "string",
      "title": "Service Fee",
      "description": "Total Parks service fee"
    },
    "grand_total": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Grand Total",
      "description": "Total Stripe charge amount (total + pet_fee_total + service_fee)."
    },
    "currency": {
      "type": "string",
      "title": "Currency",
      "description": "Currency code (ISO 4217)"
    },
    "discount_amount": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Discount Amount",
      "description": "Realised discount applied to the accommodation total. Null on legacy or non-promo bookings; treat as zero. The confirmation page renders a `Discount` row when this is > 0."
    },
    "campaign_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Campaign Id",
      "description": "Total Parks campaign id."
    },
    "promo_code": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 50
        },
        {
          "type": "null"
        }
      ],
      "title": "Promo Code",
      "description": "Canonical promo code applied to this booking."
    },
    "guest_first_name": {
      "type": "string",
      "title": "Guest First Name",
      "description": "Guest's first name"
    },
    "guest_last_name": {
      "type": "string",
      "title": "Guest Last Name",
      "description": "Guest's last name"
    },
    "guest_email": {
      "type": "string",
      "title": "Guest Email",
      "description": "Guest's email address"
    },
    "guest_phone": {
      "type": "string",
      "title": "Guest Phone",
      "description": "Guest's phone number"
    },
    "special_requests": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Special Requests",
      "description": "Guest comments"
    },
    "property_id": {
      "type": "integer",
      "title": "Property Id",
      "description": "Property ID"
    },
    "property_name": {
      "type": "string",
      "title": "Property Name",
      "description": "Property name"
    },
    "property_slug": {
      "type": "string",
      "title": "Property Slug",
      "description": "Property URL slug"
    },
    "property_state": {
      "type": "string",
      "title": "Property State",
      "description": "Property state"
    },
    "property_address": {
      "type": "string",
      "title": "Property Address",
      "description": "Property address"
    },
    "property_email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Property Email",
      "description": "Property contact email"
    },
    "property_phone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Property Phone",
      "description": "Property contact phone"
    },
    "room_type_id": {
      "type": "integer",
      "title": "Room Type Id",
      "description": "Room type ID"
    },
    "room_type_name": {
      "type": "string",
      "title": "Room Type Name",
      "description": "Room type name"
    },
    "room_type_slug": {
      "type": "string",
      "title": "Room Type Slug",
      "description": "Room type URL slug"
    },
    "pet_booking_mode": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pet Booking Mode",
      "description": "Effective pet booking mode applied to this booking."
    },
    "pet_declaration": {
      "anyOf": [
        {
          "$ref": "#/$defs/PetDeclaration"
        },
        {
          "type": "null"
        }
      ],
      "description": "Captured pet declaration for this booking."
    },
    "equipment_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Equipment Type",
      "description": "Canonical equipment type (e.g. 'caravan', 'motorhome'). Set at booking time for site bookings; always None for cabins and for legacy bookings pre-dating migration 096."
    },
    "equipment_length": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Equipment Length",
      "description": "Equipment length in metres (site bookings only)."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "Booking creation timestamp"
    },
    "is_linked_to_account": {
      "type": "boolean",
      "title": "Is Linked To Account",
      "description": "Whether this booking is linked to a user account",
      "default": false
    },
    "group": {
      "anyOf": [
        {
          "$ref": "#/$defs/BookingGroupSummary"
        },
        {
          "type": "null"
        }
      ],
      "description": "Set when this booking is one line of a multi-room group; lists every line and the group totals."
    },
    "checkout": {
      "anyOf": [
        {
          "$ref": "#/$defs/CheckoutSummary"
        },
        {
          "type": "null"
        }
      ],
      "description": "Every stay and the one payment of a multi-stay checkout. Set only when the lookup used the checkout's ``TPC-`` bearer; the top-level fields then describe the first stay's first booking."
    },
    "checkout_pointer": {
      "anyOf": [
        {
          "$ref": "#/$defs/CheckoutPointer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Set when this booking belongs to a multi-stay checkout: its display code and stay count, without the other parks' stays."
    },
    "booking_code": {
      "type": "string",
      "title": "Booking Code",
      "description": "Human-readable short code derived from ``confirmation_number``.",
      "readOnly": true
    }
  },
  "type": "object",
  "required": [
    "booking_id",
    "confirmation_number",
    "status",
    "payment_status",
    "check_in",
    "check_out",
    "adults",
    "total",
    "service_fee",
    "currency",
    "guest_first_name",
    "guest_last_name",
    "guest_email",
    "guest_phone",
    "property_id",
    "property_name",
    "property_slug",
    "property_state",
    "property_address",
    "room_type_id",
    "room_type_name",
    "room_type_slug",
    "created_at",
    "booking_code"
  ],
  "$defs": {
    "BookingGroupLine": {
      "properties": {
        "booking_id": {
          "type": "integer",
          "title": "Booking Id",
          "description": "Total Parks booking ID for this line"
        },
        "booking_code": {
          "type": "string",
          "title": "Booking Code",
          "description": "Human-readable code for this line. The sibling's bearer-secret confirmation_number is never exposed here."
        },
        "position": {
          "type": "integer",
          "title": "Position",
          "description": "0-based line position; 0 is the primary"
        },
        "status": {
          "type": "string",
          "title": "Status",
          "description": "Reservation status of this line"
        },
        "room_type_id": {
          "type": "integer",
          "title": "Room Type Id"
        },
        "room_type_name": {
          "type": "string",
          "title": "Room Type Name"
        },
        "adults": {
          "type": "integer",
          "title": "Adults"
        },
        "children": {
          "type": "integer",
          "title": "Children",
          "default": 0
        },
        "infants": {
          "type": "integer",
          "title": "Infants",
          "default": 0
        },
        "equipment_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Equipment Type"
        },
        "equipment_length": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Equipment Length"
        },
        "pet_declaration": {
          "anyOf": [
            {
              "$ref": "#/$defs/PetDeclaration"
            },
            {
              "type": "null"
            }
          ]
        },
        "special_requests": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Special Requests"
        },
        "guest_first_name": {
          "type": "string",
          "title": "Guest First Name",
          "description": "Lead guest for this line"
        },
        "guest_last_name": {
          "type": "string",
          "title": "Guest Last Name",
          "description": "Lead guest for this line"
        },
        "pms_reference": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pms Reference",
          "description": "This line's own park (PMS) reservation reference, when assigned. Never the TP confirmation number: NewBook children use their UniqueID (the TP confirmation number) as pms_confirmation_id, so the NewBook reservation ID is shown instead."
        },
        "total": {
          "type": "string",
          "title": "Total",
          "description": "Accommodation subtotal (pre-discount)"
        },
        "pet_fee_total": {
          "type": "string",
          "title": "Pet Fee Total",
          "default": "0"
        },
        "discount_amount": {
          "type": "string",
          "title": "Discount Amount",
          "default": "0"
        },
        "service_fee": {
          "type": "string",
          "title": "Service Fee",
          "description": "Allocated share of the cart service fee"
        },
        "grand_total": {
          "type": "string",
          "title": "Grand Total",
          "description": "This line's share of the one charge"
        }
      },
      "type": "object",
      "required": [
        "booking_id",
        "booking_code",
        "position",
        "status",
        "room_type_id",
        "room_type_name",
        "adults",
        "guest_first_name",
        "guest_last_name",
        "total",
        "service_fee",
        "grand_total"
      ],
      "title": "BookingGroupLine",
      "description": "One room/site of a group booking, as shown to the guest who paid."
    },
    "BookingGroupSummary": {
      "properties": {
        "reference": {
          "type": "string",
          "title": "Reference",
          "description": "Group display reference: the primary (position 0) booking's booking_code. There is no separate cart-level identifier."
        },
        "line_count": {
          "type": "integer",
          "title": "Line Count"
        },
        "position": {
          "type": "integer",
          "title": "Position",
          "description": "Position of the looked-up booking within the group"
        },
        "total": {
          "type": "string",
          "title": "Total",
          "description": "Sum of line accommodation subtotals"
        },
        "pet_fee_total": {
          "type": "string",
          "title": "Pet Fee Total"
        },
        "discount_amount": {
          "type": "string",
          "title": "Discount Amount"
        },
        "service_fee": {
          "type": "string",
          "title": "Service Fee",
          "description": "The one cart service fee"
        },
        "grand_total": {
          "type": "string",
          "title": "Grand Total",
          "description": "The one Stripe charge amount"
        },
        "currency": {
          "type": "string",
          "title": "Currency"
        },
        "bookings": {
          "items": {
            "$ref": "#/$defs/BookingGroupLine"
          },
          "type": "array",
          "title": "Bookings",
          "description": "Every line in stable position order"
        }
      },
      "type": "object",
      "required": [
        "reference",
        "line_count",
        "position",
        "total",
        "pet_fee_total",
        "discount_amount",
        "service_fee",
        "grand_total",
        "currency",
        "bookings"
      ],
      "title": "BookingGroupSummary",
      "description": "Group booking: N lines paid with one PaymentIntent."
    },
    "CheckoutPayment": {
      "properties": {
        "grand_total": {
          "type": "string",
          "title": "Grand Total",
          "description": "The one Stripe charge amount"
        },
        "currency": {
          "type": "string",
          "title": "Currency"
        },
        "payment_status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Payment Status"
        },
        "statement_descriptor_suffix": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Statement Descriptor Suffix"
        },
        "statement_descriptor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Statement Descriptor",
          "description": "The card statement line, ``{prefix}* {suffix}``; null when the platform prefix is not configured."
        }
      },
      "type": "object",
      "required": [
        "grand_total",
        "currency"
      ],
      "title": "CheckoutPayment",
      "description": "The one charge that paid for every stay."
    },
    "CheckoutPointer": {
      "properties": {
        "checkout_code": {
          "type": "string",
          "title": "Checkout Code"
        },
        "stays_count": {
          "type": "integer",
          "title": "Stays Count"
        }
      },
      "type": "object",
      "required": [
        "checkout_code",
        "stays_count"
      ],
      "title": "CheckoutPointer",
      "description": "That a booking belongs to a multi-stay checkout, without its other parks."
    },
    "CheckoutStay": {
      "properties": {
        "stay_id": {
          "type": "integer",
          "title": "Stay Id"
        },
        "property_id": {
          "type": "integer",
          "title": "Property Id"
        },
        "property_name": {
          "type": "string",
          "title": "Property Name"
        },
        "property_slug": {
          "type": "string",
          "title": "Property Slug"
        },
        "property_state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Property State"
        },
        "property_address": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Property Address"
        },
        "property_email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Property Email"
        },
        "property_phone": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Property Phone"
        },
        "cancellation_policy_note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cancellation Policy Note",
          "description": "The park's free-text cancellation terms, when it has any."
        },
        "check_in": {
          "type": "string",
          "format": "date",
          "title": "Check In",
          "description": "Earliest line check-in"
        },
        "check_out": {
          "type": "string",
          "format": "date",
          "title": "Check Out",
          "description": "Latest line check-out"
        },
        "line_count": {
          "type": "integer",
          "title": "Line Count"
        },
        "lines": {
          "items": {
            "$ref": "#/$defs/BookingGroupLine"
          },
          "type": "array",
          "title": "Lines",
          "description": "Every room or site of this stay in line order, each with that park's own booking_code. Never a booking's confirmation_number."
        },
        "total": {
          "type": "string",
          "title": "Total",
          "description": "Accommodation subtotal (pre-discount)"
        },
        "pet_fee_total": {
          "type": "string",
          "title": "Pet Fee Total"
        },
        "discount_amount": {
          "type": "string",
          "title": "Discount Amount"
        },
        "service_fee": {
          "type": "string",
          "title": "Service Fee",
          "description": "This stay's own service fee (D-03)"
        },
        "grand_total": {
          "type": "string",
          "title": "Grand Total",
          "description": "This stay's share of the one charge"
        },
        "currency": {
          "type": "string",
          "title": "Currency"
        }
      },
      "type": "object",
      "required": [
        "stay_id",
        "property_id",
        "property_name",
        "property_slug",
        "check_in",
        "check_out",
        "line_count",
        "lines",
        "total",
        "pet_fee_total",
        "discount_amount",
        "service_fee",
        "grand_total",
        "currency"
      ],
      "title": "CheckoutStay",
      "description": "One park's stay in a multi-stay checkout."
    },
    "CheckoutSummary": {
      "properties": {
        "checkout_code": {
          "type": "string",
          "title": "Checkout Code",
          "description": "The ``TPC-`` display code (``TPC-`` plus 8 hex characters). Labelled \"Total Parks reference\"; not a lookup key."
        },
        "stays_count": {
          "type": "integer",
          "title": "Stays Count"
        },
        "line_count": {
          "type": "integer",
          "title": "Line Count"
        },
        "stays": {
          "items": {
            "$ref": "#/$defs/CheckoutStay"
          },
          "type": "array",
          "title": "Stays",
          "description": "Every stay in date order (earliest check-in first)."
        },
        "payment": {
          "$ref": "#/$defs/CheckoutPayment"
        },
        "payer_email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Payer Email",
          "description": "Where the checkout's one confirmation email went: the payer's (billing guest's) email. A line's lead guest can carry another email on its own booking, so the top-level ``guest_email`` of a ref lookup is not always this."
        }
      },
      "type": "object",
      "required": [
        "checkout_code",
        "stays_count",
        "line_count",
        "stays",
        "payment"
      ],
      "title": "CheckoutSummary",
      "description": "A checkout that booked stays at several parks on one payment (D-04).\n\nReturned only for the ``TPC-`` bearer, never for one booking's own\nconfirmation number, because each park holds its own booking's number."
    },
    "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."
    }
  }
}