Choose what to restrict
Pick the rules the preset holds when you save it. Caps count separately for each card the preset is attached to. Caps use the amount the processor charges. Sendamount to have a purchase judged the moment your agent opens it.
Available preset parameters:
Caps are in US dollars. A purchase whose processor names no amount, with no
amount from your agent, is refused right before the card is sent with amount_unknown, and a purchase in another currency is refused for the currency.
Attach to a card
Attach a preset to one of a user’s stored cards, and every purchase paid with that card follows it. Read the card id from the user’s stored cards, or from theid in the vault.card_stored event:
office-supplies judges every purchase paid with that card. Your agent opens a purchase on the card by sending card_id on the checkout authorization; at a merchant the preset does not allow, the call answers HTTP 403 and no authorization exists:
card_id, or leave the user with exactly one stored card, and Agentcard judges the card’s presets the moment your agent opens the purchase; otherwise it judges them right before the card is sent, once the user has chosen and unlocked a card.
To stop using the preset on that card, detach it with the same body:
Combine several presets
When one or more presets apply to a purchase, the purchase must satisfy all of them. Agentcard judges each purchase against every attached preset, and any that would cause a refusal are named in the response.Read a refused purchase
Agentcard checks a purchase twice: when your agent opens it, and again right before the card is sent, after the user approves. If a preset refuses at the second check, the user sees:status is declined, with the preset and the rule named. A purchase every attached preset allows is approved and paid like any other.
Replace or delete a preset
Read your presets, or one preset and where it is attached:Relax restrictions
You can relax a preset’s restrictions by changing what it does when a purchase breaks a rule: a warning instead of the default refusal. Set"mode": "watch" on the preset, or save the same rules under a second preset with "mode": "watch". For example, a currency rule:
Receive the notices
Every refusal and every watched purchase sends one notice, three ways: an event to your webhook, an email to your billing contact and your account’s owners and admins, and a post in your Slack conversation with Agentcard once you have connected it. A test-mode purchase sends the webhook only. Every notice names the preset, where it is attached, the rule, and what to do next. A refusal when your agent opens the purchase is acheckout_authorization.refused event. It has no authorization id, because none was created:
checkout_authorization.declined event with the same fields. A watched purchase is a checkout_authorization.watched event, sent after approved. See Checkout authorization events.
The email for the refusal above:
Look up a refusal code
Codes frommerchant_denied down are returned when your agent opens the purchase or right before the card is sent. The first three are returned when you save or attach.
Every refusal names the preset that refused and the card it is attached to, with its last four digits. When several presets refuse the same purchase,
refusals lists each one, and the top-level fields are the first.