Prerequisites
Before building a member rate widget, make sure you have:- A working Best Price call. If not, follow the Quick start first.
- A hotel ID and a group ID.
- A target date or date window.
- An active loyalty programme on the property, configured by D-EDGE.
How it works
The Best Price Rates endpoint returns one entry per rate and requested strategy, with the best price found over your date window and the arrival date it applies to. TheloyaltyProgram filter tells the API which membership tier to consider when picking the best rate:
- Without
loyaltyProgram(ormembershipLevel: 0): the API returns rates open to non-members. The cheapest is your public BAR. - With
loyaltyProgram: { membershipLevel: N }: the API includes rates restricted to members at tier N. The cheapest is your member rate at that tier.
Build the showcase
The examples below assume the OAuth signing setup from the Quick start.
Run a public and a member call in parallel
Same date range, same party in both calls. The only difference is the
loyaltyProgram filter on the member call.Pick the cheapest entry from each response
For each response, filter to entries where
status is Available or OnRequest and pick the smallest totalPrice. That entry carries the headline price for its side of the comparison.Tips
- Match every other parameter between the two calls. Date range, party, room filter, currency. Any difference there contaminates the comparison.
- Pick the right tier to compare against. Most chains run a basic entry-level tier (
1) and elite tiers above (2,3, etc., typically Silver or Gold). For the entry-point widget, tier 1 is the right choice: it sets the floor a non-member crosses by signing up. Showcase higher tiers separately on the loyalty programme page. - Cache both calls. Use a key that includes the membership level. The same widget refreshed across many visitors hits the cache and stays fast.
- Handle the no-saving case. Some dates have no member-only deal active. If the member rate matches or exceeds the public rate, hide the saving label rather than showing “save €0”, which undermines the value prop.
- Be transparent about what is included. If your public rate excludes breakfast and the member rate includes it, surface that in the comparison. Otherwise the visitor feels misled when they reach the booking step.
Related
Reference
Full schema for the Rates endpoint.
Best practices
Caching, performance, and resilience patterns.