Skip to content

Mandate routes: revoke, spend

The Mandate Verbs revoke, spend as api.sb routes, with inputs, result, refusals and an example.

Reference for Mandate, one group of Mandate routes.

Mandate.revoke

Revoke ends a Mandate at once, so new Actions under it are refused and running ones finish. Verb page.

Text
POST /{namespace}/mandates/{mandate}/revoke

Path: mandate. Emits Mandate.revoked.

Inputs

InputTypeRequiredDescription
mandateMandaterequiredThe Mandate to end.

Returns

OutputTypeRequiredDescription
mandateMandaterequiredThe revoked Mandate.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
The record is not in a state that allows this Verb, so the call is refused.refusedRead the record, run the Verb that moves it to an allowed state, then retry.None.

Example

Terminal
curl -X POST https://api.sb/leaseline.app/mandates/mandate_mKKPrmFQYD/revoke \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "mandate": {
    "$id": "https://api.sb/leaseline.app/mandates/mandate_mKKPrmFQYD",
    "$type": "Mandate",
    "expiresAt": "2026-10-22T12:00:00Z",
    "status": "revoked"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Mandate.revoke",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Mandate.spend

Spend pays an outside party for a Startup with a single-use card, within a Mandate and its Limit. Verb page.

Text
POST /{namespace}/mandates/{mandate}/spend

Path: mandate. Body, as JSON: the other inputs. Emits Mandate.spent.

Inputs

InputTypeRequiredDescription
mandateMandaterequiredThe Mandate that covers the purchase.
amountmoneyrequiredThe amount to spend.
payeestringrequiredWho is paid.

Returns

OutputTypeRequiredDescription
transactionTransactionrequiredThe card Transaction.
mandateMandaterequiredThe Mandate with its remaining Limit.

Refuses when

CheckErrorFixThen call
The operation is part of an Offer the caller has not accepted or paid for.payment-requiredAccept the Offer named in the response, then retry the call.Offer.accept
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X POST https://api.sb/leaseline.app/mandates/mandate_mKKPrmFQYD/spend \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":{"amount":29,"currency":"USD"},"payee":"Example payee"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "transaction": {
    "$id": "https://api.sb/leaseline.app/transactions/txn_XoxtZe3CQI",
    "$type": "Transaction",
    "kind": "charge",
    "amount": {
      "amount": 29,
      "currency": "USD"
    }
  },
  "mandate": {
    "$id": "https://api.sb/leaseline.app/mandates/mandate_mKKPrmFQYD",
    "$type": "Mandate",
    "expiresAt": "2026-10-22T12:00:00Z",
    "status": "active"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Mandate.spend",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}