Create or replace a tour
Create a tour with its itinerary and packages, or replace it, by your own ID.
{BASE_URL}/tours/:externalIdThe first PUT of an externalId creates the tour as a draft (201); later ones replace it
(200) and keep whether it is published. Send the whole tour. Requires the REGISTRATION scope.
A Technology Provider also needs the Tours module. See Sync your listings.
A tour can be published once it has a destination, a duration, a description, at least one itinerary
day and at least one package; until then publish answers 409 tour_not_ready with what is missing,
and every response says readyToPublish.
Body
namestringrequired- 1–120 characters.
typestringoptionalDOMESTIC(default),INBOUNDorOUTBOUND.destinationstring | nulloptional- Up to 160 characters.
startingPointstring | nulloptional- Up to 160 characters.
endingPointstring | nulloptional- Up to 160 characters.
durationstring | nulloptional- In words, for example
3 days 2 nights. Up to 160 characters. descriptionstring | nulloptional- Up to 5,000 characters.
tagsstring[]optional- Up to 10, each up to 40 characters.
posterstring | nulloptional- A URL from
POST /media. gallerystring[]optional- Up to 12 URLs from
POST /media. routeStopsstring[]optional- Up to 30.
requirementsstring[]optional- Up to 30, each up to 300 characters.
includedstring[]optional- Up to 30, each up to 300 characters.
notIncludedstring[]optional- Up to 30, each up to 300 characters.
infoBlocksstring[]optional- Up to 10, each up to 2,000 characters.
customizationEnabledbooleanoptional- Whether customers may ask to customise it. Defaults to
false. customizationOptionsstring[]optional- Any of
DATE,GUEST_COUNT,ACCOMMODATION,ITINERARY. bookingOptionstringoptionalCONSULTATION(default — customers ask first) orDIRECT.itineraryobject[]optional- Up to 30 days in order,
{ title, activities? }. packagesobject[]optional- Up to 10 ways to book it — see below.
packages[]
externalIdstringrequired- Your own ID for the package, unique within the tour. 1–128 letters, digits or
. _ ~ : -. travelTypestringrequired- For example
Standard. Up to 160 characters. accommodationstring | nulloptional- Up to 160 characters.
guestCountintegerrequired- Guests the price covers, 1–1,000.
adultPriceintegerrequired- Whole taka, 0–10,000,000.
childPriceinteger | nulloptional- Whole taka.
durationstring | nulloptional- Up to 160 characters.
Packages keep their identity
Customers book a package, so Localoy matches each package by its externalId and updates it in
place — reorder them, change a price, and existing bookings keep pointing at the right package. Leaving
out a package that has bookings is refused (409 package_has_bookings).
The brand colour, brochure and departure dates are set in the Partner Portal and are left as they are.
| Status | Code | When |
|---|---|---|
400 | packages.externalId_required, packages_externalId_repeated | A package has no externalId, or two share one. |
400 | image_not_imported | poster or a gallery image is not a URL from POST /media. |
409 | package_has_bookings | You left out a package that has bookings. |
409 | tour_not_ready | publish before the tour is complete. details.blockers lists what is missing. |
curl -X PUT "$LOCALOY_BASE_URL/tours/sundarbans-3d" \
-H "Authorization: Bearer $LOCALOY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Sundarbans 3 days",
"destination": "Sundarbans",
"duration": "3 days 2 nights",
"description": "Three days on the river.",
"bookingOption": "DIRECT",
"itinerary": [
{ "title": "Khulna to Harbaria", "activities": "Boat, jungle walk" },
{ "title": "Kotka" }
],
"packages": [
{ "externalId": "std", "travelType": "Standard", "guestCount": 2, "adultPrice": 18000 },
{ "externalId": "lux", "travelType": "Luxury", "accommodation": "Cabin", "guestCount": 2, "adultPrice": 30000, "childPrice": 15000 }
]
}'{
"success": true,
"message": "Tour updated",
"dryRun": false,
"created": false,
"data": {
"externalId": "sundarbans-3d",
"id": "cm4t0ur000000000000001",
"name": "Sundarbans 3 days",
"type": "DOMESTIC",
"destination": "Sundarbans",
"duration": "3 days 2 nights",
"bookingOption": "DIRECT",
"itinerary": [
{ "title": "Khulna to Harbaria", "activities": "Boat, jungle walk" },
{ "title": "Kotka", "activities": null }
],
"packages": [
{ "externalId": "std", "id": "cm4pkg0000000000000001", "travelType": "Standard", "accommodation": null, "guestCount": 2, "adultPrice": 18000, "childPrice": null, "duration": null },
{ "externalId": "lux", "id": "cm4pkg0000000000000002", "travelType": "Luxury", "accommodation": "Cabin", "guestCount": 2, "adultPrice": 30000, "childPrice": 15000, "duration": null }
],
"published": false,
"readyToPublish": true,
"…": "…"
}
}