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

# Quick start

> Create your first session

This guide walks you through your first call to the Gift Shop API. You will authenticate with your API key, open a session with the **Create a new session** endpoint, and use the returned identifier for the rest of the journey.

## Prerequisites

Get the following from D-EDGE before starting:

* **API key**: sent in the `X-API-KEY` header on every request.
* **API base URL**: the base URL for your environment.
* **Hotel or group identifiers**: the gift shop owner you integrate against.

All are delivered during the build step of your [integration journey](/overview/get-started/your-integration-journey.md), after the partnership agreement.

## 1. Create a session

Send a `POST` to the **Create a new session** endpoint with the gift shop owner. Replace the identifiers with the ones delivered by D-EDGE. The full field requirements are documented in the [Reference](/gift-shop-api/build/reference/session/post-session.md).

```bash cURL theme={null}
curl --request POST \
  --url https://{apiBaseUrl}/v1/Session \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "owner": {"groupId": 90001, "hotelId": 30001},
    "culture": "en-GB"
  }'
```

```javascript Node.js theme={null}
const response = await fetch("https://{apiBaseUrl}/v1/Session", {
  method: "POST",
  headers: {
    "X-API-KEY": process.env.DEDGE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    owner: { groupId: 90001, hotelId: 30001 },
    culture: "en-GB",
  }),
});

const session = await response.json();
console.log(response.status, session);
```

```python Python theme={null}
import os
import requests

response = requests.post(
    "https://{apiBaseUrl}/v1/Session",
    headers={"X-API-KEY": os.environ["DEDGE_API_KEY"]},
    json={
        "owner": {"groupId": 90001, "hotelId": 30001},
        "culture": "en-GB",
    },
)

print(response.status_code)
print(response.json())
```

```php PHP theme={null}
require 'vendor/autoload.php';

use GuzzleHttp\Client;

$client = new Client(['base_uri' => 'https://{apiBaseUrl}/']);

$response = $client->post('v1/Session', [
    'headers' => ['X-API-KEY' => getenv('DEDGE_API_KEY')],
    'json'    => [
        'owner'   => ['groupId' => 90001, 'hotelId' => 30001],
        'culture' => 'en-GB',
    ],
]);

echo $response->getStatusCode() . "\n";
echo $response->getBody();
```

```csharp C# theme={null}
using System.Net.Http.Json;

var client = new HttpClient { BaseAddress = new Uri("https://{apiBaseUrl}") };
client.DefaultRequestHeaders.Add("X-API-KEY",
    Environment.GetEnvironmentVariable("DEDGE_API_KEY"));

var response = await client.PostAsJsonAsync("/v1/Session", new
{
    owner = new { groupId = 90001, hotelId = 30001 },
    culture = "en-GB"
});

Console.WriteLine(response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

```java Java theme={null}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newHttpClient();

String body = """
    {
      "owner": {"groupId": 90001, "hotelId": 30001},
      "culture": "en-GB"
    }
    """;

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://{apiBaseUrl}/v1/Session"))
    .header("X-API-KEY", System.getenv("DEDGE_API_KEY"))
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
```

## 2. Use the session

A successful response returns the session identifier:

```json theme={null}
{
  "sessionId": "a0000001-0002-0003-0004-000000000005"
}
```

Carry that identifier in the path of every following call, for example to read the shop's configuration:

```bash theme={null}
curl --request GET \
  --url 'https://{apiBaseUrl}/v1/{sessionId}/Configuration' \
  --header 'X-API-KEY: YOUR_API_KEY'
```

From here, follow the journey: browse the catalogue, build the cart, and confirm it for payment. Each stage is documented in the [Reference](/gift-shop-api/build/reference/session/post-session.md).

## Common issues

| Status | Likely cause | Where to look |
| - | - | - |
| `401` | The `X-API-KEY` header is missing, invalid, or does not give access to the operation | [Authentication](/gift-shop-api/build/guidelines/authentication.md) |
| `400` | Validation error: malformed body or missing field | [Responses](/gift-shop-api/build/guidelines/responses.md) |
| `404` | Unknown `sessionId`, or the session expired; on **Get the gift shop configuration**, possibly no configuration for the session's owner | [Responses](/gift-shop-api/build/guidelines/responses.md) |

## Next steps

> **[Reference](/gift-shop-api/build/reference/session/post-session.md)**
>
> Every endpoint, grouped by stage of the journey.

> **[Guidelines](/gift-shop-api/build/guidelines/authentication.md)**
>
> Authentication, request conventions, and response formats.

> **[Best practices](/gift-shop-api/build/best-practices.md)**
>
> Patterns to run the shop reliably, from caching to session recovery.


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