API Reference / Packages
POST/packages

Create a package

Publish a new tour package. Requires the package.create permission.

🔒 JWT BearerTry in Console →

Purpose

Add a new tour package to your catalog. After creation the package is immediately listable and bookable. This is the write counterpart to List packages.

Authentication

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

Parameters

NameInTypeDescription
title*bodystringPackage title
destination*bodystringDestination country/region
durationDays*bodynumberTrip length in days
price*bodynumberPer-person price
currency*bodystringISO currency, e.g. USD
categorybodystringe.g. trekking, tour, safari

Request samples

bash
curl -X POST https://tourapi.nirajp.com.np/api/v1/packages \
  -H "Content-Type: application/json" \
  -d '{"title":"Everest Base Camp Trek","destination":"Nepal","durationDays":12,"price":1240,"currency":"USD","category":"trekking"}'

Success response

Returns 200 OK with the shape below.

FieldTypeDescription
idnumberNewly created package id
titlestringEchoed title
destinationstringEchoed destination
durationDaysnumberTrip length
pricenumberPer-person price
currencystringCurrency code
categorystringCategory
statusstring"active" once published
json
{
  "success": true,
  "message": "Request successful.",
  "data": {
    "id": 1,
    "title": "Everest Base Camp Trek",
    "destination": "Nepal",
    "durationDays": 12,
    "price": 1240,
    "currency": "USD",
    "category": "trekking",
    "status": "active"
  }
}

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"
  }
}
403Authenticated but the account/role lacks permission for this action.
json
{
  "success": false,
  "message": "Forbidden"
}
500An unexpected error occurred on our side. Retry; if it persists, contact support.
json
{
  "success": false,
  "message": "Internal server error"
}