Mandate .spend
Pays an outside party with a single-use card, inside your standing approval.
- Action class
spend- Approval
- Asks above your rule
- Emits
Mandate.spent- Price
- Free
Its Inputs, Outputs, Effects and guards quote the hub’s Mandate.spend; this page adds what each Venue honors, its limits and a worked call. It is one of the Verbs of Ads.
Inputs
| Name | Type | Default | Meaning |
|---|---|---|---|
mandate | Mandate | Required | The standing approval that covers the purchase. |
amount | money | Required | The amount to spend. |
payee | string | Required | Who is paid. |
Outputs
| Field | Type | What null means |
|---|---|---|
transaction | Transaction | Never null: the card Transaction. |
mandate | Mandate | Never null: your standing approval with its remaining Limit. |
Effects
- Action class
spend: an approval rule onspendcan make it wait for your OK- Modes
try: Runs every check and returns what would go out, as it would go out; nothing is sent, posted or spent.send: Returns a pending Action at once;Mandate.spentfires when it is done.do: Waits for the Action to finish and returns the record.
- Idempotency
Only with a key: the same
Idempotency-Keyand input return the first Action, and the same key with other input returns409.- Saved or shared
Checks your standing approval’s Limit; above it, opens an Approval and the Action waits. Posts a cost Entry against the Action that spent.
- Emits
Mandate.spentwith{ mandate }- Performed by
Whichever seat calls it
- Price
Free on your own account. The spend is billed by the Venue directly.
- Standing approval
It asks you first above its seat rule, unless a standing approval covers it: a
Mandateyou grant once withMandate.authorize.
On each Venue
It acts on your own records and reaches no Venue, so every account answers the same way.
What try does
Runs every check the call meets and returns the record as it would be; nothing is stored, sent or posted.
Refuses when
The hub sets no guard of its own on this call: it refuses only on the shared checks every write meets (a missing record, a Permission the seat lacks).
When it waits
It waits for your approval when the step is over your rule and no standing approval covers it; otherwise it returns in one response.
Example
In send mode the call returns its pending Action at once, and Mandate.spent delivers the result.
Pay the $49 listing fee for the property-management directory from the
paid-media mandate.{
"mode": "send",
"action": {
"$id": "https://api.sb/leaseline.app/actions/action_Sd3kQ9vT2w" ,
"operation": "Mandate.spend",
"status": "pending",
"reason": "running"
}
}To retry, send the same Idempotency-Key: the retry returns the first answer for $0. A new key reads again.
Used by
- Jobs: Reach out