API Reference / Partner API
POST
/partner/destinationsPush 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
| Name | In | Type | Description |
|---|---|---|---|
| x-api-key* | header | string | Your partner API key |
| code* | body | string | ISO-3166 alpha-2 country code, e.g. NP |
| name* | body | string | Destination name |
| country | body | string | Country name |
| region | body | string | Region/state |
| latitude | body | number | -90 to 90 |
| longitude | body | number | -180 to 180 |
| externalRef | body | string | Your 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.
| Field | Type | Description |
|---|---|---|
| id | number | Marketplace destination id |
| code | string | Country code (echoed) |
| name | string | Destination name |
| country | string | Country |
| region | string | Region |
| externalRef | string | Your 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"
}