Saltar para o conteúdo principal
POST
/
v2
/
auctions
/
travel
Create travel auctions
curl --request POST \
  --url https://api.topsort.com/v2/auctions/travel \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "auctions": [
    {
      "type": "hotels",
      "slots": 2,
      "travelContext": {
        "site": "argentina"
      }
    }
  ]
}
'
{
  "results": [
    {
      "resultType": "<string>",
      "winners": [
        {
          "rank": 2,
          "type": "product",
          "id": "<string>",
          "resolvedBidId": "<string>",
          "campaignId": "<string>"
        }
      ],
      "error": true
    }
  ]
}

Autorizações

Authorization
string
header
obrigatório

A valid API key generated in Topsort's UI.

Corpo

application/json

The information describing what will be auctioned. Topsort will run an auction for each batched auction request, for which travel products' bids will compete against each other.

auctions
(Hotels · object | Flights · object)[]
obrigatório
Required array length: 1 - 5 elements

Describes the intent of running a single auction.

Exemplo:
[
{
"type": "hotels",
"slots": 2,
"travelContext": { "site": "argentina" }
}
]

Resposta

The travel auction results. The list of winners will contain at most winners entries per auction. It may contain fewer or no entries at all if there aren't enough products with usable bids, that is, a bid amount greater than the reserve price and belonging to a campaign with enough remaining budget. Bids become unusable if campaign budget is exhausted, the bid is disqualified to preserve spend pacing, etc.

results
object[]
obrigatório
Required array length: 1 - 5 elements

The result of a travel-related auction request (hotels or flights).