Inventory Sets
  • 7 Minutes to read

    Inventory Sets


      Article summary

      Multiple exchanges, deals or a combination of both can be assembled as inventory sets to target or block across multiple lines. Use inventory sets for line targeting to avoid having to manually target the same deals or exchanges one at a time across multiple lines.

      Endpoint

      /traffic/inventorysets

      The following HTTP methods can be used:

      • Use the GET method to view an existing inventory set.

      • Use the POST method to create a new inventory set.

      • Use the PUT method to update an existing inventory set.

      Resources

      Inventory Sets

      The inventorysets object contains the following fields:

      Parameter

      Definition

      Data Type

      Create

      Update

      id

      The ID of the inventory set.

      integer

      N/A

      Required

      parentAccountId

      The ID of the advertiser where the inventory set is to be located.

      integer

      Required

      Required

      name

      The name of the inventory set.

      string

      Required

      Required

      status

      The current status of the inventory set.

      • ACTIVE: the inventory set is active.

      • INACTIVE: the inventory set is inactive.

      string

      Required

      Optional

      dealIds

      The ID(s) of the deals to be included in the inventory set.

      Note: Deals cannot be blocked for targeting.

      array

      Required if the inventory set includes deals

      Optional

      publisherIds

      The ID(s) of the exchanges to be included in the inventory set.

      array

      Required if the inventory set includes exchanges

      Optional

      advertiserSharingSettings

      Specifies options to share an inventory set with one or more advertisers. To learn more, refer to advertiserSharingSettings Object.

      object

      Optional

      Required

      count

      A response-only field that shows the total deals, exchanges or both included in the inventory set.

      integer

      N/A

      N/A

      appliedLineCount

      A response-only field that shows the number of lines the inventory set is applied to.

      integer

      N/A

      N/A

      appliedActiveLineCount

      A response-only field that shows the number of active lines the inventory set is applied to.

      integer

      N/A

      N/A

      createdDate

      A response-only field that shows the date the inventory set was created.

      string

      N/A

      N/A

      lastModifiedDate

      A response-only field that shows the date the inventory set was last modified.

      string

      N/A

      N/A

      createdBy

      A response-only field that shows who created the inventory set.

      string

      N/A

      N/A

      lastModifiedBy

      A response-only field that shows who last modified the inventory set.

      string

      N/A

      N/A

      publishers

      A response-only field that shows the exchange(s) included in the inventory set.

      array

      N/A

      N/A

      advertiser

      A response-only field that shows the specific advertiser where the inventory set is located.

      object

      N/A

      N/A

      dealsList

      A response-only field that shows the deals included in the inventory set.

      array

      N/A

      N/A

      advertiserSharingSettings Object

      The advertiserSharingSettings object specifies options to share an inventory set with one or more advertisers. The object contains the following fields.

      Important

      If inventory sets are being used on active lines, they cannot be unshared until they are manually removed from the lines first.

      Parameter

      Description

      Data Type

      Create

      Update

      type

      Specifies the way in which an inventory set is shared with a set of advertisers.

      • INCLUDE - the inventory set is shared with only the advertiser(s) specified in the advertisers array.

      • EXCLUDE - the inventory set is shared with all advertiser(s) except for the ones specified in the advertisers array.

      • ALL - the inventory set is shared with all advertisers under a seat.

        Note: If ALL is chosen, then specifying a list of advertisers is not required.

      string

      Required

      Required

      advertisers

      Specifies an array of advertisers to share an inventory set with.

      array

      Required unless type=ALL

      Required unless type=ALL

      id

      Specifies the advertiser ID.

      integer

      Required

      Required

      name

      Specifies the name of the advertiser. This field is optional, as the name of the advertiser will populate by default based on the ID.

      string

      Optional

      Optional

      Read an Inventory Set

      Get data for a specific inventory set.

      GET traffic/inventorysets/{id}

      Parameters

      Parameter

      Parameter Type

      Definition

      Data Type

      Required

      id

      path

      The ID of the inventory set.

      integer

      Y

      Sample Request URL

      GET /traffic/inventorysets/398

      Sample Response

      {
       "response": {
           "id": 398,
           "name": "vdjuketic-with-deal",
           "count": 1,
           "appliedLineCount": 1,
           "appliedActiveLineCount": 1,
           "createdDate": "2023-01-30T09:36:17Z",
           "lastModifiedDate": "2023-01-30T09:36:17Z",
           "createdBy": "Vukašin Djuketi?",
           "lastModifiedBy": "Vukašin Djuketi?",
           "advertiser": {
               "id": 3229241,
               "name": "vdjuketic-test-advertiser"
           },
           "status": "ACTIVE",
           "dealsList": [
               {
                   "id": 19460,
                   "name": "AdeDeal1",
                   "exchangeDealId": "12",
                   "exchangeId": 12,
                   "accounts": [
                       12035
                   ],
                   "accountGroups": [],
                   "programmaticGuaranteed": false,
                   "status": "ACTIVE",
                   "restricted": true
               }
           ],
           "advertiserSharingSettings": {
               "type": "NONE",
               "advertisers": []
           }
       },
       "errors": null,
       "timeStamp": "2023-06-21T08:28:27.627Z"
      }

      Read a Filtered List of Inventory Sets

      Get data for a filtered list of inventory sets.

      GET /traffic/inventorysets?accountId={accountId}&includeChildren={includeChildren}&limit={limit}&query={query}

      To get a filtered list of inventory sets, use any of the following query parameters in the URL path.

      Parameters

      Parameter

      Definition

      Data Type

      Required

      accountId

      The ID of the advertiser where the inventory set is located.

      integer

      Y

      includeChildren

      Specifies whether the response returns the deals or exchanges associated with the inventory set(s).

      • True - returns the associated deals or exchanges with the inventory set(s)

      • False - does not return the associated deals or exchanges with the inventory set(s).

      boolean

      N

      limit

      Specifies the limit to the number of inventory sets that can be returned.

      integer

      N

      query

      Specifies the search term.

      string

      N

      page

      Specifies the page number

      integer

      N

      sort

      Specifies the column to sort by.

      string

      N

      dir

      Specifies the sort direction.

      • ASC: data is sorted in ascending order.

      • DESC: data is sorted in descending order.

      string

      N

      Sample Request URL

      GET /traffic/inventorysets?accountId=12035

      Sample Response

      {
        "response": [
            {
                "id": 98,
                "name": "Test IG's 1",
                "count": 5,
                "appliedLineCount": 1,
                "appliedActiveLineCount": 1,
                "createdDate": "2021-12-23T00:01:31Z",
                "lastModifiedDate": "2022-07-04T15:52:37Z",
                "createdBy": "ఫణి Gudimetla",
                "lastModifiedBy": "Amit Jaiswal",
                "advertiser": {
                    "id": 12035,
                    "name": "DetailedAdvertiser."
                },
                "status": "ACTIVE",
                "dealsList": [],
                "advertiserSharingSettings": {
                    "type": "INCLUDE",
                    "advertisers": [
                        {
                            "id": 2132953,
                            "name": "Zoltar Team Advertiser"
                        }
                    ]
                }
            }
        ],
        "errors": null,
        "timeStamp": "2023-06-21T08:49:50.623Z"
      }

      Create Inventory Sets

      Create a new inventory set.

      POST /traffic/inventorysets

      Note

      Deals cannot be blocked for targeting.

      Parameters

      All fields are specified in the request body.

      Sample Request URL

      POST /traffic/inventorysets

      Sample Request Body

      The following request shows an example of creating an inventory set that includes one exchange and one deal, as well as sharing it with all advertisers under the Seat.

      {
       "parentAccountId":12035,
       "name":"Traffic inventory set",
       "status":"ACTIVE",
       "dealIds":[
          6
       ],
       "publisherIds":[
          1
       ],
       "advertiserSharingSettings":{
          "type":"ALL",
          "advertisers":[
      
          ]
       }
      }

      Sample Response

      {
        "response": {
            "id": 428,
            "name": "Traffic inventory set",
            "count": 2,
            "appliedLineCount": 0,
            "appliedActiveLineCount": 0,
            "createdDate": "2023-06-21T10:23:41Z",
            "lastModifiedDate": "2023-06-21T10:23:41Z",
            "createdBy": "Vukašin Djuketi?",
            "lastModifiedBy": "Vukašin Djuketi?",
            "publishers": [
                {
                    "id": 1,
                    "name": "MoPub"
                }
            ],
            "advertiser": {
                "id": 12035,
                "name": "DetailedAdvertiser."
            },
            "status": "ACTIVE",
            "dealsList": [
                {
                    "id": 6,
                    "name": "test",
                    "exchangeDealId": "123123",
                    "exchangeId": 3,
                    "accounts": [],
                    "accountGroups": [],
                    "programmaticGuaranteed": true,
                    "status": "ACTIVE",
                    "restricted": false
                }
            ],
            "advertiserSharingSettings": {
                "type": "ALL",
                "advertisers": []
            }
        },
        "errors": null,
        "timeStamp": "2023-06-21T10:24:13.614Z"
      }

      Update Inventory Sets

      Update an existing inventory set.

      Important

      If an inventory set’s properties need to be updated, the updates can only be made in the advertiser it was created under. It cannot be updated within the advertisers it is shared with.

      PUT /traffic/inventorysets/{id}

      Parameters

      Parameter

      Parameter Type

      Definition

      Data Type

      Required

      id

      path

      The ID of the inventory set.

      integer

      Y

      Sample Request URL

      PUT /traffic/inventorysets/428

      Sample Request Body

      {
       "parentAccountId":12035,
       "name":"Traffic inventory set test",
       "status":"ACTIVE",
       "dealIds":[
          6
       ],
       "publisherIds":[
          1
       ],
       "advertiserSharingSettings":{
          "type":"ALL",
          "advertisers":[
      
          ]
       }
      }

      Sample Response

      {
       "response":{
          "id":428,
          "name":"Traffic inventory set test",
          "count":2,
          "appliedLineCount":0,
          "appliedActiveLineCount":0,
          "createdDate":"2023-06-21T10:23:41Z",
          "lastModifiedDate":"2023-06-21T10:31:30Z",
          "createdBy":"Vukašin Djuketi?",
          "lastModifiedBy":"Vukašin Djuketi?",
          "publishers":[
             {
                "id":1,
                "name":"MoPub"
             }
          ],
          "advertiser":{
             "id":12035,
             "name":"DetailedAdvertiser."
          },
          "status":"ACTIVE",
          "dealsList":[
             {
                "id":6,
                "name":"test",
                "exchangeDealId":"123123",
                "exchangeId":3,
                "accounts":[
      
                ],
                "accountGroups":[
      
                ],
                "programmaticGuaranteed":true,
                "status":"ACTIVE",
                "restricted":false
             }
          ],
          "advertiserSharingSettings":{
             "type":"ALL",
             "advertisers":[
      
             ]
          }
       },
       "errors":null,
       "timeStamp":"2023-06-21T10:31:40.543Z"
      }


      Was this article helpful?

      What's Next