faq
Error Codes Loka V2
Error CodeError NameDescription
AFI612INVALID_NUMBER_ADULTSThe requested num of adults is invalid.
AFI614INVALID_NUMBER_CHILDREN_COMBINATION_INVALIDThe requested num child combination is invalid.
AFI616INVALID_MAXIMUM_CHILDREN_AGEMaximum children age is 17
AFI617INVALID_NUMBER_INFANTSThe requested num of infants is invalid
AFI622INVALID_NUMBER_PROPERTIESThe requested num of properties is invalid
AFI602INVALID_NUMBER_ROOMSThe requested num of rooms is invalid
AFI010INVALID_EMAILInvalid email
AFI020INVALID_LOCALEInvalid locale
AFI030TOO_MANY_REQUESTRequest exceeds limit
AFI061INVALID_CURRENCY_CODEInvalid currency code
AFI062INVALID_USER_SESSIONInvalid user session
AFI063INVALID_SPECInvalid spec
AFI064RESULT_CONVERSION_ERRORFailed in converting operation result
AFI065INVALID_CHECKIN_CHECKOUT_DATEInvalid Check-in and Check-out date time format
AFI066INVALID_BOOKING_RANGE_DAYSRange days booking cannot exceed 365 days.
AFI080RATE_KEY_NOT_FOUNDRate key not found
AFI086PROPERTY_NOT_FOUNDProperty not found
AFI101INVALID_COUNTRY_CODEThe country code is not compliant with ISO 316
AFI102INVALID_LAST_UPDATE_TIMEThe last updated time is not compliant with ISO 8601
AFI103HOTEL_NOT_ACTIVEHotel not active
AFI104NO_ACTIVE_ACCOMMODATIONError no active accommodation
AFI105INVALID_PROPERTY_CODEInvalid property code
AFI600INVALID_STAY_DATE_RANGEThe stay date cannot exceed 15 days.
AFI601INVALID_LANGUAGEThe language is not compliant with ISO 3166-1 Alpha-2
AFI603INVALID_NATIONALITYThe nationality is not valid
AFI604INVALID_SEARCH_SPECInvalid search spec
AFI605INVALID_CHECKOUT_DATEInvalid Check-out date
AFI606FAILED_TO_GENERATE_RATEKEYFailed to generate ratekey
AFI607INVALID_DATE_FORMATInvalid check-in or check-out date format
AFI608PROPERTY_NOT_FOUND_FROM_SPECThe property is not found from demand service
AFI609INVALID_ROOM_TO_ADULT_RATIOThe number of rooms cannot be more than the number of adults
AFI611CHECKOUT_DATE_ADVANCED_THAN_CHECKIN_DATECheck-out date cannot be advanced than check-in date.
AFI623INVALID_NUM_BULK_SEARCH_ROOMSInvalid num of bulk search rooms
AFI629INVALID_OPTION_PARAMETERSInvalid option parameters
AFI661INVALID_GEO_IDThe requested geoId is not valid.
AFI662INVALID_PRICE_RANGEThe requested price range is invalid
AFI663INVALID_NUMBER_OF_GEOIDRequest contain zero or more than one of those searching method GeoId, HotelId, Geolocation
AFI664INVALID_LIMIT_REQUESThe requested limit is invalid
AFI665INVALID_OFFSET_REQUESTThe requested offset is invalid
AFI666INVALID_SORT_TYPEThe requested sort type is invalid
AFI667INVALID_STAR_FILTERThe requested star filter is invalid
AFI668INVALID_ACCOMMODATION_TYPEThe requested accommodation type is invalid
AFI678INVALID_GEO_LOCATIONThe requested GeoLocation is invalid.
AFI680INVALID_RATETYPEThe requested rate type is invalid
AFI700ERROR_DURING_BOOKINGEncounter error during booking
AFI701INVALID_PARTNER_BOOKING_IDOne of Partner Booking Id is too short
AFI702INVALID_BOOKING_IDInvalid bookingId
AFI703INVALID_ITINERARY_IDInvalid itineraryId
AFI704INVALID_CANCEL_IDInvalid cancelId
AFI705INVALID_CUSTOMER_INFOInvalid customer info
AFI706INVALID_EXPECTED_TOTAL_CHARGEABLE_RATEInvalid ecpected total chargeable rate
AFI707INVALID_CHARGEABLE_RATE_INFOInvalid chargeable rate info
AFI708INVALID_PROPERTY_IDInvalid propertyId
AFI709INVALID_ROOM_DATAInvalid room data
AFI710INVALID_BOOKING_CHECKIN_DATEInvalid checkInDate
AFI711INVALID_BOOKING_CHECKOUT_DATEInvalid checkOutDate
AFI712INVALID_TIMEZONEInvalid timezone
AFI713INVALID_USER_PAYMENTInvalid userPayment
AFI714INVALID_REQUEST_FILTERInvalid request filter
AFI715INVALID_CANCELLATION_REQUESTInvalid cancellation request
AFI731BOOKING_NOT_FOUNDBooking not found
AFI732BOOKING_ALREADY_CANCELLEDBooking already cancelled
AFI733BOOKING_NOT_REFUNDABLEBooking not refundable
AFI734BOOKING_ALREADY_EXISTSBooking already exists
AFI735MISMATCHED_RATEMismatch rate
AFI736PENDING_BOOKINGPending booking
AFI737SOLD_OUTSold out
AFI738CREDIT_CARD_PROBLEMCredit card problem
AFI739CREDIT_LIMIT_FAILEDCredit limit failed
AFI740DEPOSIT_TRANSACTION_FAILEDDeposit transaction failed
AFI741BUSINESS_PARTNER_DATA_FAILEDBusiness partner data failed
AFI742INVALID_SETTLEMENT_METHODInvalid settlement method
AFI745BOOKING_ALREADY_PAIDBooking already paid
AFI747BOOKING_EXPIREDThe booking with given id is expired
AFI900SERVICE_UNAVAILABLEService unavailable
AFI901AUTHORIZATION_ERRORAuthorization error
AFI16INVALID_SEARCH_SPECInvalid search spec
AFI61INVALID_CURRENCY_CODEInvalid currency code
AFI62INVALID_LOCALEInvalid locale
AFI63INVALID_GEOIDInvalid geoid
AFI64INVALID_PRICE_FILTER_RANGEInvalid price filter range
AFI15INVALID_DATE_FORMATInvalid Check-in and Check-out date time format
AFI377INVALID_STAY_DAYSInvalid stay days
AFI14INVALID_AFFILIATE_CONFIRMATION_IDInvalid affiliate confirmation id
AFI17INVALID_ITINERARY_IDInvalid itinerary id
AFI18INVALID_EMAILInvalid email
AFI67INVALID_PRIMARY_SEARCH_METHODRequest contain zero or more than one of those searching method GeoId, HotelId, GeoLocation
AFI68INVALID_BOOKING_DATECheck-in and Check-out exceed 365 days from today
AFI69INVALID_CHEKCIN_DATEInvalid Check-in date
AFI70INVALID_CHECKOUT_DATEInvalid Check-out date
AFI396INVALID_NUMBER_OF_INFANTInvalid number of infants
AFI397INVALID_NUMBER_OF_ADULTInvalid number of adults
AFI398INVALID_NUMBER_OF_CHILDInvalid number of children
AFI399INVALID_CHILD_AGEInvalid child age
AFI72INVALID_RATE_TYPEInvalid rate type
AFI73INVALID_STAR_FILTERInvalid star filter
AFI74INVALID_ACCOMMODATION_TYPEInvalid accommodation type
AFI378INVALID_NUMBER_OF_ROOMSInvalid number of rooms
AFI379INVALID_NUMBER_OF_PROPERTIESInvalid number of properties
AFI76INVALID_OPTION_PARAMETERInvalid option parameters
AFI77INVALID_SORT_TYPEInvalid sort type
AFI78INVALID_GEO_LOCATIONInvalid geo location
AFI79INVALID_OFFSETInvalid offset
AFI80INVALID_RATE_KEYInvalid rate key
AFI81INVALID_USER_SESSIONInvalid user session
AFI82INVALID_LIMITInvalid limit
AFI83RATE_KEY_NOT_FOUNDRate key not found
AFI84INVALID_RATE_KEY_SPECinvalid spec to generate ratekey
AFI85ERROR_RATE_KEY_GENERATIONFailed to generate ratekey
AFI86PROPERTY_NOT_FOUNDThe property is disallowed from cdc
AFI87INVALID_NUM_BULK_SEARCH_ROOMSInvalid num of bulk search rooms
AFI90PROPERTY_NOT_FOUND_FROM_SPECThe property is not found from demand service
AFI100INVALID_SPECInvalid spec
AFI101MISMATCH_EXPECTED_RATEThe expected and current rate are different
AFI102DOUBLE_CONFIRMATION_IDThe booking with given confirmation id is already requested
AFI103ROOM_SOLD_OUTThe room requested is not available anymore
AFI104ALREADY_ISSUED_BOOKINGAlready issued booking
AFI105PENDING_ISSUANCEThe booking with given id is pending
AFI106ERROR_BOOKINGEncounter error during booking
AFI177INVALID_CANCELLATION_REQUESTInvalid cancellation request
AFI497AUTHORIZATION_ERRORAuthorization error
AFI429TOO_MANY_REQUESTRequest exceeds limit
AFI430RESULT_CONVERSION_ERRORFailed in converting operation result
AFI108INVALID_SETTLEMENT_METHODInvalid settlement method
AFI109INVALID_CREDIT_CARDInvalid credit card
AFI110CREDIT_CARD_FAILEDCredit card failed
AFI111CREDIT_CARD_NOT_FOUNDNo credit card is registered
AFI112CREDIT_LIMIT_DATA_FAILEDFailed when gathering credit limit data
AFI113FAILED_BUSINESS_PARTNER_DATAFailed when gathering business partner data
AFI114FAILED_BUSINESS_AGREEMENT_DATAFailed when gathering business agreement data
AFI115NULL_BUSINESS_AGREEMENT_DATANull business agreement data
AFI116EMPTY_BUSINESS_AGREEMENT_DATAEmpty business agreement data
AFI117MULTIPLE_BUSINESS_AGREEMENT_DATAMultiple business agreement data
AFI118INACTIVE_BUSINESS_AGREEMENT_DATABusiness agreement is not active
AFI119FAILED_CL_CONFIG_DATAFailed when gathering credit limit data
AFI120TRANSACTION_NOT_ALLOWED_BY_CLInsufficient credit limit balance
AFI123TRANSACTION_NOT_ALLOWED_BY_DMSDeposit transaction failed
AFI121BOOKING_EXPIREDThe booking with given id is expired
AFI122ALREADY_PAID_BOOKINGThe booking with given id is already paid
AFI404BOOKING_NOT_FOUNDBooking not found
AFI503SERVICE_UNAVAILABLEService unavailable
AFI999UNKNOWNUnknown code
Frequently Asked QuestionsCommonly asked questions about Traveloka Partners Network.
General API Usage

