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

HotelByte
HomepageWaitlist
HomepageWaitlist
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
  • 3. API Reference
    • Authentication
      • Ticket
    • Content
      • Destinations
      • HotelStaticDetail
      • HotelsMetadata
    • Search
      • HotelList
      • HotelRates
    • Make bookings
      • CheckAvail
      • Book
    • Manage bookings
      • QueryOrders
      • Cancel
  • Schemas
    • Schemas
    • hotel.common.bff.Table
    • OrderHomeFunctionReq
    • TicketReq
    • TicketResp
    • DestinationInclude
    • DestinationExtra
    • Coordinates
    • CheckAvailReq
    • CheckAvailResp
    • HotelsMetadataListResp
    • HotelsMetadataReq
    • ComputedCancelPolicyItem
    • OrderHomeFunctionResp
    • OriginalRoomNaming
    • Rate
    • CancelResp
    • Tax
    • Holder
    • HotelOrder
    • OrderRoomRefundInfo
    • HotelListReq
    • HotelListResp
    • HotelListBasicInfo
    • BaseHeader
    • BookingHeader
    • ContentHeader
    • HotelMeta
    • DestinationType
    • Guest
    • DestinationsReq
    • DestinationsResp
    • OrderStatus
    • GuestPerRoom
    • RatePkgId
    • RoomRatePkg
    • HotelRatesReq
    • BookReq
    • HotelRatesResp
    • BookResp
    • CancelReq
    • QueryOrdersReq
    • HotelStaticDetailReq
    • QueryOrdersResp
    • HotelStaticDetailResp
  1. 2. Guides

Error handling

HTTP Status Code vs Business Error Code#

Our API uses a dual-layer error system:
1.
HTTP Status Code - Standard HTTP response status (200, 400, 401, etc.)
2.
Business Error Code - Custom business logic error codes in response body
Important: Always check the code field in the response body, not just the HTTP status code.

HTTP Status Code Specification#

HTTP StatusMeaningDescription
200SuccessRequest processed successfully
400Bad RequestRequest parameter validation failed
401UnauthorizedInvalid or expired token
403ForbiddenNo access to resource
404Not FoundRequested resource not found
429Too Many RequestsExceeded request frequency limit
500Internal Server ErrorInternal server error
504Gateway TimeoutRequest processing timeout

Business Error Code Specification#

Business error codes follow the format: [x][xx][xx][xxxx]
Error CodeHTTP StatusMeaningDescription
0200SuccessRequest successful
100000400400Parameter ErrorRequest parameter validation failed
100000401401Authentication FailedInvalid or expired token
100000403403Permission DeniedNo access to resource
100000404404Not FoundRequested resource not found
100000429429Rate LimitedExceeded request frequency limit
100000500500System ErrorInternal server error
100000504504TimeoutRequest processing timeout
100001003500Duplicate ErrorDuplicate resource or operation
100001004500Dependency ErrorExternal dependency failure
100001005400Page Size ExceededPage size exceeds maximum limit
100001006400Not ImplementedFeature not implemented
100001007400ExpiredResource or token expired
100001008400Not MatchedData does not match expected format
100001111200ARI ChangedAvailability/rate information changed
100001112200Credit LimitBooking failed due to credit limit exceeded

Error Response Format#

All error responses follow this structure:
{
    "code": 100000400,
    "msg": "param error"
}

Success Response Format#

Successful responses include data:
{
    "code": 0,
    "msg": "Success",
    "data": {
        // Your response data here
    }
}

Error Handling Best Practices#

1.
Always check body.code - HTTP status codes are for transport-level errors
2.
Business logic errors use HTTP 200 with non-zero code values
3.
Transport errors use appropriate HTTP status codes (4xx, 5xx)
4.
Retry logic should be based on business error codes, not HTTP status codes
Previous
Quick start
Next
Rate limit
Built with