Get the pricing template
Read the source with thefeedTemplate include:
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 inmetadata.inventorySourceId, the
source id from search:
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:approval_required, with a link to the approval page and an idempotencyKey:
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 thesource_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:
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.
operationisupsertorarchive. Anupsertrow needssource_external_account_id, the account id the ad server lists for the buyer.operator_domainis a registrable domain.brand_domainmay be a subdomain but not awww.host.binding_modeisdedicatedorshared_default. A feed never turns one into the other for the same account.brand_countriesis empty or a sorted JSON array of ISO country codes.inventory_source_keyis thesourceIdof a source of your account that carries a native account.
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.