Skip to content

Update Deal

Request

Update Deal

Security
Bearer
Path
idintegerrequired

id

Headers
Content-Typestringrequired

Content-Type

Default:"application/json"
Cookiestringrequired

Cookie

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

Note: The owner type and ID cannot be altered once the deal has been created.

bill_typestring

Bill recipient when creating a deal

Default:"EXCHANGE"
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

deal_typestring

When updating deal to 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-##:##

namestring, <= 255 characters

the name of the deal

permissionsobject

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.

priceobject

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

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)

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-##:##

statusboolean

whether 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_idinteger

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/{id}' \
  -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": "string",
    "deal_type": "PG",
    "description": "string",
    "end_datetime": "2019-08-24T14:15:22Z",
    "name": "string",
    "permissions": {
      "advertiser_ids": [
        0
      ],
      "agency_ids": [
        0
      ],
      "all_organizations": true,
      "organization_ids": [
        0
      ]
    },
    "price": {
      "currency_code": "str",
      "value": "string"
    },
    "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" } }