---
title: "Assign an order's responsible advisor"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.nicer.travel/llms.txt
> Use this file to discover all available pages before exploring further.

# Assign an order's responsible advisor

Path: Nicer API › Commerce

`PUT /commerce/orders/{orderId}/advisor`

URL: `https://api.nicer.travel/commerce/orders/{orderId}/advisor`

Admin-only local assignment with revision checks and audit. Does not call a provider, change its DK, or transfer earned commissions.

## Authentication

- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Path parameters

- `orderId` (`commerce.orders.advisor.update.path.orderId`; string, required)

## Header parameters

- `Idempotency-Key` (`commerce.orders.advisor.update.header.Idempotency-Key`; string, required) — Unique key (8–255 chars) per request; replays return the original result.

## Request body

_Required._

- `assignment` (`commerce.orders.advisor.update.assignment`; one of, required)
  - every option has:
    - `mode` (`<option>.mode`; string, required)
  - one of the following, each adding:
    - `object` (`commerce.orders.advisor.update.assignment.1`)
    - `object` (`commerce.orders.advisor.update.assignment.2`)
    - `object` (`commerce.orders.advisor.update.assignment.3`)
      - `advisorUserId` (`commerce.orders.advisor.update.assignment.3.advisorUserId`; string, required)
        - minLength: `1`
- `expectedVersion` (`commerce.orders.advisor.update.expectedVersion`; integer, required)
  - maximum: `9007199254740991`
- `reason` (`commerce.orders.advisor.update.reason`; string, required)
  - maxLength: `500` · minLength: `1`

## Example request

```json
{
  "assignment": {
    "mode": "INHERIT"
  },
  "expectedVersion": 9007199254740991,
  "reason": "string"
}
```

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
  headers: { "Idempotency-Key": process.env.NICER_IDEMPOTENCY_KEY },
});

await nicer.commerce.orders.advisor.update({
  "orderId": "string",
  "assignment": {
    "mode": "INHERIT"
  },
  "expectedVersion": 9007199254740991,
  "reason": "string"
});
```

### Nicer CLI

```bash
nicer commerce orders advisor update --order-id 'string' --input - <<'JSON'
{
  "assignment": {
    "mode": "INHERIT"
  },
  "expectedVersion": 9007199254740991,
  "reason": "string"
}
JSON
```

### cURL

```bash
curl --request PUT \
  --url 'https://api.nicer.travel/commerce/orders/<orderId>/advisor' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: string' \
  --data '
{
  "assignment": {
    "mode": "INHERIT"
  },
  "expectedVersion": 9007199254740991,
  "reason": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/commerce/orders/<orderId>/advisor';
const options = {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
    'Idempotency-Key': 'string',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({
    assignment: {mode: 'INHERIT'},
    expectedVersion: 9007199254740991,
    reason: 'string'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.nicer.travel/commerce/orders/<orderId>/advisor"

payload = {
    "assignment": { "mode": "INHERIT" },
    "expectedVersion": 9007199254740991,
    "reason": "string"
}
headers = {
    "Content-Type": "application/json",
    "Idempotency-Key": "string",
    "Authorization": "Bearer <token>"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "orderId": "string",
  "orderVersion": 9007199254740991,
  "assignment": {
    "mode": "INHERIT"
  },
  "advisorUserId": "string"
}
```

- `orderId` (`commerce.orders.advisor.update.response.200.orderId`; string, required)
  - minLength: `1`
- `orderVersion` (`commerce.orders.advisor.update.response.200.orderVersion`; integer, required)
  - maximum: `9007199254740991`
- `assignment` (`commerce.orders.advisor.update.response.200.assignment`; one of, required)
  - every option has:
    - `mode` (`<option>.mode`; string, required)
  - one of the following, each adding:
    - `object` (`commerce.orders.advisor.update.response.200.assignment.1`)
    - `object` (`commerce.orders.advisor.update.response.200.assignment.2`)
    - `object` (`commerce.orders.advisor.update.response.200.assignment.3`)
      - `advisorUserId` (`commerce.orders.advisor.update.response.200.assignment.3.advisorUserId`; string, required)
        - minLength: `1`
- `advisorUserId` (`commerce.orders.advisor.update.response.200.advisorUserId`; any of, required)
  - any of the following: `string`, `null`

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.orders.advisor.update.response.400.errorCode`; string, required)
- `errorMessage` (`commerce.orders.advisor.update.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.orders.advisor.update.response.401.errorCode`; string, required)
- `errorMessage` (`commerce.orders.advisor.update.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.orders.advisor.update.response.403.errorCode`; string, required)
- `errorMessage` (`commerce.orders.advisor.update.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Commerce/commerce.orders.advisor.update/index.md
