Create or modify an Ad Order - DEPRECATED

Creates or modifies an Ad Order.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Note

io_number and externalAdOrderId both serve the same purpose and refer to the same value: an external ID for use by clients. These fields point to the same value; on input, a caller should use one field or the other, not both; on output, both fields are provided (currently), and will have the same value.

Submitting a record with both fields is an error condition, and will result in a 400 response.

Request

POST /adorder/save

Request Body

Name Type Description Required
idNumberAd order ID.Required for update.
nameStringAd order name.Yes
campaignIdNumberCampaign ID associated with the ad order.Yes
optimizationGoalStringOptimization goal for the ad order:
  • CPM
  • CPC
  • CPA
Yes
startDateNumberStart date of the ad order, passed as Unix time in milliseconds.Yes for creation. After creation the flight endpoint must be used to update and modify.
endDateNumberEnd date of the ad order, passed as Unix time in milliseconds.Yes for creation. After creation the flight endpoint must be used to update and modify.
lifetimeBudgetNumberThe total lifetime budget for the ad order in USD.Yes for creation. After creation the flight endpoint must be used to update and modify.
frequencyCapObjectHolds all frequency cap settings.
If not present, defaults to null.
No
frequencyCap.limitNumberThe maximum number of impressions a user is exposed to per frequency cap time period duration.
See frequencyCap.duration and frequencyCap.timePeriod.
Yes (if parent object present)
frequencyCap.durationNumberThe number of given frequencyCap.timePeriodYes (if parent object present)
frequencyCap.timePeriodString
  • MINUTE
  • HOUR
  • DAY
Yes (if parent object present)
channelsV2String Array / Null Channels the Ad Order will be capable of serving on:
  • Display
  • Video
  • Native
  • Audio
  • DOOH
  • CTV
  • LTV
  • LTV Wide Orbit
No
max_bidNumberThe maximum bid. Default values apply when no values are present.No
audienceWeightsEnabledBooleanControls whether audience weights are enabled.
If null or the field is absent, will be set to default false on create, and left untouched on update.
No
goalModeStringSets goal prioritization. Can be set to:
  • PERFORMANCE
  • SPEND
Defaults to "PERFORMANCE" if not provided.
No
hourlyPacingModeString
  • ASAP
  • SPEND_EVENLY
No
hourlyFrontloadNumberPercentage frontload between 0.00 and 100.00. Null if hourlyPacingMode is ASAPRequired if hourlyPacingMode is "SPEND_EVENLY"
ioNumberStringClient ID for Ad Order
ioNumber and externalAdOrderId serve the same purpose. A request to create an Ad Order may include one or the other of these fields, but not both.
No
externalAdOrderIdStringClient ID for Ad Order
ioNumber and externalAdOrderId serve the same purpose. A request to create an Ad Order may include one or the other of these fields, but not both.
No

Response

JSON Fields Type Description
messagesObject ArrayAn array of any error messages.
messages[].levelStringError level.
messages[].codeStringError code.
messages[].messageStringError message.
entityObjectAn ad order object.
entity.idNumberAd order ID.
entity.nameStringAd order name.
entity.campaignIdNumberCampaign ID associated with the ad order.
entity.startDateNumberStart date of the ad order, passed as Unix time in milliseconds.
entity.endDateNumberEnd date of the ad order, passed as Unix time in milliseconds.
entity.optimizationGoalString Optimization goal for the ad order --
  • CPM
  • CPC
  • CPA
entity.lifetimeBudgetNumberThe total lifetime budget for the ad order in USD.
entity.frequencyCapObjectA frequency cap settings object.
entity.frequencyCap.limitNumberThe maximum number of impressions a user is exposed to per frequency cap time period duration.

See frequencyCap.duration and frequencyCap.timePeriod.
entity.frequencyCap.durationNumberThe number of given frequencyCap.timePeriod.
entity.frequencyCap.timePeriodString
  • MINUTE
  • HOUR
  • DAY
