Get up and running with the StaySuite API in minutes. Learn authentication, make your first API call, and integrate powerful property management features.
Welcome to StaySuite API
The StaySuite API provides programmatic access to our comprehensive property management platform. Whether you're managing vacation rentals, long-term properties, or building custom integrations, our RESTful API offers the flexibility and power you need.
๐ Secure Authentication
JWT-based auth with 2FA support and role-based access control
๐ Property Management
Complete CRUD operations for VR and LTR properties
๐ Booking System
Real-time availability, pricing, and reservation management
๐ณ Payment Processing
Integrated payment handling with Stripe and PayPal
Getting Started in 5 Minutes
1Get Your API Credentials
Log in to your StaySuite dashboard and navigate to Settings > API Keys to generate your credentials.
2Set Up Authentication
Use your client ID and secret to obtain an access token via our OAuth 2.0 endpoint.
3Make Your First API Call
Test your connection by fetching your user profile or property list.
Authentication
OAuth 2.0 Flow
StaySuite uses OAuth 2.0 for secure API authentication. Follow these steps to authenticate:
Use query parameters to filter results based on specific criteria.
// Filter properties by type and amenities
GET /api/properties?type=vacation_rental&amenities=pool,wifi&min_price=100&max_price=500
// Filter bookings by date range
GET /api/bookings?check_in_after=2025-02-01&check_in_before=2025-02-28&status=confirmed
// Search guests by name or email
GET /api/guests?search=john&include=bookings,reviews
Webhooks
StaySuite supports webhooks for real-time event notifications. Configure webhook endpoints in your dashboard to receive instant updates.
const crypto = require('crypto');
function verifyWebhookSignature(payload, signature, secret) {
const hash = crypto
.createHmac('sha256', secret)
.update(JSON.stringify(payload))
.digest('hex');
return `sha256=${hash}` === signature;
}
// In your webhook handler
app.post('/webhook', (req, res) => {
const signature = req.headers['x-staysuite-signature'];
if (verifyWebhookSignature(req.body, signature, WEBHOOK_SECRET)) {
// Process the webhook
handleWebhookEvent(req.body);
res.status(200).send('OK');
} else {
res.status(401).send('Invalid signature');
}
});
Rate Limiting
To ensure fair usage and system stability, the StaySuite API implements rate limiting.
Rate Limit Headers
Header
Description
Example
X-RateLimit-Limit
Maximum requests per hour
1000
X-RateLimit-Remaining
Requests remaining in current window
950
X-RateLimit-Reset
Unix timestamp when limit resets
1705491600
Retry-After
Seconds to wait before retrying (429 only)
3600
Rate Limit Tiers
๐ API Rate Limits by Plan
Starter: 1,000 requests/hour
Professional: 5,000 requests/hour
Business: 10,000 requests/hour
Enterprise: Custom limits available
Handling Rate Limit Errors
// Exponential backoff retry strategy
async function makeAPIRequest(url, options, retries = 3) {
for (let i = 0; i < retries; i++) {
try {
const response = await fetch(url, options);
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After') || 60;
console.log(`Rate limited. Waiting ${retryAfter} seconds...`);
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
continue;
}
return response;
} catch (error) {
if (i === retries - 1) throw error;
await new Promise(resolve => setTimeout(resolve, Math.pow(2, i) * 1000));
}
}
}
Error Handling
HTTP Status Codes
Code
Status
Description
200
OK
Request successful
201
Created
Resource created successfully
204
No Content
Request successful, no content to return
400
Bad Request
Invalid request parameters
401
Unauthorized
Invalid or missing authentication
403
Forbidden
Access denied to resource
404
Not Found
Resource not found
409
Conflict
Resource conflict (e.g., duplicate booking)
422
Unprocessable Entity
Validation errors
429
Too Many Requests
Rate limit exceeded
500
Internal Server Error
Server error occurred
503
Service Unavailable
Service temporarily unavailable
Error Codes
// Common error codes and their meanings
{
"VALIDATION_ERROR": "Request validation failed",
"AUTHENTICATION_ERROR": "Authentication failed or expired",
"PERMISSION_DENIED": "Insufficient permissions",
"RESOURCE_NOT_FOUND": "Requested resource does not exist",
"DUPLICATE_RESOURCE": "Resource already exists",
"RATE_LIMIT_EXCEEDED": "Too many requests",
"PAYMENT_FAILED": "Payment processing failed",
"BOOKING_CONFLICT": "Dates unavailable for booking",
"INVALID_STATE": "Operation not allowed in current state",
"EXTERNAL_SERVICE_ERROR": "Third-party service error"
}
SDKs & Libraries
Speed up your integration with our official SDKs and community-maintained libraries.