Marketplaces API V2.0 API (2.0)

Download OpenAPI description
Overview
Languages
Servers
https://api.mediamath.com/deals/v1.0/

Private Marketplace Exchange (PMP-E)

Private Marketplace Direct (PMP-E)

Operations

Bulk Create Deal

Request

Bulk Create Deal endpoint is /deals/v1.0/bulk_create/deals

For more insight into deal creation (inside T1), read here. You may find it useful for exploring input values.

Headers
Authorizationstring

Authorization

Default Bearer $TOKEN
Body
{
  "data": [
    {
      "updated_on": "2021-06-09T14:29:27+00:00",
      "created_on": "2021-04-12T13:22:35+00:00",
      "id": 422839,
      "name": "UIA_Inventory_Test",
      "description": null,
      "supply_source_id": 159,
      "sub_supply_source_id": null,
      "deal_identifier": "2718951",
      "start_datetime": "2021-04-12T13:22:15+00:00",
      "end_datetime": "2999-12-31T05:00:00+00:00",
      "price_type": "FIXED",
      "price_method": "CPM",
      "status": true,
      "bill_type": "EXCHANGE",
      "deal_type": "STANDARD",
      "impressions": null,
      "channels": [],
      "publisher_id": null,
      "organization_id": 100048,
      "permissions": {
        "all_organizations": false,
        "organization_ids": [
          100048
        ],
        "agency_ids": [],
        "advertiser_ids": []
      },
      "owner": {
        "type": "ORGANIZATION",
        "id": 100048
      },
      "price": {
        "value": "0.0073",
        "currency_code": "USD"
      },
      "entity_type": "deal",
      "deal_groups": [],
      "strategies_count": 0
    },
    {
      "updated_on": "2018-03-01T21:43:46+00:00",
      "created_on": "2017-04-10T06:31:51+00:00",
      "id": 177130,
      "name": "pmp test",
      "description": "",
      "supply_source_id": 218,
      "sub_supply_source_id": null,
      "deal_identifier": "MM2-8G3-K3D4",
      "start_datetime": "2017-04-10T07:31:28+00:00",
      "end_datetime": "2999-12-31T00:00:00+00:00",
      "price_type": "FLOOR",
      "price_method": "CPM",
      "status": true,
      "bill_type": "EXCHANGE",
      "deal_type": "STANDARD",
      "impressions": null,
      "channels": null,
      "publisher_id": null,
      "organization_id": 100048,
      "permissions": {
        "all_organizations": false,
        "organization_ids": [],
        "agency_ids": [],
        "advertiser_ids": [
          176789
        ]
      },
      "owner": {
        "type": "ADVERTISER",
        "id": 176789
      },
      "price": {
        "value": "8.0000",
        "currency_code": "USD"
      },
      "entity_type": "deal",
      "deal_groups": [],
      "strategies_count": 0
    }
  ]
}
object
curl -i -X POST \
  https://api.mediamath.com/deals/v1.0/bulk_create/deals \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/javascript' \
  -d '[object Object]'

Responses

{
    "data": {
        "created_deals": [
            {
                "updated_on": "2021-07-08T13:57:26+00:00",
                "created_on": "2021-07-08T13:57:26+00:00",
                "id": 429599,
                "name": "hello",
                "description": "hello",
                "supply_source_id": 246,
                "sub_supply_source_id": null,
                "deal_identifier": "hello",
                "start_datetime": "2020-12-31T05:00:00+00:00",
                "end_datetime": "2999-12-31T05:00:00+00:00",
                "price_type": "FLOOR",
                "price_method": "CPM",
                "status": false,
                "bill_type": "EXCHANGE",
                "deal_type": "STANDARD",
                "impressions": 22,
                "channels": [
                    {
                        "id": 1,
                        "name": "Display",
                        "pos": 1,
                        "created_on": "2020-07-20T11:13:55.015407+00:00",
                        "updated_on": "2020-07-20T11:13:55.015407+00:00"
                    },
                    {
                        "id": 2,
                        "name": "Mobile Web",
                        "pos": 2,
                        "created_on": "2020-07-20T11:13:55.015407+00:00",
                        "updated_on": "2020-07-20T11:13:55.015407+00:00"
                    }
                ],
                "publisher_id": null,
                "organization_id": 100315,
                "permissions": {
                    "all_organizations": false,
                    "organization_ids": [
                        100315
                    ],
                    "agency_ids": [],
                    "advertiser_ids": []
                },
                "owner": {
                    "type": "ORGANIZATION",
                    "id": 100315
                },
                "price": {
                    "value": "1.3000",
                    "currency_code": "EUR"
                },
                "entity_type": "deal",
                "deal_groups": [],
                "strategies_count": 0
            }
        ],
        "invalid_deals": []
    },
    "meta": {
        "status": "ok"
    }
}
Body
dataobject
metaobject
Response
No response example

Bulk Create or Update Deal

Request

Bulk Create/Update Deal endpoint is /deals/v1.0/bulk/deals To create a deal you need to populate all the fileds. To update you need to provide the "id" field and only the fields that you want to change. For more insight into deal creation (inside T1), read here. You may find it useful for exploring input values.

Headers
Authorizationstring

Authorization