Search and Pagination

Caching and Data Refresh

Hotel and Room Information

Booking Process and Management

Error Handling and Troubleshooting

Rate Management and Optimization

Retry Logic and Timeout Handling

Best Practice
01
GetRate API
GetRate Search: Can retrieve up to 50 hotel IDs in a single request (parallel search requests are supported).
Search Criteria: • Maximum of Rooms: 8 • Maximum of Adults: 30 • Maximum length of stay: 15 days • Check-in and Check-out must be within 1 year (Next 365 days)
Avoid Invalid Spec Combinations: Ensure search queries contain valid specifications like:
Example: • Correct check-in and check-out dates (no backdated searches) • Valid booking windows 365 days with Los = 15 • Reasonable adult and child numbers (e.g., Adults 10)
Use Accurate Guest Information: Invalid specs for guests (adults, children) can lead to failed bookings. Validate age range and number of guests to match the inventory.
02
Pagination Best Practice
When retrieving large data sets through the API, it is essential to implement pagination to ensure optimal performance and to prevent overwhelming the server or your application.
Using limit and offset Parameters: • limit: Specifies the maximum number of items to be returned in the response. • offset: Specifies the number of items to skip before starting to return results.Example: GET /api/v1/hotels?limit=100&offset=200 • This query will return 100 hotels starting from the 201st hotel in the dataset.
Best Practices for Pagination:
• Set a sensible default limit: If no limit is specified by the client, provide a default (e.g., 50 results per page). • Maximum limit: Impose a maximum limit (e.g., 1000 results per page) to avoid overloading the system with large data requests. • Next page links: Provide a next and previous link in the response to make it easier for clients to fetch the next or previous set of data.
Example:{ "results": [...], "next": "/api/v1/hotels?limit=100&offset=300", "previous": "/api/v1/hotels?limit=100&offset=100" }
• Total count: Include the total count of items in the dataset so that clients can calculate the total number of pages.
Example:{ "results": [...], "total": 5000, "limit": 100, "offset": 200 }
• In this case, the client can calculate the total number of pages as 5000 / 100 = 50 pages.
03
Caching and Data Refresh Best Practices
To optimize system performance and reduce the number of API calls, we recommend implementing caching for both static and dynamic data, especially when dealing with frequently changing content such as room availability and rates.
Static Data (Cache for 7 Days)Static information (e.g., hotel name, address, amenities, room descriptions) can be cached for longer periods since it doesn’t change frequently. Refresh weekly unless significant changes are expected. • Hotel Information: Cache for 7 days • Example: GET /properties/content/hotel • Room Information: Cache for 7 days • Example: GET /properties/content/room
Dynamic Data (Cache for 30 Minutes)Dynamic data like room availability and rates change frequently, so shorter caching intervals are recommended to balance accuracy and API performance. • Room Availability Cache for 30 minutes to reduce API hits while ensuring reasonable accuracy. • Example: GET /properties/getRates • Rates Cache for 30 minutes as rates fluctuate often, ensuring data freshness for customer queries. • Example: GET /properties/checkRate
Cache Based on Property Demand • High-Demand Properties: Cache room availability and rates for 15 minutes to keep data accurate for frequently booked properties. • Low-Demand Properties: Extend the cache duration to 30 minutes for properties with lower booking frequencies to reduce unnecessary API calls without sacrificing accuracy.
04
Implement Intelligent Caching
• Cache Frequent Requests: Prioritize caching results for high-demand hotels and room types with short booking windows (e.g., 1-3 days). This reduces redundant requests and improves response times. • Extend Time-to-Live (TTL) for Low-Demand Inventory: For hotels and rooms with lower demand, use longer TTLs to avoid frequent updates and reduce API calls (e.g., 12 hours).
05
Sorting
Sorting helps clients organize data according to specific fields like price, rating, or date.
Common Sorting Parameters: • sort: The field by which to sort the results (e.g., price, name, rating). • order: The order in which to sort the results. It can take the values asc (ascending) or desc (descending).
Example:GET /api/v1/hotels?sort=price&order=ascThis query will return hotels sorted by price in ascending order.
Best Practices for Sorting: • Allow multiple sort fields: Permit sorting by more than one field by using a comma-separated list. For example:
Example:GET /api/v1/hotels?sort=price,rating&order=asc,descThis query will sort the hotels first by price in ascending order and then by rating in descending order.
• Default sorting: Provide default sorting when none is specified by the client (e.g., by relevance or date). • Sorting options: Clearly document the available fields that can be sorted (e.g., price, name, rating, availability).
06
Handling Error Cache
• Empty responses: When there are no items to return for a specific page, return an empty array with appropriate metadata, such as total count and pagination links.
Example:{ "results": [], "total": 0, "limit": 100, "offset": 0, "next": null, "previous": null }
• Invalid pagination parameters: Return an error message if the offset or limit parameters are out of bounds (e.g., offset greater than the total number of items).
Example:{ "error": "Invalid offset. There are only 50 pages available." }
07
Best Practices for Optimizing Look-to-Book (LTB)
• Optimize Search Specifications: Ensure valid specs like check-in/out dates, booking windows (≤ 15 days), and guest details (adults ≤ 10, reasonable child count). Validate the spec combinations to avoid invalid searches that contribute to low-quality queries. • Use Intelligent Caching: Frequent Requests: Cache results for high-demand hotels/room types with a short TTL (1-3 hours). Low-Demand Inventory: For low-demand hotels, use a longer TTL (6-12 hours) to avoid redundant requests. • Focus on High-Quality Inventory: Ensure to stop searching hotels that are permanently closed or temporarily unavailable. Focus on hotels that frequently convert (e.g., hotels booked at least once in the last 3 months). • Reduce Spec Multiplier: Limit overly broad search queries with excessive combinations (LoS, adults, rooms) that produce wasteful requests. • Respect Rate Limits: Ensure search frequency does not exceed the API's rate limit (e.g., no more than 50 requests per second).
08
Mapping Recommendations
To optimize data accuracy, ensure all static data is mapped with these key components:
• Hotel Data: Address, Longitude, Latitude, Hotel Name (Note: Phone number not provided). • Room Data: Room Name, Views, Window, Smoking Preference, Area, Gender (if applicable), Bed Type.
API Endpoints for Mapping: • Hotel Data: Use GetHotel. • Room Data: Use GetRoom.Following these recommendations ensures consistent data and smooth booking operations.
09
Mapping API
Given affiliate spec of hotel, we will give them hotel ID based on similarity.