Prerequisites
Before applying a discount, make sure you have:- A session with a basket that holds at least one room. If not, follow the Quick start, then add a room to the basket.
- The OAuth 1.0 signing setup from the Quick start.
- The discount mode and value your internal rules allow.
How it works
The Get a quote endpoint (GET /v2/{sessionId}/quote) quotes the current basket. Two optional headers apply an exceptional discount on top of that price:
X-AVP-DiscountCalculationMode: how the discount is calculated.X-AVP-DiscountValue: the amount or percentage to apply.
The quote response carries the result in
sellingConditions.discount, alongside the recomputed totals:
name and description are set by the API and cannot be changed: they carry a generic label, so treat them as read-only and do not depend on their exact wording. discountAmount gives the discount in both the requested display currency (converted) and the original currency before conversion (original).
The discount you apply at this step is passed on to the D-EDGE platform and the connected PMS, where it appears as a generic exceptional-discount line.
The discount is applied on each call to Get a quote, not stored on the session. Send the headers again on the final quote the guest accepts, so the total they confirm is the discounted one. See Re-quote right before confirmation.
Apply the discount
The examples reuse the OAuth 1.0 signing setup from the Quick start. Replace
{sessionId} with the session you created.sellingConditions.discount to confirm the discount applied, and the recomputed totalAmount and balanceAmount to display the new price.
Tips
- Cap the discount and gate large ones. Enforce your own maximum and an approval step before sending a high
X-AVP-DiscountValue. The API applies whatever you send, so the guardrail is yours to build. - Log every discount. Record the mode, the value, and who approved it. An audit trail turns a later dispute into a quick lookup.
- Re-quote before payment. Prices and availability move while the guest fills in their details. Send the discount headers again on the final quote so the confirmed total matches what the guest agreed to.
Related
Get a quote
Full schema for the quote endpoint and its headers.
Best practices
Session, funnel, and resilience patterns.