Skip to content

Commit 347f432

Browse files
committed
chore: add travel auction to v2
Add travel auction open api documentation to v2
1 parent 2357ff0 commit 347f432

File tree

1 file changed

+136
-0
lines changed

1 file changed

+136
-0
lines changed

topsort-api-v2.yml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,55 @@ paths:
243243
$ref: '#/components/responses/BadRequest'
244244
401:
245245
$ref: '#/components/responses/UnauthorizedError'
246+
/v2/auctions/travel:
247+
post:
248+
tags:
249+
- Auctions
250+
summary: Create an auction for hotel related products
251+
operationId: createTravelAuctions
252+
requestBody:
253+
description: |
254+
The information describing what will be auctioned.
255+
Topsort will run an auction for each batched auction request, for which products' bids will compete against each other.
256+
content:
257+
application/json:
258+
schema:
259+
type: object
260+
properties:
261+
auctions:
262+
type: array
263+
items:
264+
$ref: '#/components/schemas/TravelAuctionRequest'
265+
minItems: 1
266+
maxItems: 5
267+
required:
268+
- auctions
269+
required: true
270+
responses:
271+
201:
272+
description: >
273+
The auction results.
274+
The list of winners will contain at most `winners` entries per auction.
275+
It may contain fewer or no entries at all if there aren't enough products with usable bids, that is,
276+
a bid amount greater than the reserve price and belonging to a campaign with enough remaining budget.
277+
Bids become unusable if campaign budget is exhausted, the bid is disqualified to preserve spend pacing, etc.
278+
content:
279+
application/json:
280+
schema:
281+
type: object
282+
properties:
283+
results:
284+
type: array
285+
items:
286+
$ref: '#/components/schemas/AuctionResult'
287+
minItems: 1
288+
maxItems: 5
289+
required:
290+
- results
291+
400:
292+
$ref: '#/components/responses/BadRequest'
293+
401:
294+
$ref: '#/components/responses/UnauthorizedError'
246295
/v2/events:
247296
post:
248297
tags:
@@ -848,6 +897,93 @@ components:
848897
format: uint32
849898
description: The asset height in pixels.
850899

900+
TravelAuctionRequest:
901+
type: object
902+
description: |
903+
Describes the intent of running a travel auction.
904+
properties:
905+
type:
906+
type: string
907+
enum:
908+
- hotels
909+
description: Discriminator for the type of travel auction.
910+
slots:
911+
type: integer
912+
format: int32
913+
description: Specifies the maximum number of auction winners that should be returned.
914+
products:
915+
type: array
916+
items:
917+
$ref: '#/components/schemas/TravelProduct'
918+
travelContext:
919+
$ref: '#/components/schemas/TravelContext'
920+
x-examples:
921+
Example 1:
922+
auctions:
923+
- type: hotels
924+
slots: 2
925+
products:
926+
- id: hotel-1
927+
qualityScore: 0.7
928+
- id: hotel-2
929+
travelContext:
930+
- travelStartDate: 2025-01-01
931+
932+
TravelProduct:
933+
type: object
934+
required:
935+
- id
936+
properties:
937+
id:
938+
type: string
939+
description: An array of hotels IDs that should participate in the auction.
940+
example: miami-hotel
941+
qualityScore:
942+
type: number
943+
minimum: 0
944+
maximum: 1
945+
exclusiveMinimum: true
946+
example: 0.75
947+
format: double
948+
description: |
949+
If given, this value will be combined with our internal quality score to provide a score
950+
that better represents the relevance of the participating products.
951+
Values must be between 0 and 1.
952+
953+
TravelContext:
954+
type: object
955+
required:
956+
- site
957+
properties:
958+
travelStartDate:
959+
type: string
960+
format: date
961+
description: RFC3339 formatted date representing the travel start point.
962+
example: '2009-01-01'
963+
travelEndDate:
964+
type: string
965+
format: date
966+
description: |
967+
RFC3339 formatted date representing the travel end point. Must be greater than start date.
968+
example: '2009-01-15'
969+
site:
970+
type: string
971+
minLength: 1
972+
maxLength: 64
973+
description: Web site requesting the auction
974+
example: travel.argentina.com
975+
passengers:
976+
type: integer
977+
description: Number of passengers. Must not exceed 10.
978+
example: 3
979+
travelerType:
980+
type: string
981+
enum:
982+
- family
983+
- group
984+
- solo
985+
- couple
986+
851987
Error:
852988
type: object
853989
required:

0 commit comments

Comments
 (0)