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

# Voucher for a friend

> Send a personalised voucher to a loved one, price hidden

Most gift shop purchases are for someone else. The cart carries that intent natively: each item says who receives the voucher, with a personal message, the sender's name, and, on `Indirect` products, the option to hide the price on the voucher itself.

## Gift options

Every cart item accepts five gift fields:

| Field | Role |
| - | - |
| `sendTo` | `Beneficiary` sends the voucher to someone else; `Shopper` sends it to the buyer |
| `beneficiary` | The recipient's first name, last name, and email |
| `comment` | A personal message, printed on the voucher |
| `sentFrom` | The sender's name, as signed on the voucher |
| `hidePrice` | Hides the amount on the voucher document. Works on `Indirect` products only: a `Direct` voucher always shows its value, and the API ignores the flag |

After payment, D-EDGE emails the voucher to the beneficiary and the purchase confirmation to the shopper. Nothing to build on your side beyond the form.

## Add a gift to the cart

> [!NOTE]
>
> The examples send the `X-API-KEY` header introduced in the [Quick start](/gift-shop-api/get-started/quick-start.md). Replace `{sessionId}` with your session, and the `productId` and `amount` with a product from your catalogue. The example adds an `Indirect` product (a spa session), where `hidePrice` takes effect; the `amount` is required and must equal the product's `Fixed` price.

```bash cURL theme={null}
curl --request POST \
  --url 'https://{apiBaseUrl}/v1/{sessionId}/cart/item' \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "productId": 80002,
    "quantity": 1,
    "amount": { "amount": 150.0, "currency": "EUR" },
    "hidePrice": true,
    "comment": "Happy birthday, enjoy!",
    "sendTo": "Beneficiary",
    "beneficiary": {
      "firstName": "Alex",
      "lastName": "Example",
      "email": "beneficiary@example.com"
    },
    "sentFrom": "Guest"
  }'
```

```javascript Node.js theme={null}
const response = await fetch("https://{apiBaseUrl}/v1/{sessionId}/cart/item", {
  method: "POST",
  headers: {
    "X-API-KEY": process.env.DEDGE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    productId: 80002,
    quantity: 1,
    amount: { amount: 150.0, currency: "EUR" },
    hidePrice: true,
    comment: "Happy birthday, enjoy!",
    sendTo: "Beneficiary",
    beneficiary: {
      firstName: "Alex",
      lastName: "Example",
      email: "beneficiary@example.com",
    },
    sentFrom: "Guest",
  }),
});

const { cartItemIds } = await response.json();
```

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

response = requests.post(
    "https://{apiBaseUrl}/v1/{sessionId}/cart/item",
    headers={"X-API-KEY": os.environ["DEDGE_API_KEY"]},
    json={
        "productId": 80002,
        "quantity": 1,
        "amount": {"amount": 150.0, "currency": "EUR"},
        "hidePrice": True,
        "comment": "Happy birthday, enjoy!",
        "sendTo": "Beneficiary",
        "beneficiary": {
            "firstName": "Alex",
            "lastName": "Example",
            "email": "beneficiary@example.com",
        },
        "sentFrom": "Guest",
    },
)

cart_item_ids = response.json()["cartItemIds"]
```

```php PHP theme={null}
$response = $client->post('v1/{sessionId}/cart/item', [
    'headers' => ['X-API-KEY' => getenv('DEDGE_API_KEY')],
    'json'    => [
        'productId'   => 80002,
        'quantity'    => 1,
        'amount'      => ['amount' => 150.0, 'currency' => 'EUR'],
        'hidePrice'   => true,
        'comment'     => 'Happy birthday, enjoy!',
        'sendTo'      => 'Beneficiary',
        'beneficiary' => [
            'firstName' => 'Alex',
            'lastName'  => 'Example',
            'email'     => 'beneficiary@example.com',
        ],
        'sentFrom'    => 'Guest',
    ],
]);

$cartItemIds = json_decode($response->getBody(), true)['cartItemIds'];
```

```csharp C# theme={null}
var response = await client.PostAsJsonAsync("/v1/{sessionId}/cart/item", new
{
    productId = 80002,
    quantity = 1,
    amount = new { amount = 150.0, currency = "EUR" },
    hidePrice = true,
    comment = "Happy birthday, enjoy!",
    sendTo = "Beneficiary",
    beneficiary = new
    {
        firstName = "Alex",
        lastName = "Example",
        email = "beneficiary@example.com"
    },
    sentFrom = "Guest"
});

var cartItemIds = JsonDocument.Parse(
    await response.Content.ReadAsStringAsync()).RootElement.GetProperty("cartItemIds");
```

```java Java theme={null}
String body = """
    {
      "productId": 80002,
      "quantity": 1,
      "amount": { "amount": 150.0, "currency": "EUR" },
      "hidePrice": true,
      "comment": "Happy birthday, enjoy!",
      "sendTo": "Beneficiary",
      "beneficiary": {
        "firstName": "Alex",
        "lastName": "Example",
        "email": "beneficiary@example.com"
      },
      "sentFrom": "Guest"
    }
    """;

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://{apiBaseUrl}/v1/{sessionId}/cart/item"))
    .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());
JsonNode cartItemIds = mapper.readTree(response.body()).path("cartItemIds");
```

A `201` returns the created item identifiers:

```json theme={null}
{
  "cartItemIds": ["b2000002-0002-0003-0004-200000000002"]
}
```

One cart item is created per unit: `quantity: 3` returns three identifiers, and each item carries its own message, recipient, and price visibility, edited separately with **Update a cart item**.

## Shopper form

The confirmation step needs the shopper's own details, including a country, and can carry a phone code. Two localisation endpoints feed that form: **Get country names**, translated into the session's culture, and **Get phone codes**.

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

```json theme={null}
{
  "FR": "France",
  "GB": "United Kingdom",
  "US": "United States"
}
```

**Get phone codes** returns one entry per country too, but with lowercase keys, English names whatever the session culture, and a value that combines the country name with the dialling prefix. Parse it before rendering a prefix select:

```json theme={null}
{
  "fr": "France - +33",
  "gb": "United Kingdom - +44",
  "us": "United States - +1"
}
```

## Tips

* **Validate the beneficiary's email twice**. It is where the voucher lands; a typo is a lost gift and a support ticket. An email confirmation field is worth the friction here.
* **Offer `hidePrice` on `Indirect` gifts only**. When `sendTo` is `Beneficiary`, most buyers expect the amount of a service to stay private. On a `Direct` product the flag has no effect: the API accepts it, then keeps the price visible, so a toggle there would silently do nothing.
* **Cap the message length in your form**. The `comment` is printed on the voucher document; a short, well-displayed message beats a truncated one.
* **Keep `Shopper` one click away**. Some buyers want to print the voucher and hand it over themselves; `sendTo: "Shopper"` covers them with the same cart.

## Related

> **[Add a cart item](/gift-shop-api/build/reference/cart/post-cart-item.md)**
>
> Full schema for the cart item and its gift options.

> **[Confirm the cart](/gift-shop-api/build/reference/cart/post-cart-confirm.md)**
>
> The shopper's details and the payment hand-off.


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