Join our community at https://www.reddit.com/r/HotelByte/

HotelByte
Homepage
Waitlist
Homepage
Waitlist
Hotel Partners Roadmap
Submit issues
  1. 2. Guides
  • 1. Get started
    • Overview
    • Booking flow
    • Certification and Go Live
    • Frequently Asked Questions (FAQ)
  • 2. Guides
    • Quick start
    • Error handling
    • Rate limit
    • Certification cases
    • Test more scenarios
    • Order status callback
  • 3. API Reference
    • Authentication
      • Ticket
    • Content
      • Destinations
      • HotelStaticDetail
      • HotelsMetadata
    • Search
      • HotelList
      • HotelRates
    • Make bookings
      • CheckAvail
      • Book
    • Manage bookings
      • QueryOrders
      • Cancel
  1. 2. Guides

Order status callback

Overview#

The Order Callback service provides real-time notifications when your order status changes. Instead of polling for order status updates, you can receive automatic webhook callbacks when important events occur.

How It Works#

Callback Mechanism#

1.
Registration: Provide your callback URL when creating an order via the Book API
2.
Event Trigger: When an order status changes (e.g., payment completed, order cancelled), our system automatically triggers a callback
3.
Async Delivery: Callbacks are sent asynchronously to avoid blocking order processing
4.
Retry on Failure: If delivery fails, the system automatically retries with exponential backoff
5.
Idempotent: Due to occasional network issues or other factors, the order status push event may be inconsistent with the normal state transition. This is unavoidable, so you need to handle idempotency on your side

Integration Steps#

Step 1: Implement Your Callback Endpoint#

Create an HTTPS endpoint that can receive POST requests with JSON payloads.
Requirements:
Must be publicly accessible
Must support HTTPS
Must return HTTP 2xx status codes on success
Should process callbacks asynchronously
Example Implementation:

Step 2: Configure Callback URL in Book Request#

When calling the Book API, include your callback URL in the request:
{
  "customerReferenceNo": "REF123456",
  "ratePkgId": "pkg_123456",
  "holder": {
    "firstName": "John",
    "lastName": "Doe",
    "email": "john@example.com"
  },
  "guests": [
    {
      "roomIndex": 1,
      "firstName": "John",
      "lastName": "Doe"
    }
  ],
  "callbackUrl": "https://your-domain.com/webhook/order-callback"
}
Important Notes:
callbackUrl is optional
Must be a valid HTTPS URL
The same URL will be used for all events related to that order
URL is stored with the order and used for all subsequent callbacks

Step 3: Handle Callback Events#

Your callback endpoint will receive notifications for the following events:
EventDescriptionWhen Triggered
order_createdOrder created but not yet paidAfter successful order creation
order_paidOrder payment completedAfter payment is confirmed
order_cancelledOrder cancelledAfter order is cancelled
Note: Additional events (order_confirmed, order_updated, order_checkedin, order_checkedout) are planned but not yet supported.
Each callback contains the following JSON payload:
{
  "customerReferenceNo": "REF123456",
  "hotelConfirmNo": "HCN789012",
  "event": "order_paid",
  "eventTime": 1704067200000
}
Payload Fields:
FieldTypeDescriptionExample
customerReferenceNostringYour order reference numberREF123456
hotelConfirmNostringHotel confirmation number (may be empty for some events)HCN789012
eventstringEvent typeorder_paid
eventTimeint64Event timestamp in Unix milliseconds1704067200000
Request Headers:
Content-Type: application/json
User-Agent: hotel-be-webhook/1.0
Previous
Test more scenarios
Next
3. API Reference