API Reference / Bookings
POST
/bookingsCreate 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
| Name | In | Type | Description |
|---|---|---|---|
| packageId* | body | number | Package being booked |
| travelDate* | body | string | ISO date YYYY-MM-DD |
| pax* | body | number | Number of travellers |
| customerName* | body | string | Lead passenger name |
| customerEmail* | body | string | Lead 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.
| Field | Type | Description |
|---|---|---|
| id | number | Newly created booking id |
| packageId | number | Package booked |
| travelDate | string | Travel date |
| pax | number | Party size |
| customerName | string | Lead passenger |
| status | string | Starts 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"
}