Skip to main content

Base URL

http://localhost:8080/api/tours

Get All Tours

GET /api/tours
endpoint
Retrieve a list of all tours in the platform.

Response

tours
array
Array of tour objects

Example

curl -X GET http://localhost:8080/api/tours

Get Tour by ID

GET /api/tours/{tourId}
endpoint
Retrieve details of a specific tour by its ID.

Path Parameters

tourId
long
required
The unique identifier of the tour

Response

Returns a single tour object with the same structure as described in Get All Tours.

Example

curl -X GET http://localhost:8080/api/tours/1

Create Tour

POST /api/tours
endpoint
Create a new tour in the system.

Request Body

guideId
long
required
ID of the guide leading the tour
categoryId
integer
required
ID of the tour category
title
string
required
Tour title (max 180 characters)
description
string
required
Detailed tour description
price
decimal
required
Tour price
currency
string
required
Currency code (3 characters)
durationHours
decimal
required
Tour duration in hours
maxGroupSize
short
required
Maximum number of participants
meetingPoint
string
required
Location where the tour starts
status
enum
required
Tour status: draft, pending, active, or inactive
coverImage
string
URL to the tour cover image
imageClass
string
CSS class for image styling

Response

Returns the created tour object including the generated tourId and timestamps.

Example

curl -X POST http://localhost:8080/api/tours \
  -H "Content-Type: application/json" \
  -d '{
    "guideId": 10,
    "categoryId": 2,
    "title": "Historic City Walking Tour",
    "description": "Explore the historic downtown area with an expert guide",
    "price": 45.00,
    "currency": "USD",
    "durationHours": 3.0,
    "maxGroupSize": 15,
    "meetingPoint": "City Hall Plaza",
    "status": "active",
    "coverImage": "https://example.com/tours/city-tour.jpg",
    "imageClass": "tour-cover-lg"
  }'

Update Tour

PUT /api/tours/{tourId}
endpoint
Update an existing tour by its ID.

Path Parameters

tourId
long
required
The unique identifier of the tour to update

Request Body

Accepts the same fields as Create Tour. All fields are optional - only include fields you want to update.

Response

Returns the updated tour object.

Example

curl -X PUT http://localhost:8080/api/tours/1 \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated Historic City Walking Tour",
    "price": 50.00,
    "status": "active"
  }'

Delete Tour

DELETE /api/tours/{tourId}
endpoint
Delete a tour by its ID.

Path Parameters

tourId
long
required
The unique identifier of the tour to delete

Response

Returns the deleted tour object.

Example

curl -X DELETE http://localhost:8080/api/tours/1

Add Tour Destination

POST /api/tours/{tourId}-add-destination
endpoint
Associate a destination with a tour.

Path Parameters

tourId
long
required
The unique identifier of the tour

Response

Returns the updated tour object with the new destination association.

Example

curl -X POST http://localhost:8080/api/tours/1-add-destination

Build docs developers (and LLMs) love