> ## Documentation Index
> Fetch the complete documentation index at: https://docs.d-edge.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This site documents the D-EDGE APIs for technology partners (web agencies, OTAs, PMS and RMS vendors, booking and CRM tools). It is written for developers integrating with hotels that use the D-EDGE platform.
> Seven APIs, grouped by domain. Connectivity: Channel Manager API (distribute a hotel's inventory to your channel and send bookings back). Pricing & Availability: Best Price API (best offers to highlight), Quotation API (all bookable offers for a stay), Daily Rates API (daily availability between two dates). Booking: Booking Engine API (a hotel's full direct booking funnel), Gift Shop API (gift vouchers from catalogue to payment). Guest Management: CRM API (guest profiles).
> Pick the API by the need: to display prices, use the Best Price API or the Daily Rates API; to quote a specific stay, use the Quotation API; to book, use the Booking Engine API; to sell gift vouchers, use the Gift Shop API; to manage guest profiles, use the CRM API; to receive hotel inventory and send bookings back as a distribution channel, use the Channel Manager API.
> Base URLs, hotel identifiers, and credentials are delivered by the D-EDGE partnership team during onboarding. Do not invent base URLs, endpoints, parameters, or example credentials that do not appear on these pages.
> Authentication differs per API: OAuth 1.0 for Best Price, Quotation, Daily Rates, and Booking Engine; an X-API-KEY header for Gift Shop; OAuth 2.0 client credentials for CRM; partner-defined credentials carried in the XML message for the Channel Manager API. Read each API's Authentication page before writing code.
> A mock environment returns realistic but fictitious data without credentials. The Postman and Insomnia collections on the API collections page target it by default. Use it for exploration and tests, never for production traffic.
> Use the official names exactly: D-EDGE, D-EDGE platform, Channel Manager API, partnership team. Do not use Back Office or Extranet.
> Each API has a Changelog page. Check it for the current behaviour before relying on an older answer. For questions these pages do not answer, direct the reader to the Contact us page.

# Conversational booking agent

> Drive the booking funnel from a conversational AI agent

The Booking Engine API is a stateful funnel, which makes it a natural fit for a conversational AI agent. Each stage of the funnel maps to an action the agent performs on the guest's behalf: search, describe, build a basket, quote, and confirm. Expose those stages as tools and the agent can take a guest from a first question to a confirmed booking, all within the conversation.

## Expose the funnel as MCP tools

An MCP server is what turns the funnel into an agent. Wrap each endpoint as a tool, and any MCP-capable assistant, such as Claude, ChatGPT, or Gemini, can search availability and complete a booking inside the conversation, with no app to install. The model decides which tool to call and with what arguments; your tools run the funnel.

Scope the tools to the funnel: expose only the search, basket, quote, and confirmation actions, and keep the configuration endpoints out of the agent's reach.

## Map guest intents to the funnel

The session is the conversation's memory. Open one at the start, keep the `sessionId`, and update it as the guest refines their request. Each intent the agent detects maps to one endpoint:

| Guest intent | Funnel action | Endpoint |
| - | - | - |
| "Find a room for these dates" | Search | `GET /v2/{sessionId}/search/rooms` (or `/search/hotels` across properties) |
| "Tell me about that room" | Describe | `GET /v2/{sessionId}/description/rooms/{roomId}` |
| "Add it to my booking" | Build the basket | `POST /v2/{sessionId}/basket/rooms` |
| "How much is it?" | Quote | `GET /v2/{sessionId}/quote` |
| "Book it" | Accept | `POST /v2/{sessionId}/quote` |
| "Show my confirmation" | Confirm | `GET /v2/booking/{sessionId}/confirmation` |

> [!NOTE]
>
> Payment is hosted and handled by D-EDGE: accepting the quote returns a `redirectionUrl`, and the guest enters their card on the D-EDGE page. The card entry is manual, so the agent hands off at this point. The guest then lands on a D-EDGE confirmation by default; with the **Hotel Domain** feature, the redirect can point to your own URL and act as a webhook to resume the conversation.

