# Check what a customer can do

URL: /products/offers/check-what-a-customer-can-do · Id: `guide:check-what-a-customer-can-do`

> Ask "can this customer export right now" and get yes or no, what is left of the Limit, when it resets, and which Offer lifts it.

[`Entitlement.check`](/business/nouns/entitlement/check) answers before your code or agent acts, and changes nothing. [Checking access](/products/offers/checking-access) explains the checks that run without it.

Needs: [Lock a feature to a plan](/products/offers/lock-a-feature-to-a-plan)

**Before it runs**

- You leave the chat: Never: it all happens in the chat.

## What you get
- 1 yes or no for the action, right now (Entitlement)
- 1 units left in the current period, and when it resets (Limit)
- 1 plan that lifts the cap, when an upgrade would help (Offer)

## Your agent does
**For agents**

- Guide: `guide:check-what-a-customer-can-do`, status `live`. Page: [/products/offers/check-what-a-customer-can-do.md](/products/offers/check-what-a-customer-can-do.md).
- Approval: none. Run it when the founder asks.
- Leaves the chat: never.
- Needs first: [Lock a feature to a plan](/products/offers/lock-a-feature-to-a-plan).
- Run: call the steps in order, each through the API, SDK, CLI or MCP tab below; a later step passes the `$id` an earlier one returns. Each value marked example is the sample business’s: pass the founder’s own.

| Step | Verb | Inputs (type, required, this guide’s value) | Returns |
| --- | --- | --- | --- |
| 1 | [`Entitlement.check`](/business/nouns/entitlement/check) (`verb:Entitlement.check`) | `customer` Customer (an id), required: example `"customer_riverside"`; `verb` Verb (an id), required: example `"Collection.export"` | `allowed` boolean, `entitlement` Entitlement, `remaining` integer, `resetsAt` datetime, `upgrade` Offer |

Returns: the last call answers with `allowed`, `entitlement`, `remaining`, `resetsAt`, `upgrade` and its `action`, whose `status` is `done`, `pending` (waiting on an Approval or a Worker), `failed`, `canceled` or `refused`:

```json
{
  "api": "https://api.sb/leaseline.app",
  "allowed": true,
  "entitlement": {
    "$id": "https://api.sb/leaseline.app/entitlements/entitlement_1",
    "$type": "Entitlement",
    "verb": "Collection.export"
  },
  "remaining": 1,
  "resetsAt": "2026-10-22T12:00:00Z",
  "upgrade": {
    "$id": "https://api.sb/leaseline.app/offers/offer_1",
    "$type": "Offer"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/action_1",
    "operation": "Entitlement.check",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/action_1"
  }
}
```

Next: offer “Show the reset time next to the export button”, or “Warn me when a customer hits the cap three days running”.

Calls: `Entitlement.check`

Ask:

```text
Can Riverside Property export right now?
How many exports does this customer have left today?
Check this customer’s plan before the call.
```

API:

```bash
# Entitlement.check
curl -X POST https://api.sb/leaseline.app/entitlements/check \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customer":"customer_riverside","verb":"Collection.export"}'
```

SDK:

```ts
import { $ } from 'startup-builder'

await $.Entitlement.check({ customer: 'customer_riverside', verb: 'Collection.export' })
```

CLI:

```bash
npx startup-builder do Entitlement.check --json '{"customer":"customer_riverside","verb":"Collection.export"}'
```

MCP:

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Entitlement.check({ customer: 'customer_riverside', verb: 'Collection.export' })"
  }
}
```

## Change it
- Show the reset time next to the export button.
- Warn me when a customer hits the cap three days running.

## Under the hood
- Systems: [Billing](/systems/billing)
- Nouns: [Entitlement](/business/nouns/entitlement), [Limit](/business/nouns/limit), [Offer](/business/nouns/offer), [Customer](/business/nouns/customer)
- Events: [`Entitlement.checked`](/business/events/Entitlement.checked)