home > support > API > Marketplace API > managing dates & prices externally > update departure
Create a new departure on a Tour
Part of a series of API calls intended largely for managing dates and prices outside of TourCMS
This API is for Tour Operator usage only (not accessible by Marketplace Agents).
If you are building a user interface to control availability (e.g. perhaps to add or remove a bus on a particular trip), then you should be adjusting spaces_blocked in the table below. The default capacity / availability starting point will be max_departure_size on show departure.
If you know how many spaces remain, you may update spaces_available. E.g. if you know there are 7 spaces available, send us 7. However this is not advisable as when we update our system, we take into account temporary bookings, so if there happen to be 2 temporary bookings that do NOT convert to real bookings (i.e. the customer does not complete their booking process), at the point those temporary bookings are released, we will update to 9 spaces available.
Special offer notes (offer_note) AND product notes (note) can be multi-lingual. I.e. we can have a product note that has an English and a Spanish version, sharing the same field. In this situation we use a JSON to store the two (or more) values. The key to the JSON is a 2 letter language code (i.e. all English is en, not en-US for example)
These values are language specific, not channel specific
Endpoint | /c/tour/datesprices/dep/manage/update |
Formats | XML |
Example | /c/tour/datesprices/dep/manage/update.xml POST data:
|
Verb | POST |
PHP examples use the PHP Client Library with SimpleXML
object update_departure ( SimpleXmlElement $departure_data , int $channel )
// Set our Channel ID
$channel = 3930;
// Start building the departure XML
$departure = new SimpleXMLElement('<departure />');
// Set the Tour this departure should be added to
$departure->addChild('tour_id', 1);
// Set ID for the departure to update
$departure->addChild('departure_id', 3191);
// Add in the fields that need to be updated
// In this case just the code (times)
$departure->addChild('code', '13:30-16:30');
// Query the TourCMS API, updating the departure
$result = $tourcms->update_departure($departure , $channel);
if($result->error == "OK") {
print "Departure updated";
} else {
print $result->error;
}
Departure updated
C# examples use the .Net Client Library
Coming soon
VB examples use the .Net Client Library
Coming soon
NodeJS examples use the NodeJS Wrapper
TourCMS.updateDeparture({
departure: {
tour_id: 6,
departure_id: 4954,
special_offer: {
offer_price: 45,
offer_note: "Early booking discount"
}
},
callback: function(response) {
console.log(response.error);
}
});
OK
Looking for sample code in a different language? TourCMS and community provided API libraries
There are no querystring parameters.
The fields that can be used are as per the Create departure method, with the addition of a departure_id node to indicate which departure to update. At a bare minimum the tour_id and departure_id must be provided.
XML Node | Notes | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
departure |
A departure containing:
|
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. | tour |
A tour node containing the following:
|