# Collaborative API

### Look Ahead data

Provides collaborative members' occupancy, ADR, and revenue data for a specified date range. Best intended for getting clarity on future stay dates.

<mark style="color:green;">`POST`</mark> `https://api.flip.to/v1/collaborative/report/lodging/lookahead`

#### Query Parameters

| Name                                        | Type   | Description                                                                                                                                                                                                                                                    |
| ------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| startdate<mark style="color:red;">\*</mark> | Date   | The inclusive date range in ISO 8601 format `yyyy-MM-dd` (e.g. 2023-09-18)                                                                                                                                                                                     |
| enddate<mark style="color:red;">\*</mark>   | Date   | The inclusive date range in ISO 8601 format `yyyy-MM-dd` (e.g. 2023-09-18)                                                                                                                                                                                     |
| type                                        | String | <p>Accommodation property type, valid values are:</p><p><code>FullServiceHotel</code>, <code>SelectServiceHotel</code>, <code>Condotel</code>, <code>VacationRental</code>, <code>RVResort</code></p>                                                          |
| grouping                                    | String | <p>Defines how data is grouped and <code>Week</code> is default.</p><p>Valid values are: <code>Month</code>, <code>Week</code>, <code>Day</code></p>                                                                                                           |
| startWeekDay                                | String | <p>Defines the start day of the week and <code>Sunday</code> is default, valid values are:</p><p><code>Monday</code>, <code>Tuesday</code>, <code>Wednesday</code>, <code>Thursday</code>, <code>Friday</code>, <code>Saturday</code>, <code>Sunday</code></p> |

#### Example

{% tabs %}
{% tab title="Response" %}

```json
{
    "totalProperties": 32,
    "totalRooms": 9660,
    "data": [
        {
            "startDate": "2021-01-01",
            "endDate": "2021-01-31",
            "occupancy": {
                "availableBookNights": 289800,
                "bookedNights": 4008
            },
            "dailyRate": {
                "minDailyRate": 25.81,
                "maxDailyRate": 521.54,
                "avgDailyRate": 47.57
            },
            "stayLength": {
                "minStayNights": 1,
                "maxStayNights": 74,
                "avgStayNights": 2
            },
            "revenue": {
                "totalTransactions": 1719,
                "totalTransactionNights": 4585,
                "minTransactionRevenue": 48,
                "maxTransactionRevenue": 3132.03,
                "totalTransactionRevenue": 459003.23,
                "avgTransactionRevenue": 267.02
            }
        },
        …
    ]
}

```

{% endtab %}
{% endtabs %}

### Transactions data

Provides transactions and revenue data from all collaborative members for a specified date range.

<mark style="color:green;">`POST`</mark> `https://api.flip.to/v1/collaborative/report/lodging/bookings`

#### Query Parameters

| Name                                        | Type   | Description                                                                                                                                                                                                                                                    |
| ------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| startdate<mark style="color:red;">\*</mark> | Date   | The inclusive date range in ISO 8601 format `yyyy-MM-dd` (e.g. 2023-09-18)                                                                                                                                                                                     |
| enddate<mark style="color:red;">\*</mark>   | Date   | The inclusive date range in ISO 8601 format `yyyy-MM-dd` (e.g. 2023-09-18)                                                                                                                                                                                     |
| type                                        | String | <p>Accommodation property type, valid values are:</p><p><code>FullServiceHotel</code>, <code>SelectServiceHotel</code>, <code>Condotel</code>, <code>VacationRental</code>, <code>RVResort</code></p>                                                          |
| grouping                                    | String | <p>Defines how data is grouped and <code>Week</code> is default.</p><p>Valid values are: <code>Month</code>, <code>Week</code>, <code>Day</code></p>                                                                                                           |
| startWeekDay                                | String | <p>Defines the start day of the week and <code>Sunday</code> is default, valid values are:</p><p><code>Monday</code>, <code>Tuesday</code>, <code>Wednesday</code>, <code>Thursday</code>, <code>Friday</code>, <code>Saturday</code>, <code>Sunday</code></p> |

#### Example

{% tabs %}
{% tab title="Response" %}

```json
{
    "totalProperties": 32,
    "totalRooms": 9660,
    "data": [
        {
            "startDate": "2020-12-27T00:00:00",
            "endDate": "2021-01-02T00:00:00",
            "revenue": {
                "totalTransactions": 934,
                "totalTransactionNights": 3290,
                "minTransactionRevenue": 49,
                "maxTransactionRevenue": 11828.92,
                "totalTransactionRevenue": 714171.46,
                "avgTransactionRevenue": 764.64
            },
            "stayLength": {
                "minStayNights": 1,
                "maxStayNights": 34,
                "avgStayNights": 3
            }
        },
        …
    ]
}
```

{% endtab %}
{% endtabs %}

### Sponsor referrals data

Provides transactions and revenue data attributed to the Sponsor's referral efforts for a specified date range.

