Developer Notes

Documentation for API Requests

Documentation for each API request type are described on this page.
Request and receive login credentials for API portal.
Login to API portal: http://api.esytravel.net/api/login.php
Then go to "API List" which is your first page after login.
Click on an API name in the list. 

At the selection box of "API Request Type", select one choice and see its API request and response details.

Notes for Developers

This API is designed for activity products (product_type = "activity"), tour products (product_type = "tour"), annual multi pass product (product_type = "pass"). Gift voucher does not have a dedicated product for it and combo product booking is not supported by API.

Typical Processes are as the follows:

Fetch Product Details

Request Product Details - Single ( POST /api/operatorapi/Product ): Returns single product details. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).

Request Product List with Details ( POST /api/operatorapi/ProductList ): Returns all products with details. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).

Fetch departure schedules and availability:

Request Availability ( POST /api/operatorapi/Availability ): Returns whether a trip on selected date time with selected prices and price units is available to book. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).

Request Timetable ( POST /api/operatorapi/Timetable ): Returns all trip schedule date time within 1 to 31 days from a selected date. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).

Fetch prices and price schedules:

Request prices and price schedules ( POST /api/operatorapi/Prices ): Returns either all available prices regardless date or all available prices on selected dates only. The server end process will verify the price schedule regardless whether the agent side will verify it or not. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).

New Booking with NO Payment

Request Hold a Booking ( POST /api/operatorapi/HoldBooking ): Request to make an unconfirmed (pending) booking in order to preserve places. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).

Request Confirm Booking ( POST /api/operatorapi/ConfirmBookings ): Request to confirm an unconfirmed (pending) booking and change it to an active booking. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).


New Booking with Website Online Payment

Request Hold a Booking ( POST /api/operatorapi/HoldBooking ): Request to make an unconfirmed (pending) booking in order to preserve places. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).

Request Booking and Payment ( POST /api/operatorapi/ConfirmBookingsAndPayment): Request one online payment to cover all unconfirmed bookings in the shopping cart. On successful payment, bookings will be converted into confirmed bookings. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).

Cancel Unconfirmed Booking

( POST /api/operatorapi/CancelOneBooking): Request Cancel one unconfirmed booking in the shopping cart when payment is failed and selected to abandon booking. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).

( POST /api/operatorapi/CancelMultiBookings): Request cancel multiple unconfirmed bookings in the shopping cart when payment is failed and selected to abandon booking. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).

From any booking being added to the shopping cart, operator website page must set the timeout or time limit to maximum 20 minutes (or less). Otherwise it may go into an odd situation that booking is timeout and cancelled but payment is successful. On gateway's payment page after booking page is redirected to, gateway's timeout setting will take effect and bookings are safe from timeout cancellation by operator website own timeout setting.

Please Note: 
Gateway will response twice to each payment request. Do not insert any new database record as it will insert twice when it process response in the redirected URL. Use update record instead if operator website has its own database.

Promo Code Validation

( POST /api/operatorapi/PromoCode): On making one unconfirmed booking, use this request to validate an entered promo code on the booking page. Promo code is designed for one booking only. The validation will check the entered code and return with a discount value in negative amount or 0 amount if it is not valid. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).

Gift Voucher Validation

( POST /api/operatorapi/GiftVoucher): On making one unconfirmed booking, use this request to validate an entered gift voucher number or code and voucher dollar value. Gift voucher is designed for one booking only. The validation will check both the voucher no and the value entered and return with a discount value in negative amount or 0 amount if it is not valid. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).

Gift Voucher ReValue

( POST /api/operatorapi/RevalueGiftVoucher): when editing an unconfirmed booking in the shopping cart, if there is gift voucher entered against the booking value, use this request to fetch the existing gift voucher details and recalculate its discount against the changed booking value. Succeed: response_status = 1 (request valid) and response_code = 710 (Request Succeed).