Prerequisites
- An API key and the shop identifiers, delivered by D-EDGE. See Authentication.
- A configured gift shop: the hotelier creates the products and sets their prices in the D-EDGE platform. The API exposes the catalogue; it does not manage it.
How it works
Open a session for the shop, then build the page from two reads. Get the gift shop configuration carries the identity: name, address, contact, rating, time zone, preferred culture, theme, and the accepted payment methods with the cards each of them takes. Search active products carries the offer. From there, Add a cart item and Confirm the cart close the sale, and the guest pays on the D-EDGE-hosted page.Hotel shop or group shop
A gift shop is configured at hotel level or at group level in the D-EDGE platform, and the session’sowner must match that configuration. For a hotel-level shop, send both identifiers delivered by D-EDGE:
hotelId is optional: leave it out, or send 0.
Everything downstream follows the shop you opened: the configuration carries its identity, the catalogue its products, and the order its owner. For a group-level shop, one storefront serves every property, and a value voucher sold there is spendable on the booking engines of the group’s hotels. Open the session in the guest’s culture (product and category names follow it); you can switch the culture mid-journey with Update the session, without losing the cart.
Read the shop’s identity
The examples send the
X-API-KEY header introduced in the Quick start. Replace {sessionId} with your session.Render the catalogue
Search active products returns the shop’s live catalogue in the session’s culture. Each product carries its pictures, description, usage, price (Fixed, or a Range the guest picks an amount in), quantity limits, and validity:
Range price, render an amount picker bounded by minAmount and maxAmount. For a Fixed price, show the amount and send that exact amount when adding to the cart: the amount field is required in both cases, and a missing or different amount is rejected with a 400.
Tips
- Cache the shell, not the cart. The configuration, categories, and localisation lists are stable; cache them. Read the cart from the API whenever you display it, so totals and taxes are always the server’s. See Best practices.
- Bring the guest home after payment. Pass a
confirmationUrlwhen you confirm the cart: after the D-EDGE-hosted payment, the guest lands back on your storefront. - Design for mobile first. A large share of gift purchases happens on a phone, often days before the occasion.
Related
Get the gift shop configuration
Full schema for the configuration endpoint.
Search active products
The live catalogue, in the session’s culture.