{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pagehub-dev/json-schema/pagehub-dev-site-order-schema.json",
  "title": "SiteOrder",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pagehub-dev-openapi.json#/components/schemas/SiteOrder",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The gateway's order id: a Stripe Checkout Session id, or a PayPal order id."
    },
    "gateway": {
      "type": "string",
      "enum": [
        "stripe",
        "paypal"
      ],
      "description": "Who took the money."
    },
    "created": {
      "type": "string",
      "format": "date-time"
    },
    "mode": {
      "type": "string"
    },
    "buyer": {
      "type": "object",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "email": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "amount": {
            "type": "number"
          }
        }
      }
    },
    "moreItems": {
      "type": "boolean"
    },
    "amount": {
      "type": "number",
      "description": "Smallest currency unit."
    },
    "currency": {
      "type": "string"
    },
    "payment": {
      "type": "string",
      "enum": [
        "paid",
        "pending",
        "refunded",
        "partially_refunded"
      ]
    },
    "amountRefunded": {
      "type": "number"
    },
    "refundable": {
      "type": "boolean"
    },
    "shipping": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "address": {
          "type": "string"
        }
      }
    },
    "fulfilment": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unfulfilled",
            "shipped"
          ]
        },
        "shippedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "carrier": {
          "type": [
            "string",
            "null"
          ]
        },
        "tracking": {
          "type": [
            "string",
            "null"
          ]
        },
        "trackingUrl": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "cancellation": {
      "type": [
        "object",
        "null"
      ],
      "description": "The cancellation policy this booking was made under, frozen at checkout; null when the home had none. `refundable` is what was paid after any promo code, split into the nights with their tax and the cleaning fee.",
      "properties": {
        "name": {
          "type": "string"
        },
        "tiers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "daysBefore": {
                "type": "integer"
              },
              "refundPercent": {
                "type": "integer"
              }
            }
          }
        },
        "sentence": {
          "type": "string"
        },
        "checkIn": {
          "type": "string",
          "format": "date"
        },
        "timeZone": {
          "type": [
            "string",
            "null"
          ]
        },
        "refundable": {
          "type": "object",
          "properties": {
            "nightsAndTax": {
              "type": "number"
            },
            "fee": {
              "type": "number"
            }
          }
        }
      }
    }
  },
  "required": [
    "id",
    "created",
    "amount",
    "currency",
    "payment",
    "fulfilment"
  ]
}