Skip to main content
Private preview: this is rolling out and may not be available on your account yet.
A Stamped Mandate permits only what its scopes say. Before you act, check that the request in front of you is inside them. The scope language, parameters and limits are described in The mandate language and Limits and narrowing; this page covers reading them in code.

Read a spending ceiling

readScopeCeiling reads the ceiling one scope states. It works offline on the scope string alone, so you can use it on the scopes from the exchange.
max is always in the display unit of the currency: max=25&currency=USD is 25.00 US dollars, never 25 cents. amount comes back as an exact decimal string, padded to the currency’s precision. Compare it as a decimal, never as a floating-point number.
Spending scopes belong to payments, which arrive in a fast-follow release. Identity scopes such as sr:us:pint:sigil:proof_of_personhood state no ceiling.

Read every scope

The reader handles one scope at a time. Read every scope on the mandate, not only the first.

When it refuses

The reader refuses rather than guesses. It throws a ScopeCeilingError whose reason is one of:
Treat a refusal as unreadable, never as unlimited. Refuse the request. errand:search takes an optional max but names no currency, and that max is not enforced (see Scopes). A max written there has no currency to read, so the reader refuses it as missing-denomination. The ceiling that counts is on spend:visa_checkout.