Skip to main content
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: 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

The examples send the X-API-KEY header introduced in the Quick start. 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.
A 201 returns the created item identifiers:
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.
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:

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.

Add a cart item

Full schema for the cart item and its gift options.

Confirm the cart

The shopper’s details and the payment hand-off.