API Endpoints Overview
This page provides an overview of the available API endpoints for the Cakrahub Booking Engine. The API is divided into two main categories: Client Endpoints and Admin Endpoints.
Base URL
https://chsres.com/api/plugin/v1
Authentication
All API requests require authentication using a token in the header:
headers: {
'token': 'your-api-token-here'
}
Endpoint Categories
Client Endpoints
Client endpoints are designed for public-facing operations and booking management. These endpoints allow:
- Hotel Information Access: Retrieve hotel details, images, and policies
- Room Availability Checking: Check room availability and pricing for specific dates
- Booking Operations: Create new bookings and retrieve booking status
- Image Assets: Access hotel and room images (no authentication required)
Client endpoints are typically used by:
- Booking widgets and websites
- Third-party booking platforms
- Guest-facing applications
Key Characteristics:
- Require standard API tokens
- Focus on read operations and booking creation
- Include some public endpoints for images
Admin Endpoints
Admin endpoints provide full management capabilities for hotel operations. These endpoints allow:
- Room Management: Create, update, delete, and query room types
- Availability Management: Set and modify room availability, pricing, and restrictions
- Rate Management: Create and manage room rate plans
- Stop Sell Operations: Control booking restrictions and availability closures
Admin endpoints are used by:
- Hotel management systems
- Property management software (PMS)
- Administrative dashboards
- Channel managers
Key Characteristics:
- Require admin-level API tokens (
is_admin=1) - Include full CRUD operations
- Focus on configuration and management tasks
Available Endpoints
Public Endpoints (No Authentication)
GET /hotels/{chain_code}/{hotel_code}/{image_name}- Hotel imagesGET /hotels/header/{chain_code}/{hotel_code}/{image_name}- Hotel header imagesGET /rooms/{chain_code}/{hotel_code}/{room_code}/{image_name}- Room images
Client Endpoints
GET /hotelinformation- Get hotel informationGET /roomavailability- Check room availabilityPOST /createbooking- Create a new bookingGET /getallbooking- Get booking statusGET /ping- Test connectivityGET /test- Test authorizationGET /checkroomavailability- Check room availability (admin context)GET /getavailability- Get availability URL
Admin Endpoints
POST /createroom- Create a roomGET /getallrooms- Get all roomsGET /getroom/{room_code}- Get room detailsPUT /updateroom/{room_code}- Update roomDELETE /deleteroom/{room_code}- Delete roomPOST /modifyroomavailability- Modify room availabilityGET /getallroomavailability- Get all room availabilityPUT /updateroomavailability/{room_code}- Update room availabilityDELETE /deleteroomavailability/{room_code}- Delete room availabilityPUT /updatestopsellroomavailability- Update stop sell statusPUT /updatestopsellroomrateavailability- Update stop sell rate statusPOST /createrate- Create a rate planGET /getallrates- Get all ratesGET /getrate/{rate_code}- Get rate detailsPUT /updaterate/{rate_code}- Update rateDELETE /deleterate/{rate_code}- Delete rate
Getting Started
- Generate API Keys: Visit the API Key Generation page to create your API credentials
- Choose the Right Token: Use client tokens for booking operations, admin tokens for management tasks
- Test Connectivity: Use the
/pingendpoint to verify your connection - Review Status Codes: Check the API Response Status Codes for error handling
Rate Limits and Best Practices
- Implement proper error handling for all API calls
- Cache hotel information and images when possible
- Use appropriate authentication levels for your use case
- Monitor API usage and implement retry logic for transient failures
For detailed documentation of each endpoint including request/response examples, see the individual endpoint documentation pages.