---
title: "Add a live offer to the itinerary"
---

> 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.

# Add a live offer to the itinerary

Path: Nicer API › Trip itinerary

`POST /trip-itinerary/{tripItineraryId}/offers`

URL: `https://api.nicer.travel/trip-itinerary/{tripItineraryId}/offers`

Adds a live offer (hotel room, flight or car rental) to the itinerary as a bookable segment: it re-validates the offer with the provider, saves it as a booking selection and writes the segment, in one call. Adding the same offer to the same trip again returns the segment already there. `status` is `OK` with the segment id, or `UNAVAILABLE` when the offer is gone (search again). A Sabre offer with no DK to book with (the advisor has none and the agency has no default DK) is refused with 422 `BOOKING_SABRE_DK_REQUIRED`.

## Authentication

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

## Path parameters

- `tripItineraryId` (`tripItinerary.offers.create.path.tripItineraryId`; string, required)

## Header parameters

- `x-nicer-company` (`tripItinerary.offers.create.header.x-nicer-company`; string, required) — Company context. Authentication and tenant membership are validated by the API.

## Request body

_Required._

- `offerReference` (`tripItinerary.offers.create.offerReference`; string, required) — The live offer: a room's offerReference from getHotelRooms, or a flight's or car rental's offerReference from its search.
  - minLength: `1`
- `groupId` (`tripItinerary.offers.create.groupId`; string, optional) — Add it among the alternatives of this itinerary slot.
  - minLength: `1`

## Example request

```json
{
  "groupId": "string",
  "offerReference": "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: { "x-nicer-company": process.env.NICER_COMPANY },
});

await nicer.tripItinerary.offers.create({
  "tripItineraryId": "string",
  "offerReference": "string"
});
```

### Nicer CLI

```bash
nicer trip-itinerary offers create --trip-itinerary-id 'string' --company "$NICER_COMPANY" --input - <<'JSON'
{
  "offerReference": "string"
}
JSON
```

### cURL

```bash
curl --request POST \
  --url 'https://api.nicer.travel/trip-itinerary/<tripItineraryId>/offers' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-nicer-company: string' \
  --data '
{
  "groupId": "string",
  "offerReference": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/trip-itinerary/<tripItineraryId>/offers';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-nicer-company': 'string',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({groupId: 'string', offerReference: '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/trip-itinerary/<tripItineraryId>/offers"

payload = {
    "groupId": "string",
    "offerReference": "string"
}
headers = {
    "Content-Type": "application/json",
    "x-nicer-company": "string",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "reason": "string",
  "segmentId": "string",
  "status": "OK",
  "title": "string"
}
```

- `reason` (`tripItinerary.offers.create.response.200.reason`; any of, required)
  - any of the following: `string`, `null`
- `segmentId` (`tripItinerary.offers.create.response.200.segmentId`; any of, required)
  - any of the following: `string`, `null`
- `status` (`tripItinerary.offers.create.response.200.status`; string, required)
  - one of `"OK"`, `"UNAVAILABLE"`
- `title` (`tripItinerary.offers.create.response.200.title`; 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` (`tripItinerary.offers.create.response.400.errorCode`; string, required)
- `errorMessage` (`tripItinerary.offers.create.response.400.errorMessage`; string, required)

### 401

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

#### Example

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

- `errorCode` (`tripItinerary.offers.create.response.401.errorCode`; string, required)
- `errorMessage` (`tripItinerary.offers.create.response.401.errorMessage`; string, required)

### 403

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

#### Example

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

- `errorCode` (`tripItinerary.offers.create.response.403.errorCode`; string, required)
- `errorMessage` (`tripItinerary.offers.create.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Trip-itinerary/tripItinerary.offers.create/index.md
