Pricing over the REST API and MCP
How the REST pricing calls for campaigns, banners, sites and placements validate, merge and report a write, and how an AI assistant reaches them over MCP.
Everything the Pricing card does has a REST counterpart. This page collects how those calls behave — what they check before storing, what they leave alone, and how an AI assistant reaches them. The console behaviour they mirror is on Configure pricing.
Who this is for
- Developers and integrators who price campaigns, banners, sites or placements from code.
- Anyone connecting an AI assistant over MCP.
A call needs the same permissions as the console card it stands in for, including each pricing type’s own permission.
REST API behaviour
Note — setting prices over the REST API.
POST /rest-api/sites/{siteId}/pricing.doandPOST /rest-api/placements/{placementId}/pricing.dotake the fixed price plusminMarginType(NONE,ABSOLUTE,PERCENT) andminMarginValue; the matchingGETreturns them. The two margin fields belong to the fixed-price model only and are rejected, not ignored, alongsideREVENUE_SHARE. TheGETneeds Manage Site Payment Model at enabled or read-only level and adds the two margin fields only for a caller who also holds Manage Minimum Margin at enabled or read-only level; thePOSTneeds Manage Site Payment Model enabled, and the margin fields additionally need Manage Minimum Margin enabled plus update access to the site. Omit either field to keep what is stored — the range check runs against the merged pair. Two behaviours to plan around: a siteFIXED_PRICEcall leaves the placements’ pricing rows — and their per-placement margin requirements — alone, and reuses the site’s own row, so the site-level requirement survives too; and a placement pricing row created by the API starts atNone, which means inherit the site’s requirement, not no requirement.
Note — a site’s per-advertiser shares over the API. An
advertiserPricingentry on a site may name acampaignId; it must be a live campaign of that entry’s advertiser — any other would never match a request, so it is refused with a 400 — andGET /rest-api/sites/{siteId}/pricing.doshows thecampaignIdof each such entry.
Note — placement pricing over the API.
GET /rest-api/placements/{placementId}/pricing.dolists every country price twice:countryPricingin its original{"US": 2.25}form, which does not say which action a CPA price is for, andcountryPricingDetailsas{"country", "price", "actionId", "actionName"}rows — a row withoutactionIdprices every action. A CPA placement also returnsuseGlobalActionPricingandglobalActionPricing(the per-action prices for every country). The checkbox isPOST /rest-api/placements/{placementId}/pricing/use-global-action-pricing.do?useGlobalActionPricing=false, and Upload CSV isPOST /rest-api/placements/{placementId}/pricing/batch.dowith the file incountryPricesor its text incountryPricesCsv; the answer lists the prices it stored inappliedand the rows it could not apply, with the reason, inrejected(plus the legacycsvErrors/csvWarnings). The campaign and banner CSV batch endpoints (…/campaign/{id}/pricing/batch.do,…/banner/{id}/pricing/batch.do) accept the samecountryPrices/countryPricesCsvchoice and answer the same way, so a client that cannot upload a file — such as an AI assistant — can price any of the three entity types from plain text.POST …/pricing.doon a site or placement replaces the country prices or per-advertiser shares only when you send that list — a call that changes only the base price or the revenue share keeps them. See the pricing corner cases in the API reference.
Note — every pricing write checks before it stores. A REST pricing call validates its input first: a price outside 0–1,000,000, a malformed
countryPricingentry, an unknown country or advertiser, or a missing required price is a 400 that names the field, and a refused call changes nothing. A write changes only what it names — a field you leave out keeps its stored value — and a field that does not apply to the chosen payment model or pricing type (for exampleactionNameon a campaign that is not CPA) is not applied and comes back inignoredFieldswith the reason.
Over MCP
Note — over MCP. An AI assistant has no dedicated pricing tool: it reads pricing through
campaign_overviewandplacement_overview, and finds and calls the operations above throughapi_search,api_describeandapi_write.whoamireportsmay.pricing(Manage Pricing),may.sitePricingandmay.viewSitePricing(Manage Site Payment Model). See Connect an AI assistant (MCP).
Corner cases and gotchas
Two console corner cases apply to API calls unchanged: a region or country group is not expanded
into countries, and sending a different pricingType deletes the existing country and action
prices. Both are described under Configure pricing — Corner cases and gotchas.