{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hostfully/json-schema/hostfully-orders-api-response-wrapper-schema.json",
  "title": "OrdersApiResponseWrapper",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hostfully-orders-api-openapi.yml#/components/schemas/OrdersApiResponseWrapper",
  "type": "object",
  "properties": {
    "orders": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OrderApi3Dto"
      }
    },
    "_metadata": {
      "$ref": "#/$defs/Api3ResponseMetadata"
    }
  },
  "$defs": {
    "Api3ResponseMetadata": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "format": "int32"
        },
        "totalCount": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "DiscountGraphQLApiTO": {
      "type": "object",
      "properties": {
        "discountCode": {
          "type": "string"
        },
        "discountType": {
          "type": "string",
          "enum": [
            "AMOUNT",
            "PERCENT"
          ]
        },
        "amount": {
          "type": "number"
        },
        "percent": {
          "type": "number"
        }
      }
    },
    "OrderAdjustmentApi3Dto": {
      "type": "object",
      "properties": {
        "isPaid": {
          "type": "boolean"
        },
        "amount": {
          "type": "number"
        }
      }
    },
    "OrderAdjustmentItemApi3Dto": {
      "type": "object",
      "properties": {
        "uid": {
          "type": "string"
        },
        "transactionType": {
          "type": "string",
          "enum": [
            "CHARGE",
            "REFUND"
          ]
        },
        "adjustmentType": {
          "type": "string",
          "enum": [
            "RENT",
            "TAX",
            "FEE",
            "SERVICE",
            "RESOLUTION"
          ]
        },
        "amount": {
          "type": "number"
        },
        "note": {
          "type": "string"
        },
        "createdUtcDateTime": {
          "type": "string"
        },
        "externalId": {
          "type": "string"
        }
      }
    },
    "OrderApi3Dto": {
      "type": "object",
      "properties": {
        "uid": {
          "type": "string"
        },
        "leadUid": {
          "type": "string"
        },
        "creationUtcDateTime": {
          "type": "string"
        },
        "updatedUtcDateTime": {
          "type": "string"
        },
        "rent": {
          "$ref": "#/$defs/OrderRentApi3Dto"
        },
        "securityDeposit": {
          "type": "number",
          "description": "The securit deposit paid, if any, in this reservation. \n1. It is not inclusive in case the Additional Charge Option is enabled for the agency \n2. It is not inclusive for normal Security Deposit (due at check in)\n3. It is inclusive for normal Security Deposit (due at booking time)"
        },
        "fees": {
          "$ref": "#/$defs/OrderFeesApi3Dto"
        },
        "services": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OrderServiceApi3Dto"
          }
        },
        "adjustments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OrderAdjustmentApi3Dto"
          }
        },
        "rateMultiplier": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "enum": [
            "USD",
            "EUR",
            "GBP",
            "CAD",
            "JPY",
            "INR",
            "MYR",
            "AUD",
            "KES",
            "MXN",
            "HKD",
            "NZD",
            "CHF",
            "BRL",
            "CLP",
            "COP",
            "PEN",
            "ARS",
            "UYU",
            "VEF",
            "CNY",
            "THB",
            "KRW",
            "IDR",
            "SGD",
            "TWD",
            "AED",
            "ZAR",
            "CZK",
            "DKK",
            "DOP",
            "SEK",
            "BGN",
            "ILS",
            "NOK",
            "RON",
            "RUB",
            "PHP",
            "VND",
            "HUF",
            "IKR",
            "PLN",
            "PYG",
            "TRY",
            "GTQ",
            "VUV",
            "JOD",
            "SAR",
            "EGP",
            "TTD",
            "MAD",
            "CVE",
            "BBD",
            "AWG",
            "BHD",
            "NONE"
          ]
        },
        "totalAmount": {
          "type": "number"
        },
        "totalTaxesAmount": {
          "type": "number"
        },
        "channelCommission": {
          "$ref": "#/$defs/OrderChannelCommissionApi3Dto"
        },
        "adjustmentItems": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OrderAdjustmentItemApi3Dto"
          }
        },
        "externalOrderId": {
          "type": "string"
        }
      }
    },
    "OrderChannelCommissionApi3Dto": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "number"
        }
      }
    },
    "OrderFeeApi3Dto": {
      "type": "object",
      "properties": {
        "uid": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "amountType": {
          "type": "string",
          "enum": [
            "AMOUNT",
            "TAX"
          ]
        },
        "isEditable": {
          "type": "boolean"
        },
        "netPrice": {
          "type": "number"
        },
        "taxationRate": {
          "type": "number"
        },
        "taxAmount": {
          "type": "number"
        },
        "grossAmount": {
          "type": "number"
        },
        "grossPrice": {
          "type": "number"
        }
      }
    },
    "OrderFeesApi3Dto": {
      "type": "object",
      "properties": {
        "cleaningFee": {
          "$ref": "#/$defs/OrderFeeApi3Dto"
        },
        "otherFees": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OrderFeeApi3Dto"
          }
        }
      }
    },
    "OrderRentApi3Dto": {
      "type": "object",
      "properties": {
        "rentNetPrice": {
          "type": "number"
        },
        "rentBreakdowns": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OrderRentBreakdownApi3Dto"
          }
        },
        "extraGuestsNetPrice": {
          "type": "number"
        },
        "listPrice": {
          "type": "number"
        },
        "discount": {
          "$ref": "#/$defs/DiscountGraphQLApiTO"
        },
        "netPrice": {
          "type": "number"
        },
        "taxationRate": {
          "type": "number"
        },
        "taxAmount": {
          "type": "number"
        },
        "grossPrice": {
          "type": "number"
        }
      }
    },
    "OrderRentBreakdownApi3Dto": {
      "type": "object",
      "properties": {
        "nightlyAmount": {
          "type": "number"
        },
        "nightlyDate": {
          "type": "string",
          "format": "date"
        }
      }
    },
    "OrderServiceApi3Dto": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "grossPrice": {
          "type": "number"
        },
        "quantity": {
          "type": "integer",
          "format": "int32"
        },
        "quantityDescription": {
          "type": "string"
        },
        "serviceUid": {
          "type": "string"
        },
        "uid": {
          "type": "string"
        }
      }
    }
  }
}