Bookings by source
const url = 'https://api.wink.travel/api/managing-entity/d5b8a3c2-9e6f-4a1b-8d34-7c2e1f0a5b69/studio/analytics/bookings/by-source?period=LAST_30_DAYS';const options = { method: 'GET', headers: {'Wink-Version': '2.0', Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.wink.travel/api/managing-entity/d5b8a3c2-9e6f-4a1b-8d34-7c2e1f0a5b69/studio/analytics/bookings/by-source?period=LAST_30_DAYS' \ --header 'Authorization: Bearer <token>' \ --header 'Wink-Version: 2.0'Returns visits, bookings, cancellations and revenue per booking source (LINK, BOOK_NOW_LINK, EMBED_REDIRECT, EMBED_MODAL, MCP_AGENT, WINKLINKS) over the last 7, 30 or 90 days; requires ANALYTICS:READ permission. The path managing entity is the source owner, and what that means differs per source: the link’s owner for LINK, the account for BOOK_NOW_LINK, the hotel’s managing entity for EMBED_REDIRECT, the customization’s owner for EMBED_MODAL and MCP_AGENT, and the WinkLinks page’s account for WINKLINKS. Only attributed sources are listed: DIRECT and unstamped bookings carry no source owner and cannot be reached per owner without a full scan, so a screen compares the attributed total with the existing booking analytics total. The figures are a floor and unverified, because a source claim is unauthenticated within a hotel. The window is capped at 90 days and revenue is in USD. attributionSince is the moment bookings started carrying a source; it is null when tracking is off, and earlier bookings are not attributed.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Source owner (managing entity) identifier (UUID)
Example
d5b8a3c2-9e6f-4a1b-8d34-7c2e1f0a5b69Query Parameters
Section titled “Query Parameters”Window a single link’s analytics is read over: the last 7, 30 or 90 days, today included.
The window: LAST_7_DAYS, LAST_30_DAYS or LAST_90_DAYS
Example
LAST_30_DAYSHeader Parameters
Section titled “Header Parameters”Responses
Section titled “Responses”The owner’s attributed bookings per source over the window
An account’s bookings over a window, split by the source they came through.
object
When bookings started carrying a source (the analytics.booking-source.tracking-since setting); earlier bookings are not attributed. Null only when source tracking is off.
End of the window (UTC).
The window the figures cover.
Totals per booking source.
Visits, bookings, cancellations and their revenue for one booking source.
object
Revenue of the bookings made. Test bookings are excluded.
object
The amount, two decimals.
ISO 4217 currency code.
Bookings made through this source. Test bookings are excluded. Bookings recorded, not guaranteed de-duplicated if a booking event is redelivered.
Bookings through this source that were cancelled. Test bookings are excluded. Counted in the window the cancellation happened, so a window’s bookings minus cancellations can be negative; derive no rate from them.
Revenue of the bookings cancelled. Test bookings are excluded. Counted in the window the cancellation happened, so a window’s bookings minus cancellations can be negative; derive no rate from them.
object
The amount, two decimals.
ISO 4217 currency code.
The channel the bookings came through.
Visits that reached the booking engine through this source.
Start of the window (UTC).
Example
{ "sources": [ { "bookingRevenue": { "amount": 1805, "currency": "USD" }, "bookings": 12, "cancellations": 2, "cancelledRevenue": { "amount": 1805, "currency": "USD" }, "visits": 300 } ]}The period is not one of LAST_7_DAYS, LAST_30_DAYS or LAST_90_DAYS
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Unauthorized — authentication is required or the session has expired
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Forbidden — authenticated but lacking the required permission or scope
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Not Found — the requested resource does not exist
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Method Not Allowed — the HTTP verb is not supported on this endpoint
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Conflict — the resource was modified by someone else since you read it; re-read it and retry with the new version
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Unsupported Media Type — use application/json
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Internal Server Error — an unexpected failure occurred on the server
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}Service Unavailable — a downstream dependency is unreachable
object
object
Example generated
{ "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }, "status": 1, "title": "example", "type": "https://example.com"}