## Keep credentials server-side

The agent calls your backend, which signs each request with the OAuth 1.0 keys and calls D-EDGE. Never expose the signing keys to the model or to the client: your backend stays in control of authentication and owns the money path.

## Build the flow

The funnel runs as a sequence of calls. The agent fills in the arguments from the conversation:

```bash cURL theme={null}
# 1. Open a session with the guest's search context
curl -X POST 'https://{apiBaseUrl}/v2/session' --header 'Authorization: OAuth ...' --data '{ ... }'

# 2. Search availability
curl 'https://{apiBaseUrl}/v2/{sessionId}/search/rooms' --header 'Authorization: OAuth ...'

# 3. Add the chosen room to the basket
curl -X POST 'https://{apiBaseUrl}/v2/{sessionId}/basket/rooms' --header 'Authorization: OAuth ...' --data '{ ... }'

# 4. Quote the basket
curl 'https://{apiBaseUrl}/v2/{sessionId}/quote' --header 'Authorization: OAuth ...'

# 5. Accept the quote to start the booking
curl -X POST 'https://{apiBaseUrl}/v2/{sessionId}/quote' --header 'Authorization: OAuth ...' --data '{ ... }'

# 6. The guest pays on a D-EDGE-hosted page (manual card entry), then returns to your confirmation
```

```javascript Node.js theme={null}
const signedHeaders = (url, method) =>
  oauth.toHeader(oauth.authorize({ url, method }, token));

// 1. Open a session with the guest's search context
let url = "https://{apiBaseUrl}/v2/session";
const newSession = await fetch(url, {
  method: "POST",
  headers: { ...signedHeaders(url, "POST"), "Content-Type": "application/json" },
  body: JSON.stringify({ /* ... */ }),
});

// 2. Search availability
url = "https://{apiBaseUrl}/v2/{sessionId}/search/rooms";
const rooms = await fetch(url, { headers: { ...signedHeaders(url, "GET") } });

// 3. Add the chosen room to the basket
url = "https://{apiBaseUrl}/v2/{sessionId}/basket/rooms";
const basket = await fetch(url, {
  method: "POST",
  headers: { ...signedHeaders(url, "POST"), "Content-Type": "application/json" },
  body: JSON.stringify({ /* ... */ }),
});

// 4. Quote the basket
url = "https://{apiBaseUrl}/v2/{sessionId}/quote";
const quote = await fetch(url, { headers: { ...signedHeaders(url, "GET") } });

// 5. Accept the quote to start the booking
url = "https://{apiBaseUrl}/v2/{sessionId}/quote";
const acceptance = await fetch(url, {
  method: "POST",
  headers: { ...signedHeaders(url, "POST"), "Content-Type": "application/json" },
  body: JSON.stringify({ /* ... */ }),
});

// 6. The guest pays on a D-EDGE-hosted page (manual card entry), then returns to your confirmation
```

```python Python theme={null}
# 1. Open a session with the guest's search context
new_session = session.post("https://{apiBaseUrl}/v2/session", json={...}).json()

# 2. Search availability
rooms = session.get("https://{apiBaseUrl}/v2/{sessionId}/search/rooms").json()

# 3. Add the chosen room to the basket
session.post("https://{apiBaseUrl}/v2/{sessionId}/basket/rooms", json={...})  # 204 No Content

# 4. Quote the basket
quote = session.get("https://{apiBaseUrl}/v2/{sessionId}/quote").json()

# 5. Accept the quote to start the booking
acceptance = session.post("https://{apiBaseUrl}/v2/{sessionId}/quote", json={...}).json()

# 6. The guest pays on a D-EDGE-hosted page (manual card entry), then returns to your confirmation
```

