{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://api.wikiup.app/listing-partner-requests.schema.json",
  "title": "Listing partner requests",
  "$defs": {
    "Request": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable request ID."
        },
        "propertyId": {
          "type": "string",
          "description": "Raw property ID."
        },
        "propertyName": {
          "type": "string",
          "description": "Current public property name."
        },
        "affiliateId": {
          "type": "string",
          "description": "Intended affiliate account ID."
        },
        "affiliateName": {
          "type": "string",
          "description": "Current affiliate display name."
        },
        "affiliateWebsite": {
          "type": [
            "string",
            "null"
          ],
          "description": "Affiliate website or null if unavailable."
        },
        "status": {
          "type": "string",
          "description": "Single listing lifecycle state. Only approved can appear publicly; neither party can clear the other\u2019s suspension.",
          "enum": [
            "pending",
            "approved",
            "denied",
            "owner_suspended",
            "affiliate_suspended",
            "both_suspended",
            "withdrawn",
            "removed"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ],
          "description": "Trimmed denial reason (1\u20132000 characters); null unless denied."
        },
        "submittedAt": {
          "type": "string",
          "description": "Submission time in the property timezone, including numeric offset.",
          "format": "date-time"
        },
        "decidedAt": {
          "type": [
            "string",
            "null"
          ],
          "description": "Approval/denial time in the property timezone, or null if not decided. Suspension/removal preserves this value.",
          "format": "date-time"
        },
        "timeZone": {
          "type": "string",
          "description": "Property IANA timezone, e.g. America/Los_Angeles."
        }
      },
      "required": [
        "id",
        "propertyId",
        "propertyName",
        "affiliateId",
        "affiliateName",
        "affiliateWebsite",
        "status",
        "reason",
        "submittedAt",
        "decidedAt",
        "timeZone"
      ],
      "additionalProperties": false,
      "description": "A property request addressed to one affiliate. Private notification and ownership data are excluded."
    },
    "Partner": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Affiliate account ID; send as affiliateId when requesting."
        },
        "name": {
          "type": "string",
          "description": "Partner display name."
        },
        "website": {
          "type": "string",
          "description": "Partner website or social profile HTTPS URL."
        },
        "imageUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "Affiliate card image under /api/web-assets/affilate-profile-pics/{uid}/, or null when absent."
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 500,
          "description": "Affiliate card description, plain text; null when absent."
        },
        "region": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 120,
          "description": "Affiliate card region, plain text; null when absent."
        }
      },
      "required": [
        "id",
        "name",
        "website"
      ],
      "additionalProperties": false,
      "description": "Active affiliate available for an owner request."
    },
    "Page": {
      "type": "object",
      "properties": {
        "page": {
          "type": "integer",
          "description": "Current one-based page.",
          "minimum": 1
        },
        "pageSize": {
          "type": "integer",
          "description": "Requested page size; defaults to 12, maximum 50.",
          "minimum": 1,
          "maximum": 50
        },
        "nextPage": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Next page, or null when no further records remain."
        }
      },
      "required": [
        "page",
        "pageSize",
        "nextPage"
      ],
      "additionalProperties": false,
      "description": "Explicit pagination."
    },
    "ImageVariant": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Public versioned photo URL. Use the returned URL unchanged; it contains no API key."
        },
        "width": {
          "type": "integer",
          "minimum": 1,
          "description": "Actual image width in pixels; do not assume the nominal thumbnail width."
        },
        "height": {
          "type": "integer",
          "minimum": 1,
          "description": "Actual image height in pixels; preserve its aspect ratio."
        },
        "format": {
          "enum": [
            "avif",
            "webp",
            "jpeg",
            "png"
          ],
          "description": "Encoded thumbnail image format."
        }
      },
      "required": [
        "url",
        "width",
        "height",
        "format"
      ],
      "additionalProperties": false,
      "description": "Response structure: ImageVariant."
    },
    "PublicImage": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable identifier of this resource; preserve it unchanged."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Public versioned photo URL. Use the returned URL unchanged; it contains no API key."
        },
        "alt": {
          "type": "string",
          "description": "Image alternative text for accessible presentation."
        },
        "width": {
          "type": "integer",
          "minimum": 1,
          "description": "Actual image width in pixels; do not assume the nominal thumbnail width."
        },
        "height": {
          "type": "integer",
          "minimum": 1,
          "description": "Actual image height in pixels; preserve its aspect ratio."
        },
        "variants": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ImageVariant"
          },
          "description": "Prepared image sizes; choose by displayed width and pixel density. Original image remains available at url."
        },
        "group": {
          "anyOf": [
            {
              "$ref": "#/$defs/PhotoGroup"
            },
            {
              "type": "null"
            }
          ],
          "description": "Optional owner-defined photo group; null means ungrouped."
        }
      },
      "required": [
        "id",
        "url",
        "alt",
        "width",
        "height",
        "variants",
        "group"
      ],
      "additionalProperties": false,
      "description": "Response structure: PublicImage."
    },
    "PhotoGroup": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable identifier of this resource; preserve it unchanged."
        },
        "title": {
          "type": "string",
          "maxLength": 160,
          "description": "Display title supplied by Wikiup; group titles are Title Case."
        }
      },
      "required": [
        "id",
        "title"
      ],
      "additionalProperties": false,
      "description": "Response structure: PhotoGroup."
    },
    "PublicMapLocation": {
      "description": "Confirmed exact public property coordinates, or null when no public exact location is available. No approximate points or destination-center fallbacks.",
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": false,
      "required": [
        "latitude",
        "longitude"
      ],
      "properties": {
        "latitude": {
          "type": "number",
          "minimum": -90,
          "maximum": 90,
          "description": "Exact approved public latitude in decimal degrees."
        },
        "longitude": {
          "type": "number",
          "minimum": -180,
          "maximum": 180,
          "description": "Exact approved public longitude in decimal degrees."
        }
      }
    },
    "ListingAddress": {
      "type": "object",
      "properties": {
        "line1": {
          "type": [
            "string",
            "null"
          ],
          "description": "Saved property street address."
        },
        "line2": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional additional property address line; null when empty."
        },
        "city": {
          "type": [
            "string",
            "null"
          ],
          "description": "Saved property city."
        },
        "state": {
          "type": [
            "string",
            "null"
          ],
          "description": "Saved property state/province."
        },
        "postalCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "Saved property postal/ZIP code; a string to preserve leading zeros."
        },
        "country": {
          "type": [
            "string",
            "null"
          ],
          "description": "Saved country value; may be a country name or code. Do not assume ISO format."
        }
      },
      "required": [
        "line1",
        "line2",
        "city",
        "state",
        "postalCode",
        "country"
      ],
      "additionalProperties": false,
      "description": "Response structure: ListingAddress."
    },
    "ListingContact": {
      "type": "object",
      "properties": {
        "phone": {
          "type": [
            "string",
            "null"
          ],
          "description": "Property business phone text, not an owner-account phone; null when absent."
        },
        "email": {
          "type": [
            "string",
            "null"
          ],
          "description": "Property business email, not an owner-account email; null when absent."
        },
        "websiteUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "Saved HTTP(S) property website, or null for absent/invalid/credential-bearing values. Not an affiliate-attributed checkout URL."
        }
      },
      "required": [
        "phone",
        "email",
        "websiteUrl"
      ],
      "additionalProperties": false,
      "description": "Response structure: ListingContact."
    },
    "ReviewProperty": {
      "type": "object",
      "properties": {
        "propertyId": {
          "type": "string",
          "description": "Raw Wikiup property identifier."
        },
        "name": {
          "type": "string",
          "description": "Public display name."
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Full saved description for the exact listing; may contain HTML. Null when unknown. The catalog uses a bounded plain-text excerpt instead."
        },
        "stayType": {
          "enum": [
            "hotel",
            "inn",
            "bed_and_breakfast",
            "resort",
            "vacation_rental",
            null
          ],
          "description": "Owner-supplied subtype compatible with the existing broad type; null when unknown or inconsistent. Does not select the booking flow."
        },
        "tagLine": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 100,
          "description": "Explicit owner-provided hotel facts or beds/baths from the exact rental unit or room-type content. Not live available inventory. Unknown is null. Limited to 100 Unicode characters including an ellipsis when shortened."
        },
        "address": {
          "oneOf": [
            {
              "$ref": "#/$defs/ListingAddress"
            },
            {
              "type": "null"
            }
          ],
          "description": "Saved property address, not owner-account address. Null when all address fields are empty. Detail only."
        },
        "contact": {
          "$ref": "#/$defs/ListingContact",
          "description": "Property business contact details. No account records or credentials are included."
        },
        "mapLocation": {
          "$ref": "#/$defs/PublicMapLocation",
          "description": "Exact approved public coordinate pair, or null. Never use town-center guesses."
        },
        "timeZone": {
          "type": [
            "string",
            "null"
          ],
          "description": "Validated property IANA time zone. Use for local timestamps; null means unknown."
        },
        "coverImage": {
          "anyOf": [
            {
              "$ref": "#/$defs/PublicImage"
            },
            {
              "type": "null"
            }
          ],
          "description": "Public cover image metadata, or null when absent."
        },
        "gallery": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PublicImage"
          },
          "description": "Ordered public listing photos, including thumbnails and group labels."
        }
      },
      "required": [
        "propertyId",
        "name",
        "description",
        "stayType",
        "tagLine",
        "address",
        "contact",
        "mapLocation",
        "timeZone",
        "coverImage",
        "gallery"
      ],
      "additionalProperties": false,
      "description": "Public property facts for the intended affiliate to review, including when rooms are inactive. No rates, reservations or owner settings. Missing optional facts are null; gallery may be empty."
    },
    "RequestResponse": {
      "type": "object",
      "properties": {
        "request": {
          "$ref": "#/$defs/Request",
          "description": "Saved request."
        }
      },
      "required": [
        "request"
      ],
      "additionalProperties": false,
      "description": "Submission or decision response."
    },
    "ReviewResponse": {
      "type": "object",
      "properties": {
        "request": {
          "$ref": "#/$defs/Request",
          "description": "Request addressed to you."
        },
        "property": {
          "$ref": "#/$defs/ReviewProperty",
          "description": "Requesting property public details."
        }
      },
      "required": [
        "request",
        "property"
      ],
      "additionalProperties": false,
      "description": "Request review response."
    },
    "PartnersResponse": {
      "type": "object",
      "properties": {
        "partners": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Partner"
          },
          "description": "Current page of records; empty when no matches."
        },
        "meta": {
          "$ref": "#/$defs/Page",
          "description": "Paging metadata."
        }
      },
      "required": [
        "partners",
        "meta"
      ],
      "additionalProperties": false,
      "description": "Paginated response."
    },
    "RequestsResponse": {
      "type": "object",
      "properties": {
        "requests": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Request"
          },
          "description": "Current page of records; empty when no matches."
        },
        "meta": {
          "$ref": "#/$defs/Page",
          "description": "Paging metadata."
        }
      },
      "required": [
        "requests",
        "meta"
      ],
      "additionalProperties": false,
      "description": "Paginated response."
    }
  }
}
