API Reference / Partner API
POST/partner/destinations

Push a destination

Upsert a destination into the marketplace. The destination is tenant-scoped to the organization that owns your API key. Requires the x-api-key header.

🔑 x-api-keyTry in Console →

Purpose

Sync your own destination master-data into the marketplace. This is an idempotent upsert keyed by your externalRef (or code+name) — safe to call repeatedly. Use it to keep the marketplace’s destination list aligned with your source system. Requires the x-api-key header.

Authentication

Send your partner API key as a header: x-api-key: <your-key>. Mint one via Create a partner API key.

Parameters

NameInTypeDescription
x-api-key*headerstringYour partner API key
code*bodystringISO-3166 alpha-2 country code, e.g. NP
name*bodystringDestination name
countrybodystringCountry name
regionbodystringRegion/state
latitudebodynumber-90 to 90
longitudebodynumber-180 to 180
externalRefbodystringYour system’s idempotency key

Request samples

bash
curl -X POST https://tourapi.nirajp.com.np/api/v1/partner/destinations \
  -H "Content-Type: application/json" \
  -H "x-api-key: tk_live_xxxxxxxxxxxx" \
  -d '{"code":"NP","name":"Kathmandu Valley","country":"Nepal","region":"Bagmati","latitude":27.7172,"longitude":85.324,"externalRef":"ext-12345"}'

Success response

Returns 200 OK with the shape below.

FieldTypeDescription
idnumberMarketplace destination id
codestringCountry code (echoed)
namestringDestination name
countrystringCountry
regionstringRegion
externalRefstringYour idempotency key (echoed)
json
{
  "success": true,
  "message": "Request successful.",
  "data": {
    "id": 4,
    "code": "NP",
    "name": "Kathmandu Valley",
    "country": "Nepal",
    "region": "Bagmati",
    "externalRef": "ext-12345"
  }
}

Errors

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

401Missing or invalid x-api-key header.
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"
  }
}
409A destination with the same externalRef already exists for another tenant.
json
{
  "success": false,
  "message": "Destination conflict"
}
500An unexpected error occurred on our side. Retry; if it persists, contact support.
json
{
  "success": false,
  "message": "Internal server error"
}