entity[].channelsV2String Array / Null Channels the Ad Order will be capable of serving on:
  • Display
  • Video
  • Native
  • Audio
  • DOOH
  • CTV
  • LTV
  • LTV Wide Orbit
entity.audienceWeightsEnabledBooleanControls whether audience weights are enabled.
entity.audiencesObject ArrayAn array of audience objects targeted by the ad order.
entity.audiences[].idNumberAudience ID.
entity.audiences[].nameStringAudience name.
entity.audiences[].weightIntegerAudience weight.
entity.audiences[].pmpDealsNumber ArrayAn array of any targeted PMP deals IDs, where the IDs are the internal Viant IDs.
entity.audiences[].exchangesObjectIf this object is not present, the audience will not modify exchange targeting criteria.
entity.audiences[].exchanges.includeNumber ArrayAn array of any targeted exchange IDs.
entity.audiences[].exchanges.excludeNumber ArrayAn array of any excluded exchange IDs.
entity.audiences[].siteListsObjectIf this object is not present, the audience will not modify site list targeting criteria.
entity.audiences[].siteLists.includeNumber ArrayAn array of any targeted site list IDs.
entity.audiences[].siteLists.excludeNumber ArrayAn array of any excluded site list IDs.
entity.goalModeString Sets goal prioritization. Can be set to:
  • PERFORMANCE
  • SPEND
entity.hourlyPacingModeString
  • ASAP
  • SPEND_EVENLY
entity.hourlyFrontloadNumberPercentage frontload between 0.00 and 100.00. Null if hourlyPacingMode is ASAP

Example

Request to create an ad order

curl -u <user>:<password> -X POST -H "Content-Type: application/json" -d '{"name" : "Android","campaignId":91,"optimizationGoal":"CPM","startDate" : 1462060800000,"endDate" : 1464652800000,"lifetimeBudget":1000, "audiences":null, "externalAdOrderId": "abc12345"}' https://sandbox-api.viant.com/v1/adorder/save

Since the ID field is null, this creates a new ad order.

Response

{
  "messages": [],
  "entity": {
    "id": 9993,
    "name": "Android",
    "campaignId": 91,
    "startDate": 1462060800000,
    "endDate": 1464652800000,
    "optimizationGoal": "CPC",
    "lifetimeBudget": 1000,
    "frequencyCap": {
      "limit": null,
      "duration": null,
      "timePeriod": null
    },
    "channelsV2": null,
    "audiences": [
      {
        "id": 9802,
        "name": "Default Audience",
        "weight": 1,
        "pmpDeals": null
        "siteLists": {
          "include": [
            100,
            101
          ],
          "exclude": null
        },
        "exchanges": {
          "include": null,
          "exclude": [96]
        }
      }
    ],
    "audienceWeightsEnabled": false,
    "goalMode": "PERFORMANCE",
    "hourlyPacingMode": "ASAP",
    "hourlyFrontload": null,
    "io_number": "abc12345",
    "externalAdOrderId": "abc12345"
  }
}

Note that a default audience for targeting is created.

Request to edit an existing ad order

curl -u <user>:<password> -X POST -H "Content-Type: application/json" -d '{"id":9993, "name": "Android", "campaignId":91, "optimizationGoal":"CPM", "startDate" : 1462060800000, "endDate" : 1464652800000, "lifetimeBudget":1000, "frequencyCap":{"limit":5, "duration":3, "timePeriod":"DAY"}, "audiences":[{"id":9802, "name":"Default Audience", "weight" : 1, "pmpDeals":[6565]}], "audienceWeightsEnabled": false}' https://sandbox-api.viant.com/v1/adorder/save

Response

