save_playbook. The agent
that answers your buyers’ proposal requests, hosted by Apostra or your own,
reads the terms that apply to one buyer, limits included, from that buyer’s
rate card.
Limits and the rate card are in beta for Seller Accounts on the beta profile.
Elsewhere
limits and include: ["rate_card"] are refused with
FEATURE_NOT_ENABLED. In this beta your limits are something your agent
reads; Apostra does not yet hold back an offer that breaks one by itself.Who can set limits
Only a person sets limits directly: you, signed in, or through your own API key or connected chat. A call from an agent acting on its own, such as a hosted agent’s scheduled run, or made with an organization API key, is refused withACCESS_DENIED. So is a limit change read from a Library file (a
save_playbook call that carries materialCandidate). Changes like these will wait for your approval once that
approval path is available; until then, make the change yourself.
Write a limit
Each limit is a rule. A rule says which buyers, which products and which kind of execution it covers, when it holds, and what happens then.houseDomain and scope go together. Send both as null for a rule that
covers every buyer, or set both for one house. One set without the other is
refused with VALIDATION_FAILED. A house rule covers the house’s brands or
operators as house discounts do: a brand rule on nike.com also covers a
Converse buy, because converse.com belongs to the Nike house.
The conditions in when are:
lineItemBudgetBelow and priceBelow are amounts with their own currency,
such as { "amount": 30000, "currency": "USD" }. The playbook and the rate
card return each amount in the currency you saved it in; in this beta Apostra
converts and compares nothing. When Apostra enforces limits, it will convert
an offer priced in another currency at the platform’s exchange rate for that
day before comparing it, so a rule never lapses because an offer is priced in
another currency. It will also treat a condition as holding when no rate is
available, or when the offer states no budget or price.
Example: no custom execution under $30,000
Example: Nike-house discounts above 15% need your approval
Change or remove a rule
limits changes only the rules you name. A rule with an id replaces that
rule in full, so send every field, not only the one you are changing. Rules you
leave out stay as they are. To delete rules, list their ids in remove:
rules and remove.
An account holds at most 200 limit rules. A call that would leave more is
refused, and nothing in it is saved; remove rules you no longer need first.
When several rules match
The strictest rule wins.never beats needs_approval, and needs_approval
beats an offer no rule stops. A rule matches an offer when it covers the buyer,
the product and the execution, and every condition in its when holds.
Read your limits
get(kind: "playbook") returns your rules under limits.rules, in the same
shape save_playbook takes, plus three fields the server sets: id, version
(which goes up by one each time the rule changes) and updatedAt. To change a
rule, read it, drop version and updatedAt, change what you need, and save
it back with its id.
Read one buyer’s rate card
get(kind: "account_relationship", id, include: ["rate_card"]) adds rateCard
to the relationship: the terms that apply to that buyer.
Floors come from your pricing facts. A floor you set for one buyer in your
buyer instructions is not part of the rate card yet.
Each line’s
version is derived from what the line says, and the card’s
version from its lines. The same terms always read with the same versions,
and any change to a line changes both.
If the buyer’s corporate hierarchy cannot be read, the rate card is not
returned, because a rule or discount keyed to the buyer’s house could be
missing. Retry the read.