# Private Marketplace Exchange (PMP-E)

Private Marketplace Direct (PMP-E)

## List Deals

 - [GET /deals](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/list-deals.md): List the Deals

## Create Deal

 - [POST /deals](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/post-deal.md): Create Deal

## List Deals and their reporting data

 - [POST /deal_analytics](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/list-deals-and-reporting-data.md): List the Deals

This call returns all information you get with a deal and also the reporting data for a specified time interval (time_window : "yesterday", "last_7_days", "last_30_days", "month_to_date", or a custom range using "start_date" and "end_date"). You should only send time_window or start_date/end_date but not a combination of the both. 
The filters field allows you to filter the results based on what you need, e.g: "filters": [{"field":"id", "op":"in", "value": [123]}] will look for deals that have 123 in their ID. 
{"field" :"match_rate", "op":">", "value" :0} will return deals that have a "match_rate" greater than 0. You can also use the "sorting" field to sort the results, eg: "sorting":[{"field":"viewability_rate", "dir":"asc"}] will give the results sorted by the viewability_rate field. 

{
  "reporting": {
    "organization_id": 100048,
    "time_window": "last_7_days",
    "start_date": null,
    "end_date": null
  },
  "filters": [
   {"field": "id",
               "op": "in",
               "value" : [447824]},
               {"field": "match_rate",
               "op": ">",
               "value" : 0}
  ],
  "sorting": [
      {
               "field": "viewability_rate",
               "dir": "asc"
           }
 
  ],
  "paging": {
    "page_offset": 0
  }
}

## Get Deal

 - [GET /deals/{id}](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/get-deal.md): Get Deal

## Update Deal

 - [POST /deals/{id}](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/put-deal.md): Update Deal

## List the Deal Groups

 - [GET /deal_groups](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/list-deal-groups.md): List the Deal Groups
When executing the GET call, you must specify one of the following: 'owner.organization_id', or 'ids' parameter, or else you will receive an error.

## Create a Deal Group

 - [POST /deal_groups](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/post-deal-group.md): Create a Deal Group

Deal Groups are a feature that will allow you and your team to package individual deals into groups.  This should streamline targeting, improve marketability (ex. creating a viewability deal group), and simplify bulk updating of strategies targeting deals. 

Deal Groups Ownership and Targeting Permissions:
Ownership: Deal Groups can be created at the Organization, Agency, or Advertiser level of the T1 hierarchy. The creating entity (ex. Agency Z) owns the Deal Group, and any users with access to that entity can edit the Deal Group. Similarly, individual deals can be created at the Organization, Agency, or Advertiser level. The creating entity owns and can edit the deal. A Deal Group can only include deals which have the same owning entity as the Deal Group. This means that a Deal Group created by Agency Z can only include deals owned by Agency Z. That Deal Group cannot include deals created by any other entity, including Agency Z’s parent Organization or subsidiary Advertisers. Like deals, ownership of a Deal Group cannot change once it is created. Please consider this when creating deals and Deal Groups and developing targeting strategies. 
Targeting: Targeting permissions are set within individual deals. The default setting permissions all sub-entities of the deal owning entity to target the deal. For example, a deal created by Org X will by default be targetable by all agencies, advertisers and their strategies within Org X. Targeting permissions can also be restricted to particular subsidiary entities of the owning entity. For example, a deal may be created at the Agency level, but only permission targeting for two out of three advertisers within that agency. There are no targeting permissions set within a deal group. Deal Groups instead honor the targeting permissions of the deals within them.  Inside a strategy, users can expand Deal Groups to view the deals within them. Users will only be able to view deals which they are permissioned to target. Deals showing in gray are inactive.

## Get Deal Groups

 - [GET /deal_groups/{id}](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/get-deal-group.md): Get a Deal Group's Details

## Update Deal Groups

 - [POST /deal_groups/{id}](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/put-deal-group.md): Update a Deal Group's Details

Deal Groups are a feature that will allow you and your team to package individual deals into groups.  This should streamline targeting, improve marketability (ex. creating a viewability deal group), and simplify bulk updating of strategies targeting deals. 

Deal Groups Ownership and Targeting Permissions:
Like deals, ownership of a Deal Group cannot change once it is created.
There are no targeting permissions set within a deal group. Deal Groups instead honor the targeting permissions of the deals within them.

## Create publisher

 - [POST /publishers](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/post_publishers.md): 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

## List publishers

 - [GET /publishers](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/retrieve_publishers.md): Publishers are associated to an organization. A collection of publishers for an organization can be retrieved using an HTTP GET request containing an organization_id

Example: https://api.mediamath.com/deals/v1.0/publishers?organization_id=100315

The allowed sort_by parameters are "id", "name", "created_on", and "updated_on". organization_id is the only required parameter

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

## Read publisher

 - [GET /publishers/{id}](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/retrieve_a_publisher_by_id.md): Example: https://api.mediamath.com/deals/v1.0/publishers/3

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

## Update Publisher

 - [POST /publishers/{id}](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/edit_pub_name.md): Example: POST https://api.mediamath.com/deals/v1.0/publishers/5

where you might want to edit to the following:


{
    "name" : "edited demo publisher 2", 
}


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

## Delete publisher

 - [DELETE /publishers/{id}](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/delete_publisher.md): Example: DELETE https://api.mediamath.com/deals/v1.0/publishers/5


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

## List channels

 - [GET /channels](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/list_channels.md): Displays a list of channels

## Bulk Update Deal

 - [PUT /bulk_update/deals](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/update-bulk-deal.md): Bulk Update Deal

## Bulk Create Deal

 - [POST /bulk_create/deals](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/bulk-create-deal.md): Bulk Create Deal 
endpoint is /deals/v1.0/bulk_create/deals

## Bulk Create or Update Deal

 - [POST /bulk/deals](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/bulk-create-or-update-deal.md): 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.

## Bulk Create Publishers

 - [POST /bulk_create/publishers](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/bulk-create-publishers.md): This allows you to add multiple publishers at one under the same organization id.


Publishers

Information about PMP-D from the MediaMath 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

## List Deal Strategies

 - [GET /deals/{id}/strategy_deals](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/list-deal-strategies.md): List Deal Strategies

Example: /deals/v1.0/deals/380882/strategy_deals

you can use the 'with' parameter to get information about the strategies and campaigns using the deal.
eg: /deals/v1.0/deals/380882/strategy_deals?with=strategy,campaign,advertiser

## List Deal Group Strategies

 - [GET /deal_groups/{id}/strategy_deal_groups](https://apidocs.mediamath.com/apis/marketplaces-api/marketplaces/private-marketplace-exchange-(pmp-e)/list-deal-group-strategies.md): List deal group strategies

Example: /deals/v1.0/deal_groups/980/strategy_deal_groups

you can use the 'with param to vide the details of the strategy's campaign or advertiser
eg: deals/v1.0/deal_groups/980/strategy_deal_groups?with=strategy,campaign,advertiser

