Skip to content

Create Deal

Request

Create Deal

Security
Bearer
Headers
Content-Typestringrequired

Content-Type

Default:"application/json"
Cookiestringrequired

Cookie

Default:"adama_session=<<sessionid>>"
Bodyapplication/json

_

bill_typestring

Bill recipient when creating a deal

Enum:"EXCHANGE""NONE""PUBLISHER"
channelsArray of integers

List of advertising channel IDs to associate with this deal (use GET /channels to see available channels)

Example:
[ 5, 4 ]
deal_identifierstring, <= 255 characters

the identifier used within a bid request to reference the deal

Default:"EXCHANGE"
deal_typestring

When creating deal type PG, price_type must be set to FIXED and valid start_datetime and end_datetime must be present.

Default:"STANDARD"
Enum:"PG""STANDARD"
descriptionstring, <= 4095 characters

the description of the deal

end_datetimestring, (date-time)

string / timestamp as full RFC 3339 date strings including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDTHH:MM:SS-##:##. Default is current time.

namestring, <= 255 charactersrequired

the name of the deal

ownerobjectrequired

level of ownership for the deal (i.e. who can edit the deal) and the id of the ownership entity. for example, if the ownership level is set to ADVERTISER, anyone with access to such advertiser can edit this deal.

permissionsobjectrequired

List of entities that are allowed to target this deal, which should be either the owner entity or sub-entities of the owner entity. if a higher-level entity is included, then do not include any lower-level entity that is part of the included higher level entity. for example, if an organization X is listed in this parameter, then automatically all agencies and advertisers that are part of the organization X will be included and listing any such agencies and advertisers part of organization X will cause a validation error.

priceobjectrequired

price floor or fixed value to use in auction along with the associated currency code

price_methodstring

only CPM cost accrual is supported

Default:"CPM"
Value:"CPM"
price_typestring

The deal is a "FLOOR" price deal (bids must be above this floor, and will likely clear above this floor) or "FIXED" price deal (bids must be at this price or above, and will clear at the fixed price)

Default:"FLOOR"
Enum:"FIXED""FLOOR"
start_datetimestring, (date-time)

string / timestamp as full RFC 3339 date strings including timezone offsets: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDTHH:MM:SS-##:##. Default is current time.

statusboolean

If the deal is active

Default:true
sub_supply_source_idinteger or null

the id of the publisher if the supply_source_id is set to 83 (BidSwitch)

supply_source_idintegerrequired

the exchange providing the deal

publisher_idinteger or null

the publisher id (optional)

curl -i -X POST \
  https://api.mediamath.com/deals/v1.0/deals \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -H 'Cookie: adama_session=<<sessionid>>' \
  -d '{
    "bill_type": "EXCHANGE",
    "channels": [
      5,
      4
    ],
    "deal_identifier": "EXCHANGE",
    "deal_type": "PG",
    "description": "string",
    "end_datetime": "2019-08-24T14:15:22Z",
    "name": "string",
    "owner": {
      "id": 0,
      "type": "ADVERTISER"
    },
    "permissions": {
      "advertiser_ids": [
        0
      ],
      "agency_ids": [
        0
      ],
      "all_organizations": true,
      "organization_ids": [
        0
      ]
    },
    "price": {
      "currency_code": "USD",
      "value": "string"
    },
    "price_method": "CPM",
    "price_type": "FIXED",
    "start_datetime": "2019-08-24T14:15:22Z",
    "status": true,
    "sub_supply_source_id": 0,
    "supply_source_id": 0,
    "publisher_id": 0
  }'

Responses

Bodyapplication/json
dataobject
metaobject
Response
{ "data": { "bill_type": "EXCHANGE", "channels": [ … ], "created_on": "2019-08-24T14:15:22Z", "deal_identifier": "string", "deal_type": "PG", "description": "string", "end_datetime": "2019-08-24T14:15:22Z", "entity_type": "deal", "id": 0, "name": "string", "owner": { … }, "permissions": { … }, "price": { … }, "price_method": "CPM", "price_type": "FIXED", "start_datetime": "2019-08-24T14:15:22Z", "status": true, "sub_supply_source_id": 0, "supply_source_id": 0, "supply_source": { … }, "publisher_id": 0, "publisher": { … }, "strategies_count": 0, "organization_id": 0, "impressions": 0, "effective_status": "ready", "severity": 0, "deal_groups": [ … ], "updated_on": "2019-08-24T14:15:22Z", "has_strategies": true }, "meta": { "status": "string" } }