Saltar para o conteúdo principal
POST
/
v2
/
auctions
Create auctions
curl --request POST \
  --url https://api.topsort.com/v2/auctions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "auctions": [
    {
      "type": "listings",
      "slots": 2,
      "products": {
        "ids": [
          "p_PJbnN",
          "p_ojng4"
        ]
      }
    }
  ]
}
'
{
  "results": [
    {
      "resultType": "listings",
      "winners": [],
      "error": false
    }
  ]
}

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 products' bids will compete against each other.

auctions
(Sponsored Listing · object | Banner Auction · object)[]
Required array length: 1 - 5 elements

Describes the intent of running a single auction.

Exemplo:
{
"type": "listings",
"slots": 2,
"products": {
"ids": ["p_PJbnN", "p_ojng4", "p_8VKDt", "p_Mfk15"]
},
"geoTargeting": { "location": "New York" }
}
Exemplo:
[
{
"type": "listings",
"slots": 2,
"products": { "ids": ["p_PJbnN"] }
}
]

Resposta

The auction results. The list of winners will contain at most slots 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

Base auction result schema supporting different auction types through discriminator.

Exemplo:
[
{
"resultType": "listings",
"winners": [],
"error": false
}
]