Error Codes Loka V2
Error Code | Error Name | Description |
---|---|---|
AFI612 | INVALID_NUMBER_ADULTS | The requested num of adults is invalid. |
AFI614 | INVALID_NUMBER_CHILDREN_COMBINATION_INVALID | The requested num child combination is invalid. |
AFI616 | INVALID_MAXIMUM_CHILDREN_AGE | Maximum children age is 17 |
AFI617 | INVALID_NUMBER_INFANTS | The requested num of infants is invalid |
AFI622 | INVALID_NUMBER_PROPERTIES | The requested num of properties is invalid |
AFI602 | INVALID_NUMBER_ROOMS | The requested num of rooms is invalid |
AFI010 | INVALID_EMAIL | Invalid email |
AFI020 | INVALID_LOCALE | Invalid locale |
AFI030 | TOO_MANY_REQUEST | Request exceeds limit |
AFI061 | INVALID_CURRENCY_CODE | Invalid currency code |
AFI062 | INVALID_USER_SESSION | Invalid user session |
AFI063 | INVALID_SPEC | Invalid spec |
AFI064 | RESULT_CONVERSION_ERROR | Failed in converting operation result |
AFI065 | INVALID_CHECKIN_CHECKOUT_DATE | Invalid Check-in and Check-out date time format |
AFI066 | INVALID_BOOKING_RANGE_DAYS | Range days booking cannot exceed 365 days. |
AFI080 | RATE_KEY_NOT_FOUND | Rate key not found |
AFI086 | PROPERTY_NOT_FOUND | Property not found |
AFI101 | INVALID_COUNTRY_CODE | The country code is not compliant with ISO 316 |
AFI102 | INVALID_LAST_UPDATE_TIME | The last updated time is not compliant with ISO 8601 |
AFI103 | HOTEL_NOT_ACTIVE | Hotel not active |
AFI104 | NO_ACTIVE_ACCOMMODATION | Error no active accommodation |
AFI105 | INVALID_PROPERTY_CODE | Invalid property code |
AFI600 | INVALID_STAY_DATE_RANGE | The stay date cannot exceed 15 days. |
AFI601 | INVALID_LANGUAGE | The language is not compliant with ISO 3166-1 Alpha-2 |
AFI603 | INVALID_NATIONALITY | The nationality is not valid |
AFI604 | INVALID_SEARCH_SPEC | Invalid search spec |
AFI605 | INVALID_CHECKOUT_DATE | Invalid Check-out date |
AFI606 | FAILED_TO_GENERATE_RATEKEY | Failed to generate ratekey |
AFI607 | INVALID_DATE_FORMAT | Invalid check-in or check-out date format |
AFI608 | PROPERTY_NOT_FOUND_FROM_SPEC | The property is not found from demand service |
AFI609 | INVALID_ROOM_TO_ADULT_RATIO | The number of rooms cannot be more than the number of adults |
AFI611 | CHECKOUT_DATE_ADVANCED_THAN_CHECKIN_DATE | Check-out date cannot be advanced than check-in date. |
AFI623 | INVALID_NUM_BULK_SEARCH_ROOMS | Invalid num of bulk search rooms |
AFI629 | INVALID_OPTION_PARAMETERS | Invalid option parameters |
AFI661 | INVALID_GEO_ID | The requested geoId is not valid. |
AFI662 | INVALID_PRICE_RANGE | The requested price range is invalid |
AFI663 | INVALID_NUMBER_OF_GEOID | Request contain zero or more than one of those searching method GeoId, HotelId, Geolocation |
AFI664 | INVALID_LIMIT_REQUES | The requested limit is invalid |
AFI665 | INVALID_OFFSET_REQUEST | The requested offset is invalid |
AFI666 | INVALID_SORT_TYPE | The requested sort type is invalid |
AFI667 | INVALID_STAR_FILTER | The requested star filter is invalid |
AFI668 | INVALID_ACCOMMODATION_TYPE | The requested accommodation type is invalid |
AFI678 | INVALID_GEO_LOCATION | The requested GeoLocation is invalid. |
AFI680 | INVALID_RATETYPE | The requested rate type is invalid |
AFI700 | ERROR_DURING_BOOKING | Encounter error during booking |
AFI701 | INVALID_PARTNER_BOOKING_ID | One of Partner Booking Id is too short |
AFI702 | INVALID_BOOKING_ID | Invalid bookingId |
AFI703 | INVALID_ITINERARY_ID | Invalid itineraryId |
AFI704 | INVALID_CANCEL_ID | Invalid cancelId |
AFI705 | INVALID_CUSTOMER_INFO | Invalid customer info |
AFI706 | INVALID_EXPECTED_TOTAL_CHARGEABLE_RATE | Invalid ecpected total chargeable rate |
AFI707 | INVALID_CHARGEABLE_RATE_INFO | Invalid chargeable rate info |
AFI708 | INVALID_PROPERTY_ID | Invalid propertyId |
AFI709 | INVALID_ROOM_DATA | Invalid room data |
AFI710 | INVALID_BOOKING_CHECKIN_DATE | Invalid checkInDate |
AFI711 | INVALID_BOOKING_CHECKOUT_DATE | Invalid checkOutDate |
AFI712 | INVALID_TIMEZONE | Invalid timezone |
AFI713 | INVALID_USER_PAYMENT | Invalid userPayment |
AFI714 | INVALID_REQUEST_FILTER | Invalid request filter |
AFI715 | INVALID_CANCELLATION_REQUEST | Invalid cancellation request |
AFI731 | BOOKING_NOT_FOUND | Booking not found |
AFI732 | BOOKING_ALREADY_CANCELLED | Booking already cancelled |
AFI733 | BOOKING_NOT_REFUNDABLE | Booking not refundable |
AFI734 | BOOKING_ALREADY_EXISTS | Booking already exists |
AFI735 | MISMATCHED_RATE | Mismatch rate |
AFI736 | PENDING_BOOKING | Pending booking |
AFI737 | SOLD_OUT | Sold out |
AFI738 | CREDIT_CARD_PROBLEM | Credit card problem |
AFI739 | CREDIT_LIMIT_FAILED | Credit limit failed |
AFI740 | DEPOSIT_TRANSACTION_FAILED | Deposit transaction failed |
AFI741 | BUSINESS_PARTNER_DATA_FAILED | Business partner data failed |
AFI742 | INVALID_SETTLEMENT_METHOD | Invalid settlement method |
AFI745 | BOOKING_ALREADY_PAID | Booking already paid |
AFI747 | BOOKING_EXPIRED | The booking with given id is expired |
AFI900 | SERVICE_UNAVAILABLE | Service unavailable |
AFI901 | AUTHORIZATION_ERROR | Authorization error |
AFI16 | INVALID_SEARCH_SPEC | Invalid search spec |
AFI61 | INVALID_CURRENCY_CODE | Invalid currency code |
AFI62 | INVALID_LOCALE | Invalid locale |
AFI63 | INVALID_GEOID | Invalid geoid |
AFI64 | INVALID_PRICE_FILTER_RANGE | Invalid price filter range |
AFI15 | INVALID_DATE_FORMAT | Invalid Check-in and Check-out date time format |
AFI377 | INVALID_STAY_DAYS | Invalid stay days |
AFI14 | INVALID_AFFILIATE_CONFIRMATION_ID | Invalid affiliate confirmation id |
AFI17 | INVALID_ITINERARY_ID | Invalid itinerary id |
AFI18 | INVALID_EMAIL | Invalid email |
AFI67 | INVALID_PRIMARY_SEARCH_METHOD | Request contain zero or more than one of those searching method GeoId, HotelId, GeoLocation |
AFI68 | INVALID_BOOKING_DATE | Check-in and Check-out exceed 365 days from today |
AFI69 | INVALID_CHEKCIN_DATE | Invalid Check-in date |
AFI70 | INVALID_CHECKOUT_DATE | Invalid Check-out date |
AFI396 | INVALID_NUMBER_OF_INFANT | Invalid number of infants |
AFI397 | INVALID_NUMBER_OF_ADULT | Invalid number of adults |
AFI398 | INVALID_NUMBER_OF_CHILD | Invalid number of children |
AFI399 | INVALID_CHILD_AGE | Invalid child age |
AFI72 | INVALID_RATE_TYPE | Invalid rate type |
AFI73 | INVALID_STAR_FILTER | Invalid star filter |
AFI74 | INVALID_ACCOMMODATION_TYPE | Invalid accommodation type |
AFI378 | INVALID_NUMBER_OF_ROOMS | Invalid number of rooms |
AFI379 | INVALID_NUMBER_OF_PROPERTIES | Invalid number of properties |
AFI76 | INVALID_OPTION_PARAMETER | Invalid option parameters |
AFI77 | INVALID_SORT_TYPE | Invalid sort type |
AFI78 | INVALID_GEO_LOCATION | Invalid geo location |
AFI79 | INVALID_OFFSET | Invalid offset |
AFI80 | INVALID_RATE_KEY | Invalid rate key |
AFI81 | INVALID_USER_SESSION | Invalid user session |
AFI82 | INVALID_LIMIT | Invalid limit |
AFI83 | RATE_KEY_NOT_FOUND | Rate key not found |
AFI84 | INVALID_RATE_KEY_SPEC | invalid spec to generate ratekey |
AFI85 | ERROR_RATE_KEY_GENERATION | Failed to generate ratekey |
AFI86 | PROPERTY_NOT_FOUND | The property is disallowed from cdc |
AFI87 | INVALID_NUM_BULK_SEARCH_ROOMS | Invalid num of bulk search rooms |
AFI90 | PROPERTY_NOT_FOUND_FROM_SPEC | The property is not found from demand service |
AFI100 | INVALID_SPEC | Invalid spec |
AFI101 | MISMATCH_EXPECTED_RATE | The expected and current rate are different |
AFI102 | DOUBLE_CONFIRMATION_ID | The booking with given confirmation id is already requested |
AFI103 | ROOM_SOLD_OUT | The room requested is not available anymore |
AFI104 | ALREADY_ISSUED_BOOKING | Already issued booking |
AFI105 | PENDING_ISSUANCE | The booking with given id is pending |
AFI106 | ERROR_BOOKING | Encounter error during booking |
AFI177 | INVALID_CANCELLATION_REQUEST | Invalid cancellation request |
AFI497 | AUTHORIZATION_ERROR | Authorization error |
AFI429 | TOO_MANY_REQUEST | Request exceeds limit |
AFI430 | RESULT_CONVERSION_ERROR | Failed in converting operation result |
AFI108 | INVALID_SETTLEMENT_METHOD | Invalid settlement method |
AFI109 | INVALID_CREDIT_CARD | Invalid credit card |
AFI110 | CREDIT_CARD_FAILED | Credit card failed |
AFI111 | CREDIT_CARD_NOT_FOUND | No credit card is registered |
AFI112 | CREDIT_LIMIT_DATA_FAILED | Failed when gathering credit limit data |
AFI113 | FAILED_BUSINESS_PARTNER_DATA | Failed when gathering business partner data |
AFI114 | FAILED_BUSINESS_AGREEMENT_DATA | Failed when gathering business agreement data |
AFI115 | NULL_BUSINESS_AGREEMENT_DATA | Null business agreement data |
AFI116 | EMPTY_BUSINESS_AGREEMENT_DATA | Empty business agreement data |
AFI117 | MULTIPLE_BUSINESS_AGREEMENT_DATA | Multiple business agreement data |
AFI118 | INACTIVE_BUSINESS_AGREEMENT_DATA | Business agreement is not active |
AFI119 | FAILED_CL_CONFIG_DATA | Failed when gathering credit limit data |
AFI120 | TRANSACTION_NOT_ALLOWED_BY_CL | Insufficient credit limit balance |
AFI123 | TRANSACTION_NOT_ALLOWED_BY_DMS | Deposit transaction failed |
AFI121 | BOOKING_EXPIRED | The booking with given id is expired |
AFI122 | ALREADY_PAID_BOOKING | The booking with given id is already paid |
AFI404 | BOOKING_NOT_FOUND | Booking not found |
AFI503 | SERVICE_UNAVAILABLE | Service unavailable |
AFI999 | UNKNOWN | Unknown 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.