API Reference / Bookings
POST/bookings

Create a booking

Place a booking on a package. Creating a booking fires a booking.created webhook to all subscribed partner URLs.

🔒 JWT BearerTry in Console →

Purpose

Record a new booking against one of your packages. This is the key transactional endpoint — on success we immediately dispatch a signed booking.created webhook to every webhook subscription you have configured, so your own systems (and any partner integrations) stay in sync.

Authentication

Send your access token as a Bearer header: Authorization: Bearer <token>. Obtain it from Authenticate a user.

Parameters

NameInTypeDescription
packageId*bodynumberPackage being booked
travelDate*bodystringISO date YYYY-MM-DD
pax*bodynumberNumber of travellers
customerName*bodystringLead passenger name
customerEmail*bodystringLead passenger email

Request samples

bash
curl -X POST https://tourapi.nirajp.com.np/api/v1/bookings \
  -H "Content-Type: application/json" \
  -d '{"packageId":1,"travelDate":"2026-10-04","pax":2,"customerName":"John Smith","customerEmail":"john@example.com"}'

Success response

Returns 200 OK with the shape below.

FieldTypeDescription
idnumberNewly created booking id
packageIdnumberPackage booked
travelDatestringTravel date
paxnumberParty size
customerNamestringLead passenger
statusstringStarts as "pending"; webhook confirms downstream
json
{
  "success": true,
  "message": "Request successful.",
  "data": {
    "id": 5,
    "packageId": 1,
    "travelDate": "2026-10-04",
    "pax": 2,
    "customerName": "John Smith",
    "status": "pending"
  }
}

Errors

All errors share the envelope { "success": false, "message": "..." }.

401No or invalid authentication token supplied.
json
{
  "success": false,
  "message": "Unauthorized"
}
400A required field is missing or malformed (e.g. invalid email, short password).
json
{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "email": "email must be a valid email"
  }
}
404The resource id does not exist or belongs to another organization.
json
{
  "success": false,
  "message": "Not found"
}
409The package is no longer bookable (sold out / archived).
json
{
  "success": false,
  "message": "Package not bookable"
}
500An unexpected error occurred on our side. Retry; if it persists, contact support.
json
{
  "success": false,
  "message": "Internal server error"
}