Skip to content

Build an affiliate link by hand

Most affiliates make links in Portal (see Links). If you generate links from your own code, for example a page that lists hundreds of hotels, you can build the same link yourself. This guide shows how.

The link you build opens a hotel’s page on the Wink booking engine, book.wink.travel. The traveler books and pays there, and the booking is credited to your account.

  • A customization ID. It is what credits the booking to you, and it sets the branding, default language and currency on the booking page.
  • A hotel’s urlName. It is the hotel’s stable slug in the booking engine.
  1. Select your affiliate account from Accounts.
  2. Click Actions on the account card and choose Manage account.
  3. Open the Customizations tab and copy the ID of the customization you want to use.

See Customization for what a customization controls.

  • In code: every search result from the Partner API carries a urlName. Use wink.partner.v1.Lookup/Search to resolve a city or hotel, then Search/SearchByCity for results. The Quickstart walks through it.
  • By hand: a hotel’s landing page address ends in its urlName, for example https://book.wink.travel/hotel/hotel-x has the urlName hotel-x.
https://book.wink.travel/hotel/<urlName>?configuration-id=<YOUR_CUSTOMIZATION_ID>
PartMeaning
https://book.wink.travelThe production booking engine. For testing use https://staging-book.wink.travel, with a customization from your staging account.
/hotel/<urlName>The hotel’s page. Leave it out to open the booking engine home page instead.
configuration-idYour customization ID. cid is a shorter alias for the same parameter.

Add the traveler’s dates, guests, language and currency so the hotel page opens with them filled in. All parameters are optional, and they override the defaults in your customization.

ParameterMeaningExample
sdCheck-in date, YYYY-MM-DDsd=2027-03-14
nNumber of nightsn=2
edCheck-out date, YYYY-MM-DD. If both n and ed are present, n wins.ed=2027-03-16
rcGuests in a room: a2 is two adultsrc=a2
lDisplay languagel=es
cDisplay currency, three lettersc=EUR
pPromotion code, prefixed with p. Join several with +.p=pABC123

A complete example:

https://book.wink.travel/hotel/hotel-x?configuration-id=<YOUR_CUSTOMIZATION_ID>&sd=2027-03-14&n=2&rc=a2&l=en&c=USD

Some details that cause most mistakes:

  • A past check-in date is ignored, and the booking engine falls back to its own default dates. Send dates in the future.
  • Several rooms: repeat the occupancy joined with +, and write the + as %2B: rc=a2%2Ba2 is two rooms of two adults. A bare + in a query string can be read as a space. If the rooms differ, only the first room’s guests are used.
  • Children: a2-ca8q1 is two adults and one 8-year-old. Each child is ca, the age, q, and how many children of that age.
  • A link can’t pre-select a room or a rate. The traveler picks the room on the hotel page, at the live price.

The full format of these parameters, including precedence and edge cases, is in the Book Now button guide.

Build the query string with a URL library instead of concatenating strings. It encodes the + and any other special characters for you.

type Stay = {
checkIn?: string; // YYYY-MM-DD
nights?: number;
guests?: string; // e.g. "a2" or "a2+a2"
language?: string;
currency?: string;
};
function bookingLink(urlName: string, customizationId: string, stay: Stay = {}): string {
const url = new URL(`https://book.wink.travel/hotel/${encodeURIComponent(urlName)}`);
url.searchParams.set('configuration-id', customizationId);
if (stay.checkIn) url.searchParams.set('sd', stay.checkIn);
if (stay.nights) url.searchParams.set('n', String(stay.nights));
if (stay.guests) url.searchParams.set('rc', stay.guests); // "+" becomes %2B
if (stay.language) url.searchParams.set('l', stay.language);
if (stay.currency) url.searchParams.set('c', stay.currency.toUpperCase());
return url.toString();
}
  1. Build the link against https://staging-book.wink.travel with a customization from your staging account.
  2. Open it and confirm the hotel page shows your branding and the dates and guests you passed.
  3. Make a test booking with a Stripe test card, as in Quickstart, Step 7.
  4. Switch to book.wink.travel and your production customization ID. Staging and production IDs differ.
  • Portal links are short trvl.as links with a branded preview image that you create and share from Portal. They can’t be built by hand. See Links.
  • Your own domain. The booking engine can run on your domain and resolve your customization from the hostname, so no customization ID is needed in the URL. See Booking engine features.
  • Embedded cards and banners use the Web Components, which take a client ID and a customization ID as component attributes rather than URL parameters.