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.
What you need
Section titled “What you need”- 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.
Find your customization ID
Section titled “Find your customization ID”- Select your affiliate account from Accounts.
- Click
Actionson the account card and chooseManage account. - Open the
Customizationstab and copy the ID of the customization you want to use.
See Customization for what a customization controls.
Find a hotel’s urlName
Section titled “Find a hotel’s urlName”- In code: every search result from the Partner API carries a
urlName. Usewink.partner.v1.Lookup/Searchto resolve a city or hotel, thenSearch/SearchByCityfor results. The Quickstart walks through it. - By hand: a hotel’s landing page address ends in its
urlName, for examplehttps://book.wink.travel/hotel/hotel-xhas theurlNamehotel-x.
The link
Section titled “The link”https://book.wink.travel/hotel/<urlName>?configuration-id=<YOUR_CUSTOMIZATION_ID>| Part | Meaning |
|---|---|
https://book.wink.travel | The 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-id | Your customization ID. cid is a shorter alias for the same parameter. |
Add the traveler’s search
Section titled “Add the traveler’s search”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.
| Parameter | Meaning | Example |
|---|---|---|
sd | Check-in date, YYYY-MM-DD | sd=2027-03-14 |
n | Number of nights | n=2 |
ed | Check-out date, YYYY-MM-DD. If both n and ed are present, n wins. | ed=2027-03-16 |
rc | Guests in a room: a2 is two adults | rc=a2 |
l | Display language | l=es |
c | Display currency, three letters | c=EUR |
p | Promotion 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=USDSome 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%2Ba2is 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-ca8q1is two adults and one 8-year-old. Each child isca, 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 links in code
Section titled “Build links in code”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();}Check the link
Section titled “Check the link”- Build the link against
https://staging-book.wink.travelwith a customization from your staging account. - Open it and confirm the hotel page shows your branding and the dates and guests you passed.
- Make a test booking with a Stripe test card, as in Quickstart, Step 7.
- Switch to
book.wink.traveland your production customization ID. Staging and production IDs differ.
Other kinds of link
Section titled “Other kinds of link”- Portal links are short
trvl.aslinks 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.
