Quickstart
A complete flow: create a category, add and verify an address, publish a property listing against it, and capture an inquiry. The Python examples use the property resources instantiated from the client.
- TypeScript
- Python
import {
WiilClient,
PropertyType,
PropertySubType,
ListingType,
ListingStatus,
PropertyInquiryType,
PreferredContactMethod,
} from 'wiil-js';
async function listProperty() {
const client = new WiilClient({ apiKey: process.env.WIIL_API_KEY! });
// 1. Create a category
const category = await client.propertyConfig.createCategory({
name: 'Luxury Homes',
description: 'Premium properties over $1M',
propertyType: PropertyType.RESIDENTIAL,
displayOrder: 1,
isDefault: false,
});
// 2. Create an address, then verify it
const address = await client.propertyConfig.createAddress({
street: '100 Ocean Drive',
city: 'Palm Beach',
state: 'FL',
postalCode: '33480',
country: 'USA',
coordinates: { latitude: 26.7056, longitude: -80.0364 },
isVerified: false,
});
await client.propertyConfig.verifyAddress(address.id);
// 3. Publish the listing
const property = await client.propertyConfig.create({
categoryId: category.id,
addressId: address.id,
title: 'Oceanfront Estate with Private Beach',
description: 'Magnificent estate with 200 feet of ocean frontage',
propertyType: PropertyType.RESIDENTIAL,
propertySubType: PropertySubType.VILLA,
listingType: ListingType.SALE,
listingStatus: ListingStatus.ACTIVE,
salePrice: 12500000,
salePriceCurrency: 'USD',
features: { bedrooms: 8, bathrooms: 10, squareFootage: 15000, amenities: ['Private beach', 'Infinity pool'] },
images: ['https://example.com/estate.jpg'],
isActive: true,
isFeatured: true,
});
// 4. Capture an inquiry
const inquiry = await client.propertyInquiries.create({
propertyId: property.id,
customer: {
firstName: 'Jane',
lastName: 'Doe',
email: 'jane@example.com',
phone: '+15550000001',
preferredContactMethod: PreferredContactMethod.PHONE,
},
inquiryType: PropertyInquiryType.GENERAL,
message: 'Interested in a private showing.',
source: 'website',
interestedInBuying: true,
budgetMax: 13000000,
});
return { category, address, property, inquiry };
}
listProperty().catch(console.error);
from wiil import WiilClient
from wiil.models.business_mgt import (
CreateProperty,
CreatePropertyAddress,
CreatePropertyCategory,
CreatePropertyInquiry,
)
client = WiilClient(api_key="your-api-key")
property_config = client.property_config
property_inquiry = client.property_inquiry
# 1. Create a category
category = property_config.create_category(
CreatePropertyCategory(
name="Luxury Homes",
description="High-end residential listings",
property_type="residential",
display_order=1,
)
)
# 2. Create an address, then verify it
address = property_config.create_address(
CreatePropertyAddress(
street="100 Ocean Drive",
city="Palm Beach",
state="FL",
postal_code="33480",
country="USA",
is_verified=False,
)
)
address = property_config.verify_address(address.id)
# 3. Publish the listing
property_listing = property_config.create(
CreateProperty(
category_id=category.id,
address_id=address.id,
title="Stunning Oceanfront Villa",
description="Luxury 5-bedroom villa with panoramic ocean views",
property_type="residential",
property_sub_type="villa",
listing_type="sale",
listing_status="active",
sale_price=2500000,
sale_price_currency="USD",
is_active=True,
)
)
# 4. Capture an inquiry
inquiry = property_inquiry.create(
CreatePropertyInquiry(
property_id=property_listing.id,
customer_id="cust_456",
message="Is this property still available?",
)
)
print("Property:", property_listing.id)
print("Inquiry:", inquiry.id)
Next steps
- Categories & addresses — organization and verifiable locations
- Properties — listings and type-specific details
- Inquiries — lead capture and the inquiry lifecycle