Skip to main content
A wholesale pricing feed gives a source the prices and availability your ad server cannot expose. A buyer account feed maps each buyer account to the account it uses in your ad server. Both are Library documents, saved, previewed and committed the way a rate card or an avails sheet is. The Inventory Feed Page and the Buyer Account Mapping import use the same checks and the same services, so what the page shows and what an agent reads are the same.

Get the pricing template

Read the source with the feedTemplate include:
The answer has a feedTemplate with the file name, the columns, rowCount and csvText: one row for each ad-server selector the source products use, with everything Apostra already knows filled in. You add the CPM percentiles, the monthly impressions and the window. A very large template stops at a whole row after 200,000 characters and says truncated: true. A source that cannot carry wholesale pricing leaves the include out and says why under unavailableIncludes.

Save the pricing feed

Save the completed CSV as a Material. Name the source it prices in metadata.inventorySourceId, the source id from search:
The source must be a modular source or a managed ad-server source of your account. The feed can also be an uploaded CSV or XLSX file. Saving changes no price.

Preview it

included.wholesalePricingPreview holds:

Commit it: an administrator approves

Committing replaces every price the source has, and buyers see the new prices at once. So the commit does not change anything. It checks the token and records a request:
The answer is approval_required, with a link to the approval page and an idempotencyKey:
Show the link to an administrator of the account. They see what will be replaced and how many rows are live now, and approve or reject on our site, signed in as themselves. Nothing changes before that. Repeat the same save_material call to read the outcome: it returns the same request while it waits, and the commit result once it has run. If the feed is already the live one, the answer is wholesale_pricing_already_live and nothing is recorded. See Web approvals for how an approval works. The approval commits exactly the feed you previewed. When the administrator approves, it runs again against what is true now, and it refuses, and changes nothing, with a named reason when: A busy source, or a lost connection, leaves the approval running and it is tried again. It never reports success for a commit that did not happen.

The buyer account feed

A buyer account feed is the source_account_bindings.csv that maps buyers to accounts in bulk, the same file the Buyer Account Mapping Page imports. Save it as a Material with documentType: "seller_account_feed". metadata.feedMode is snapshot (the default) or delta. A snapshot lists every binding of the sources it names, and a row left out archives only a binding this feed created. A delta changes only the rows it lists and must follow the feed latest committed revision. The file is a CSV with one row for each binding. An account that maps buyers by their complete account key uses schema_version 2 and these columns:
An account that still maps by operator and brand uses schema_version 1 and the columns schema_version,operation,operator_domain,brand_domain,inventory_source_key,source_external_account_id. A file in the other version is refused, never converted.
  • operation is upsert or archive. An upsert row needs source_external_account_id, the account id the ad server lists for the buyer.
  • operator_domain is a registrable domain. brand_domain may be a subdomain but not a www. host.
  • binding_mode is dedicated or shared_default. A feed never turns one into the other for the same account.
  • brand_countries is empty or a sorted JSON array of ISO country codes.
  • inventory_source_key is the sourceId of a source of your account that carries a native account.
The feed creates no buyer, no relationship and no ad-server account. A row that names something your account does not have is quarantined, and the preview says why.
included.sellerAccountFeedPreview holds the state (preview_ready or validation_failed), the impact counts (create, update, archive, unchanged, quarantine, duplicate), up to 200 diagnostics, and a previewToken that is null until the feed can commit. A snapshot with any quarantined row cannot commit. Correct the file and save it again as a new revision. Commit it with save_material and commitPreview. This feed changes neither a price nor who may buy: it only maps an existing buyer relationship to an account the source already lists. So it commits on the call, for an administrator, and the answer says how many bindings were created, updated and archived. Repeating the same call answers idempotentReplay: true. A revision that is already committed cannot be previewed again: save the file as a new revision to change the mappings. A commit also refuses, and writes no binding, when the document has a newer revision than the one you previewed: preview the current revision and commit that.

What the pages do

The Inventory Feed Page commits a pricing feed the same way: it records the request and shows the approval link, and nothing is committed until an administrator approves. Its download of the template and its preview read the same functions as the calls above.