<mark style="color:green;">`POST`</mark> `https://api.flip.to/v1/collaborative/report/sponsor/referrals/impact`

#### Query Parameters

| Name                                        | Type    | Description                                                                                                                                           |
| ------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| startdate<mark style="color:red;">\*</mark> | Date    | The inclusive date range in ISO 8601 format `yyyy-MM-dd` (e.g. 2023-09-18)                                                                            |
| enddate<mark style="color:red;">\*</mark>   | Date    | The inclusive date range in ISO 8601 format `yyyy-MM-dd` (e.g. 2023-09-18)                                                                            |
| delay                                       | Integer | The number of days to look back to attribute transaction to source data. Default is `15` days.                                                        |
| grouping                                    | String  | <p>Defines how data is grouped and <code>Month</code> is default.</p><p>Valid values are: <code>Month</code>, <code>Week</code>, <code>Day</code></p> |

#### Example

{% tabs %}
{% tab title="Response" %}

```
[
    {
        "year": 2023,
        "timeGrouping": 1,
        "referralTransactions": 3,
        "referralRevenue": 1500,
        "influencedTransactions": 2,
        "influencedRevenue": 1000
    },
    {
        "year": 2023,
        "timeGrouping": 2,
        "referralTransactions": 5,
        "referralRevenue": 2500,
        "influencedTransactions": 4,
        "influencedRevenue": 2000
    }
]
```

{% endtab %}
{% endtabs %}

### Sponsor referrals data by channel

Provides transactions and revenue data attributed to the Sponsor's referral efforts for a specified channel and date range.

<mark style="color:green;">`POST`</mark> `https://api.flip.to/v1/collaborative/report/sponsor/referrals/channels/impact`

#### Query Parameters

| Name                                        | Type    | Description                                                                                                                                           |
| ------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| startdate<mark style="color:red;">\*</mark> | Date    | The inclusive date range in ISO 8601 format `yyyy-MM-dd` (e.g. 2023-09-18)                                                                            |
| enddate<mark style="color:red;">\*</mark>   | Date    | The inclusive date range in ISO 8601 format `yyyy-MM-dd` (e.g. 2023-09-18)                                                                            |
| delay                                       | Integer | The number of days to look back to attribute transaction to source data. Default is `15` days.                                                        |
| grouping                                    | String  | <p>Defines how data is grouped and <code>Month</code> is default.</p><p>Valid values are: <code>Month</code>, <code>Week</code>, <code>Day</code></p> |

#### Example

{% tabs %}
{% tab title="Response" %}
{% code fullWidth="true" %}

```json
[
    {
        "year": 2023,
        "timeGrouping": 1,
        "source": "google",
        "medium": "search",
        "term": null,
        "referralTransactions": 3,
        "referralRevenue": 1500,
        "influencedTransactions": 2,
        "influencedRevenue": 1000
    },
    {
        "year": 2023,
        "timeGrouping": 2,
        "source": "google",
        "medium": "search",
        "term": null,
        "referralTransactions": 5,
        "referralRevenue": 2500,
        "influencedTransactions": 4,
        "influencedRevenue": 2000
    }
]
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Sponsor referrals data by geolocation

Provides transactions and revenue data attributed to the Sponsor's referral efforts for a specified geolocation and date range.

<mark style="color:green;">`POST`</mark> `https://api.flip.to/v1/collaborative/report/sponsor/referrals/geo/impact`

#### Query Parameters

| Name                                        | Type    | Description                                                                                                                                           |
| ------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| startdate<mark style="color:red;">\*</mark> | Date    | The inclusive date range in ISO 8601 format `yyyy-MM-dd` (e.g. 2023-09-18)                                                                            |
| enddate<mark style="color:red;">\*</mark>   | Date    | The inclusive date range in ISO 8601 format `yyyy-MM-dd` (e.g. 2023-09-18)                                                                            |
| delay                                       | Integer | The number of days to look back to attribute transaction to source data. Default is `15` days.                                                        |
| grouping                                    | String  | <p>Defines how data is grouped and <code>Month</code> is default.</p><p>Valid values are: <code>Month</code>, <code>Week</code>, <code>Day</code></p> |

#### Example

{% tabs %}
{% tab title="Response" %}

```json
[
    {
        "year": 2023,
        "timeGrouping": 1,
        "country": "US",
        "region": "NY",
        "city": "New York",
        "referralTransactions": 3,
        "referralRevenue": 1500,
        "influencedTransactions": 2,
        "influencedRevenue": 1000
    },
    {
        "year": 2023,
        "timeGrouping": 2,
        "country": "US",
        "region": "NY",
        "city": "New York",
        "referralTransactions": 5,
        "referralRevenue": 2500,
        "influencedTransactions": 4,
        "influencedRevenue": 2000
    }
]
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flip.to/docs/api/reference/collaborative-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