```php PHP theme={null}
// 1. Open a session with the guest's search context
$newSession = $client->post('v2/session', ['json' => [ /* ... */ ]]);

// 2. Search availability
$rooms = $client->get('v2/{sessionId}/search/rooms');

// 3. Add the chosen room to the basket
$basket = $client->post('v2/{sessionId}/basket/rooms', ['json' => [ /* ... */ ]]);

// 4. Quote the basket
$quote = $client->get('v2/{sessionId}/quote');

// 5. Accept the quote to start the booking
$acceptance = $client->post('v2/{sessionId}/quote', ['json' => [ /* ... */ ]]);

// 6. The guest pays on a D-EDGE-hosted page (manual card entry), then returns to your confirmation
```

```csharp C# theme={null}
// 1. Open a session with the guest's search context
var sessionRequest = new RestRequest("/v2/session", Method.Post);
sessionRequest.AddJsonBody(new { /* ... */ });
var newSession = await client.ExecuteAsync(sessionRequest);

// 2. Search availability
var rooms = await client.ExecuteAsync(new RestRequest("/v2/{sessionId}/search/rooms", Method.Get));

// 3. Add the chosen room to the basket
var basketRequest = new RestRequest("/v2/{sessionId}/basket/rooms", Method.Post);
basketRequest.AddJsonBody(new { /* ... */ });
var basket = await client.ExecuteAsync(basketRequest);

// 4. Quote the basket
var quote = await client.ExecuteAsync(new RestRequest("/v2/{sessionId}/quote", Method.Get));

// 5. Accept the quote to start the booking
var acceptRequest = new RestRequest("/v2/{sessionId}/quote", Method.Post);
acceptRequest.AddJsonBody(new { /* ... */ });
var acceptance = await client.ExecuteAsync(acceptRequest);

// 6. The guest pays on a D-EDGE-hosted page (manual card entry), then returns to your confirmation
```

```java Java theme={null}
// 1. Open a session with the guest's search context
HttpPost createSession = new HttpPost("https://{apiBaseUrl}/v2/session");
createSession.setEntity(new StringEntity("{ ... }", "UTF-8"));
createSession.setHeader("Content-Type", "application/json");
consumer.sign(createSession);
client.execute(createSession);

// 2. Search availability
HttpGet searchRooms = new HttpGet("https://{apiBaseUrl}/v2/{sessionId}/search/rooms");
consumer.sign(searchRooms);
client.execute(searchRooms);

// 3. Add the chosen room to the basket
HttpPost addRoom = new HttpPost("https://{apiBaseUrl}/v2/{sessionId}/basket/rooms");
addRoom.setEntity(new StringEntity("{ ... }", "UTF-8"));
addRoom.setHeader("Content-Type", "application/json");
consumer.sign(addRoom);
client.execute(addRoom);

// 4. Quote the basket
HttpGet getQuote = new HttpGet("https://{apiBaseUrl}/v2/{sessionId}/quote");
consumer.sign(getQuote);
client.execute(getQuote);

// 5. Accept the quote to start the booking
HttpPost acceptQuote = new HttpPost("https://{apiBaseUrl}/v2/{sessionId}/quote");
acceptQuote.setEntity(new StringEntity("{ ... }", "UTF-8"));
acceptQuote.setHeader("Content-Type", "application/json");
consumer.sign(acceptQuote);
client.execute(acceptQuote);

// 6. The guest pays on a D-EDGE-hosted page (manual card entry), then returns to your confirmation
```

Each step is documented in the [Reference](/booking-engine-api/build/reference/session/post-session.md).

## Tips

* **Re-quote before you confirm**. Call **Get a quote** again right before accepting, so the agent confirms a current price. See [Re-quote right before confirmation](/booking-engine-api/build/best-practices.md#re-quote-right-before-confirmation).
* **Recover an expired session**. Long conversations outlive sessions. When a call returns `400` with `Code: InvalidSessionId`, open a fresh session and replay the context rather than failing the chat.
* **Show prices from the API**. Display prices and totals from the API responses. Do not let the model compute or promise a price.

## Related

> **[Quick start](/booking-engine-api/get-started/quick-start.md)**
>
> Create a session and make your first call.

> **[Best practices](/booking-engine-api/build/best-practices.md)**
>
> Session, funnel, and resilience patterns.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.