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

# Gift card to direct booking

> Sell a gift card online and let it pay for a direct booking

Value vouchers close the loop with direct bookings: bought on the hotel's website, spent on the hotel's booking engine. The Gift Shop API is the sales side of that loop; redemption is already built into the payment page D-EDGE hosts, so there is nothing to wire on the booking side.

## Sell the right products

Only products whose [`usage`](/gift-shop-api/get-started/introduction#two-kinds-of-products) is `Direct` are spendable online. Filter the catalogue on that field and present these as the "spend on your next stay" offer:

```javascript theme={null}
const { products } = await searchProducts(sessionId);
const giftCards = products.filter((p) => p.usage === "Direct");
```

A `Range` price fits gift cards well: the buyer picks the amount, between the shop's `minAmount` and `maxAmount`.

## What the beneficiary does with the code

After payment, the voucher code travels to the beneficiary by email. To spend it, they book on the hotel's (or group's) booking engine and enter the code on the payment page. The code deducts its value from the total, and D-EDGE marks the voucher as spent.

If you build the booking funnel yourself with the [Booking Engine API](/booking-engine-api/get-started/introduction.md), the loop stays closed with zero extra work. Accepting the quote redirects the guest to the same D-EDGE-hosted payment page, where the voucher field lives.

## Read the order and its codes

> [!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 the session that confirmed the purchase.

Once the shopper has paid, **Get the order** returns each voucher with its code, expiry, and status:

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

```javascript Node.js theme={null}
const response = await fetch("https://{apiBaseUrl}/v1/{sessionId}/Order", {
  headers: { "X-API-KEY": process.env.DEDGE_API_KEY },
});

const order = await response.json();
```

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

response = requests.get(
    "https://{apiBaseUrl}/v1/{sessionId}/Order",
    headers={"X-API-KEY": os.environ["DEDGE_API_KEY"]},
)

order = response.json()
```

```php PHP theme={null}
$response = $client->get('v1/{sessionId}/Order', [
    'headers' => ['X-API-KEY' => getenv('DEDGE_API_KEY')],
]);

$order = json_decode($response->getBody(), true);
```

```csharp C# theme={null}
var request = new HttpRequestMessage(HttpMethod.Get, "/v1/{sessionId}/Order");

var response = await client.SendAsync(request);
var order = JsonDocument.Parse(
    await response.Content.ReadAsStringAsync()).RootElement;
```

```java Java theme={null}
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://{apiBaseUrl}/v1/{sessionId}/Order"))
    .header("X-API-KEY", System.getenv("DEDGE_API_KEY"))
    .GET()
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
JsonNode order = mapper.readTree(response.body());
```

```json theme={null}
{
  "id": 5001,
  "reference": "GS0001ABCD",
  "items": [
    {
      "code": "VOUC001-ABC",
      "status": "Active",
      "usage": "Direct",
      "amount": { "amount": 150.0, "currency": "EUR" },
      "expiryDate": "2027-12-02T00:00:00+00:00"
    }
  ]
}
```

`status` starts at `Active` (paid, still redeemable) and becomes `Spent` on redemption, or `Expired` past the product's validity. Two more values exist: `Refund` when the item has been refunded, and `Unknown` when the state could not be determined. Handle all five in your interface, so a refunded voucher does not display as spendable.

## Tips

* **Say where the card is spendable, at purchase time**. "To use on our booking site" on the product page prevents the beneficiary from showing up at the desk with an online-only card.
* **A gift card always shows its value**. `hidePrice` has no effect on `Direct` products: the API accepts the flag and keeps the price visible. Reserve the price-hiding option for `Indirect` service vouchers.
* **Treat the code as money**. Store and display voucher codes with the same care as credentials, as covered in [Best practices](/gift-shop-api/build/best-practices.md#treat-the-order-as-sensitive).
* **Track redemption in the D-EDGE platform, not the API**. The order endpoint is scoped to the purchase session; the hotelier follows the life of the voucher afterwards (who spent it, when, and on which booking) in the platform's Orders page. Do not build a redemption poller on the API.
* **Group shops widen the loop**. A card sold by a group shop is spendable on the booking engines of the group's hotels. See [Hotel shop or group shop](/gift-shop-api/resources/use-cases/branded-storefront.md#hotel-shop-or-group-shop).

## Related

> **[Get the order](/gift-shop-api/build/reference/order/get-order.md)**
>
> Full schema for the order, its vouchers, and their statuses.

> **[Booking Engine API](/booking-engine-api/get-started/introduction.md)**
>
> Build the direct booking funnel the card is spent on.


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