home > support > API > Marketplace API > Travel agent Search
Get a list of travel agents. Use if developing a solution to allow creation of bookings assigned to specific travel agents.
Allows searching by several criteria, returns basic information about the agent plus a booking_key that can be used when creating bookings.
For use by tour operators only, not available for those accessing the API with Marketplace Agent credentials.
Call | /c/agents/search |
Formats | XML |
Example | /p/agents/search.xml?q=Example |
Verb | GET |
PHP examples use the PHP Client Library with SimpleXML
object search_agents ( string $params, int $channel )
$params
Search querystring, see possible values in the table below
$channel
Your channel
// Channel ID
$channel = 3930;
// Optionally define search parameters
// Here we are just returning agents whose name/code contains the text "Example"
$params = "q=Example";
// Query the TourCMS API
$result = $tourcms->search_agents($params, $channel);
// Loop through each agent
foreach($results->agent as $agent) {
// Print out the name and code
print $agent->agent_name." ( ".$agent->agent_code." ) ";
print "<br />";
}
Example Agent (EXAMP1)
Another Example (EXAMP2)
C# examples use the .Net Client Library
VB examples use the .Net Client Library
Enter your TourCMS API credentials below to call the Search Agents endpoint.
Parameter | Notes |
---|---|
order | Default order is by name, set to toprecent to order by number of recent bookings |
agent_id | The account specific Agent ID for the agent. |
agent_marketplace_id | The system-wide TourCMS Marketplace ID (maid) for the agent. |
agent_group | Load agents from a specific group. Exact match only |
q | Search agent name/code, returns partial matches |
filter | Set to staff_ui to limit results to those agents that have had bookings assigned to them by staff - useful if an account contains many agents with only a small subset that will be assigned bookings by staff |
per_page | Number of results to return per page. Max is 500. |
page | Integer for which page number to return. Default is page 1 |
billing |
Integer with required value depending on billing type. Who pays the balance. 2 = Retail travel agent (Trade sale - the travel agent responsible for paying for the booking) If the booking is value of 100 and the travel agent is on 10% commission the travel agent will pay 90 Ideal for retail travel agents who must pay at the point of booking (like customers do). -1 = Trusted travel agent (Trade sale - the travel agent responsible for paying for the booking) If the booking is value of 100 and the travel agent is on 10% commission the travel agent will pay 90 Web bookings will be immediately confirmed EVEN without payment. 1 = Lead customer (Customer will pay - but net of any commission due on the booking) If the booking is value of 100 and the travel agent is on 10% commission the customer will pay 90. 0 = Lead customer (Advertising tracking or web affiliate style agent - customer will pay the full value) If the booking is value of 100 and the travel agent is on 10% commission the customer will pay 100 and the travel agent will subsequently be paid 10. Ideal for web affiliates and hotel concierges. |
XML Node | Notes | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request | Confirmation of the request that you sent | ||||||||||||||||||||||
error | Any error message returned, if there is no error this will just contain the text OK | ||||||||||||||||||||||
total_agent_count | Total number of agents returned by the search (i.e. not just the number on this page) | ||||||||||||||||||||||
agent |
There will be one agent node for each result on this page. Each agent node contains the following child nodes.
|