Skip to content

Entitlement.check

POST /{namespace}/entitlements/check

Check says whether a Customer may call a Verb now, how much of its Limit remains, when that resets, and which Offer lifts it.

Mode
do
Event
Entitlement.checked

Inputs

InputTypeRequiredDescription
customerCustomerrequiredThe Customer making the call.
verbVerbrequiredThe Verb it wants to call, as Noun.verb.
amountintegerHow many units the call would use. Defaults to 1.

Outputs

OutputTypeRequiredDescription
allowedbooleanrequiredTrue when an Entitlement grants the call and its Limit has room for amount.
entitlementEntitlementThe Entitlement that grants the Verb, when one does.
remainingintegerUnits left in the current period; absent for a feature Entitlement.
resetsAtdatetimeWhen the period resets; absent when the Limit never resets.
upgradeOfferThe Offer that lifts the bound, when its Offer’s atBound is upgrade.

Effects

  • Emits Entitlement.checked.
  • Two-way: it runs at once, in the try, send and do modes.
  • Changes nothing and never refuses: past the bound it answers allowed: false, and the Verb it guards then replies 402 payment-required, unless atBound is overage.

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.Entitlement.check

When it waits

GateDefault
Decision classLow: two-way, nothing at stake
Delay windowNone: it runs once review passes.
LimitThe call Limit of the Permission it runs under.
Over the LimitIt waits pending for an Approval from the Founder. Approved, it runs; refused, it ends refused with limit-exceeded; unanswered by its deadline, it ends canceled.