Default Bearer $TOKEN
Body
{
    "deals": 
    [
        {
            "owner": {
                "type": "ORGANIZATION",
                "id": 100315
            },
            "price_method": "CPM",
            "deal_identifier": "Test_3",
            "name": "Test_3",
            "status": true,
            "start_datetime": "2022-06-01T05:00:00+00:00",
            "end_datetime": "2022-06-17T05:00:00+00:00",
            "channels": [1],
            "supply_source_id": 246,
            "permissions": {
                "organization_ids": [100315],
                "agency_ids" :[],
                "advertiser_ids":[]
            },
            "price": {
                "value": "1.3",
                "currency_code": "EUR"
            },
            "deal_type": "PG",
            "price_type": "FIXED"
        }
    ]
}

for update:

{
    "deals": 
    [
        {
            "id": 457001,
            "name": "Test_3_update",
            "status": false
        }
    ]
}
object
curl -i -X POST \
  https://api.mediamath.com/deals/v1.0/bulk/deals \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/javascript' \
  -d '[object Object]'

Responses

{
    "data": {
        "valid_deals": [
            {
                "updated_on": "2022-06-28T10:11:37+00:00",
                "created_on": "2022-06-28T10:11:37+00:00",
                "id": 457001,
                "name": "Test_3",
                "description": null,
                "supply_source_id": 246,
                "sub_supply_source_id": null,
                "deal_identifier": "Test_3",
                "start_datetime": "2022-06-01T05:00:00+00:00",
                "end_datetime": "2022-06-17T05:00:00+00:00",
                "price_type": "FIXED",
                "price_method": "CPM",
                "status": true,
                "deal_type": "PG",
                "impressions": null,
                "channels": [
                    {
                        "id": 1,
                        "name": "Display",
                        "pos": 1,
                        "created_on": "2020-07-20T11:13:55.015407+00:00",
                        "updated_on": "2020-07-20T11:13:55.015407+00:00"
                    }
                ],
                "publisher_id": null,
                "strategies_count": 0,
                "organization_id": 100315,
                "effective_status": "creating",
                "severity": null,
                "api_version": "v2",
                "permissions": {
                    "all_organizations": false,
                    "organization_ids": [
                        100315
                    ],
                    "agency_ids": [],
                    "advertiser_ids": []
                },
                "owner": {
                    "type": "ORGANIZATION",
                    "id": 100315
                },
                "price": {
                    "value": "1.3000",
                    "currency_code": "EUR"
                },
                "entity_type": "deal",
                "deal_groups": [],
                "publisher": null
            }
        ],
        "invalid_deals": []
    },
    "meta": {
        "status": "ok"
    }
}

for update:

    "data": {
        "valid_deals": [
            {
                "updated_on": "2022-06-28T12:21:03+00:00",
                "created_on": "2022-06-28T12:20:05+00:00",
                "id": 457226,
                "name": "Test_DanTest_1_update",
                "description": null,
                "supply_source_id": 246,
                "sub_supply_source_id": null,
                "deal_identifier": "Test_DanTest_1",
                "start_datetime": "2022-06-01T05:00:00+00:00",
                "end_datetime": "2022-06-17T05:00:00+00:00",
                "price_type": "FIXED",
                "price_method": "CPM",
                "status": false,
                "deal_type": "PG",
                "impressions": null,
                "channels": [
                    {
                        "id": 1,
                        "name": "Display",
                        "pos": 1,
                        "created_on": "2020-07-20T11:13:55.015407+00:00",
                        "updated_on": "2020-07-20T11:13:55.015407+00:00"
                    }
                ],
                "publisher_id": null,
                "strategies_count": 0,
                "organization_id": 100315,
                "effective_status": "creating",
                "severity": null,
                "api_version": "v2",
                "permissions": {
                    "all_organizations": false,
                    "organization_ids": [
                        100315
                    ],
                    "agency_ids": [],
                    "advertiser_ids": []
                },
                "owner": {
                    "type": "ORGANIZATION",
                    "id": 100315
                },
                "price": {
                    "value": "1.3000",
                    "currency_code": "EUR"
                },
                "entity_type": "deal",
                "deal_groups": [],
                "publisher": null
            }
        ],
        "invalid_deals": []
    },
    "meta": {
        "status": "ok"
    }
}
Body
dataobject
metaobject
Response
No response example

Bulk Create Publishers

Request

This allows you to add multiple publishers at one under the same organization id.

Publishers

Information about PMP-D from the T1 side can be found here A video explainer on publisher management through the MediaMath app can be found at: https://academy.mediamath.com/mediamath-beta-courses?next=%2Fmediamath-beta-courses%2F800806

Headers
Authorizationstring

Authorization

Default Bearer $TOKEN
Body

{"organization_id":100315, "names" : ["my name is..","my other name is"]}

organization_idinteger
namesArray of strings
curl -i -X POST \
  https://api.mediamath.com/deals/v1.0/bulk_create/publishers \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/javascript' \
  -d '[object Object]'

Responses

{
  "data": [
    {
      "updated_on": "2021-07-08T14:08:06+00:00",
      "created_on": "2021-07-08T14:08:06+00:00",
      "id": 514,
      "name": "my name is..",
      "organization_id": 100315,
      "last_touch_user_id": 4254,
      "deleted_on": null
    },
    {
      "updated_on": "2021-07-08T14:08:06+00:00",
      "created_on": "2021-07-08T14:08:06+00:00",
      "id": 515,
      "name": "my other name is",
      "organization_id": 100315,
      "last_touch_user_id": 4254,
      "deleted_on": null
    }
  ],
  "meta": {
    "status": "ok"
  }
}
Body
metaobject
dataArray of objects
Response
No response example