{
  "messages": [],
  "entity": {
    "id": 9993,
    "name": "Android",
    "campaignId": 91,
    "startDate": 1462060800000,
    "endDate": 1464652800000,
    "optimizationGoal": "CPC",
    "lifetimeBudget": 1000,
    "frequencyCap": {
      "limit": 5,
      "duration": 3,
      "timePeriod": "DAY"
    },
    "channelsV2": null,
    "audiences": [
      {
        "id": 9802,
        "name": "Default Audience",
        "weight": 1,
        "pmpDeals": [
          6565
        ],
        "siteLists": {
          "include": [
            100,
            101
          ],
          "exclude": null
        },
        "exchanges": {
          "include": null,
          "exclude": [96]
        }
      }
    ],
    "audienceWeightsEnabled": false,
    "hourlyPacingMode": "ASAP",
    "hourlyFrontload": null,
    "io_number": null,
    "externalAdOrderId": null
  }
}

Request to create an ad order with channelsV2 account

curl -u <user>:<password> -X POST -H "Content-Type: application/json" -d '{"name" : "Android","campaignId":91,"optimizationGoal":"CPM","startDate" : 1462060800000,"endDate" : 1464652800000,"lifetimeBudget":1000,"channelsV2":["Display", "DOOH"], "audiences":null}' https://sandbox-api.viant.com/v1/adorder/save

Since the ID field is null, this creates a new ad order.

Response

{
  "messages": [],
  "entity": {
    "id": 9993,
    "name": "Android",
    "campaignId": 91,
    "startDate": 1462060800000,
    "endDate": 1464652800000,
    "optimizationGoal": "CPC",
    "lifetimeBudget": 1000,
    "frequencyCap": {
      "limit": null,
      "duration": null,
      "timePeriod": null
    },
    "channelsV2": [
      "Display",
      "DOOH"
    ],
    "audiences": [
      {
        "id": 9802,
        "name": "Default Audience",
        "weight": 1,
        "pmpDeals": null
        "siteLists": {
          "include": [
            100,
            101
          ],
          "exclude": null
        },
        "exchanges": {
          "include": null,
          "exclude": [96]
        }
      }
    ],
    "audienceWeightsEnabled": false,
    "goalMode": "PERFORMANCE",
    "hourlyPacingMode": "ASAP",
    "hourlyFrontload": null,
    "io_number": null,
    "externalAdOrderId": null
  }
}
Body Params
string
required
int32
required

Campaign ID associated with the ad order. The campaign's budget type determines which budget fields are required.

string
enum
required

Optimization goal for the ad order.
VCR is accepted as a case-insensitive alias for VIDEO_COMPLETION_RATE on input
and is normalized to VIDEO_COMPLETION_RATE in the response.

Allowed:
number
required
number
required
number

The total lifetime budget for the ad order in USD.
Required if the campaign's budget type is MONETARY.
Optional (will be ignored) if the campaign's budget type is IMPRESSIONS.

number

The daily budget limit in USD.
Optional. Only applicable when the campaign's budget type is MONETARY.

number

The total lifetime impressions budget for the ad order.
Required if the campaign's budget type is IMPRESSIONS.
Not applicable if the campaign's budget type is MONETARY.

number

The daily impressions budget limit.
Optional. Only applicable when the campaign's budget type is IMPRESSIONS.

frequencyCap
object
number
boolean
boolean
string
enum
Allowed:
number

CPA goal value. Required when optimizationGoal=CPA.

double

CTR goal (e.g. 0.002). Required when optimizationGoal=CPC.

double

Video completion rate goal (0.0–1.0).
Required when optimizationGoal=VIDEO_COMPLETION_RATE on create.
On update, if omitted, the existing stored value is preserved.

number | null

Minimum bid multiplier for bid matrix entries.
On update, if omitted, the existing stored value is preserved.

number | null

Maximum bid multiplier for bid matrix entries.
On update, if omitted, the existing stored value is preserved.

channels
array of strings
channels
string
dayParts
array of objects
dayParts
audiences
array of objects
audiences
string
string
enum
Allowed:
number
Responses

401

Unauthorized

403

Forbidden

404

Not Found

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json