Skip to content

Generate

POST
/api/managing-entity/{managingEntityIdentifier}/travel-agent/report/csv
curl --request POST \
--url https://api.wink.travel/api/managing-entity/d5b8a3c2-9e6f-4a1b-8d34-7c2e1f0a5b69/travel-agent/report/csv \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Wink-Version: 2.0' \
--data null

Generates a CSV report filtered to show only bookings associated with the specified managing entity (travel agent). The report excludes failed bookings.

managingEntityIdentifier
required
string format: uuid
""

Unique identifier for the travel agent managing entity

Example
d5b8a3c2-9e6f-4a1b-8d34-7c2e1f0a5b69
Wink-Version
string
default: 2.0.0
Allowed values: 2.0

Report query specifying the data sources, filters, date range, and output columns for the travel agent bookings CSV report

Media type application/json

Request payload that defines what data to export and how to format it as a CSV report

object
reportName
required

Name of the report for the generated CSV file

string
"" >= 1 characters
Example
booking-summary
reportDataType
required

Type of data source to query from: PROPERTY (hotel inventory), USER (guest profiles), BOOKING (reservations), ACCOUNT (managing entity data)

string
""
Allowed values: PROPERTY USER BOOKING ACCOUNT
Example
BOOKING
fieldNames
required

List of field definitions specifying which data fields to include and their display titles

Array<object>
>= 1 items

Defines a single column in a generated report, mapping a display title to a JSON field path in the data object

object
title
required

Display name for the report column

string
"" >= 1 characters
Example
Property Name
valuePath
required

JSON path to the field in the data object (dot-notation)

string
"" >= 1 characters
Example
hotel.name
Example
{
"title": "Property Name",
"valuePath": "hotel.name"
}
state
required

Query state with sorting, filtering, and pagination criteria to retrieve the report data

object
skip

Number of records to be skipped by the pager.

integer format: int32
0
Example
0
take

Number of records to take.

integer format: int32
default: 30 >= 1 <= 180
Example
10
sort

Descriptors used for sorting result set.

Array<object>
""

Descriptor that defines the sort direction and field for ordering a result set.

object
dir

Descriptors used for sorting result set

string
""
Allowed values: asc desc
Example
asc
field

Data set field to sort on

string
""
Example
hotel.name
Example
{
"dir": "asc",
"field": "hotel.name"
}
filter

Descriptors used for filtering result set

object
logic

Whether to filter inclusively or exclusively

string
""
Allowed values: and or
Example
and
filters

Descriptors used for filtering the result set

Array<object>

A single field-level filter criterion that specifies what to match and how to compare it.

object
field
required

Field name to filter on

string
"" >= 1 characters
Example
hotel.name
operator
required

Filter operator to use on field

string
""
Allowed values: neq eq contains doesnotcontain isnull isnotnull isempty isnotempty startswith endswith gte lte gt lt in nin
Example
startsWith
value

Value to filter dataset against

""
Example
Happy Res
ignoreCase

Make filter comparison case insensitive. Default: Case sensitive

boolean
Example
true
Example
{
"field": "hotel.name",
"operator": "startsWith",
"value": "Happy Res",
"ignoreCase": true
}
Example
{
"logic": "and",
"filters": [
{
"field": "hotel.name",
"operator": "startsWith",
"value": "Happy Res",
"ignoreCase": true
}
]
}
group

Descriptors to group result sets by.

Array<object>
""

Descriptor that defines how a result set should be grouped, including sort direction and optional aggregate calculations.

object
field

Field to group data set on

string
""
Example
createdDate
dir

Group sort direction

string
""
Allowed values: asc desc
Example
asc
aggregates

Primitive aggregate data points

Array<object>

Descriptor that defines an aggregate function to apply to a specific field in a grouped result set.

object
field

Field to run aggregate function on

string
""
Example
hotel.bookings
aggregate

Aggregate function

string
""
Allowed values: count sum average min max
Example
count
Example
{
"field": "hotel.bookings",
"aggregate": "count"
}
Example
{
"field": "createdDate",
"dir": "asc",
"aggregates": [
{
"field": "hotel.bookings",
"aggregate": "count"
}
]
}
Example
{
"skip": 0,
"take": 10,
"sort": [
{
"dir": "asc",
"field": "hotel.name"
}
],
"filter": {
"logic": "and",
"filters": [
{
"field": "hotel.name",
"operator": "startsWith",
"value": "Happy Res",
"ignoreCase": true
}
]
},
"group": [
{
"field": "createdDate",
"dir": "asc",
"aggregates": [
{
"field": "hotel.bookings",
"aggregate": "count"
}
]
}
]
}
Example
{
"reportName": "booking-summary",
"reportDataType": "BOOKING",
"fieldNames": [
{
"title": "Property Name",
"valuePath": "hotel.name"
}
],
"state": {
"skip": 0,
"take": 10,
"sort": [
{
"dir": "asc",
"field": "hotel.name"
}
],
"filter": {
"logic": "and",
"filters": [
{
"field": "hotel.name",
"operator": "startsWith",
"value": "Happy Res",
"ignoreCase": true
}
]
},
"group": [
{
"field": "createdDate",
"dir": "asc",
"aggregates": [
{
"field": "hotel.bookings",
"aggregate": "count"
}
]
}
]
}
}

CSV report generated successfully and returned as a file download

Media type text/csv
string format: binary
""

Bad Request — missing or invalid request parameter or body

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Unauthorized — authentication is required or the session has expired

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Forbidden — authenticated but lacking the required permission or scope

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Not Found — the requested resource does not exist

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Method Not Allowed — the HTTP verb is not supported on this endpoint

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Unsupported Media Type — use application/json

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Internal Server Error — an unexpected failure occurred on the server

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example

Service Unavailable — a downstream dependency is unreachable

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
key
additional properties
""
Example