# Offer options

Let a person choose one of the options your agent found. Each option gets its own intent token, one approval holds them all, and only the option the person approves can run.

Use options when your agent found more than one way to do the job, such as three flights or two quotes, and the person should pick. You authorize 2 to 5 complete actions at once. Each gets its own intent token, the person sees them as cards and approves one, and only that option's token verifies.

**Before you begin:** export the sandbox account key. Options open an approval in the account's inbox, so they need an account key.

```bash
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
```

1. **Agent authorizes options**: one token per option
2. **Person approves one**: the card they want
3. **Agent verifies its pick**: valid; the others refused

## 1. Authorize the options

Send `options` to [`POST /v1/mandate/intents`](https://provenanceauth.com/docs/api/intent-tokens.md#post-v1-mandate-intents) instead of `action_description`. Each option is a complete action:

| Field | Meaning |
| --- | --- |
| `label` | What the person sees on the card |
| `action` | The option's action description, hashed into its own token |
| `payload` | The option's exact payload, hashed into its own token |
| `context` | Facts for your policy and the card: `transaction_amount`, `currency`, `payee`, `date` |

**curl**

```bash
curl -s $PROVENANCE_API/v1/mandate/intents \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_session_id": "sess_travel_1",
    "device_id": "dev_00000000000000000000000000000001",
    "options": [
      { "label": "6:05 am nonstop", "action": "Book flight NW 412 BOS to SFO on Nov 3", "payload": { "flight": "NW412", "fare": 389 }, "context": { "transaction_amount": 389, "currency": "USD", "date": "2026-11-03" } },
      { "label": "9:40 am nonstop", "action": "Book flight NW 1520 BOS to SFO on Nov 3", "payload": { "flight": "NW1520", "fare": 412 }, "context": { "transaction_amount": 412, "currency": "USD", "date": "2026-11-03" } },
      { "label": "1:15 pm, one stop", "action": "Book flight NW 433 BOS to SFO on Nov 3", "payload": { "flight": "NW433", "fare": 298 }, "context": { "transaction_amount": 298, "currency": "USD", "date": "2026-11-03" } }
    ]
  }' | tee options.json
export APPROVAL_ID=$(jq -r .approval_id options.json)
export PICK_TOKEN=$(jq -r '.options[1].intent_token' options.json)
export OTHER_TOKEN=$(jq -r '.options[0].intent_token' options.json)
```

**Node**

```ts
const flight = (label: string, code: string, fare: number) => ({
  label,
  action: `Book flight NW ${code} BOS to SFO on Nov 3`,
  actionPayload: { flight: `NW${code}`, fare },
  context: { transaction_amount: fare, currency: "USD", date: "2026-11-03" },
});
const offer = await prov.mandate.intents.create({
  agentSessionId: "sess_travel_1",
  deviceId: "dev_00000000000000000000000000000001",
  options: [flight("6:05 am nonstop", "412", 389), flight("9:40 am nonstop", "1520", 412), flight("1:15 pm, one stop", "433", 298)],
});
```

**Python**

```python
def flight(label, code, fare):
    return {
        "label": label,
        "action": f"Book flight NW {code} BOS to SFO on Nov 3",
        "payload": {"flight": f"NW{code}", "fare": fare},
        "context": {"transaction_amount": fare, "currency": "USD", "date": "2026-11-03"},
    }

offer = prov.mandate.intents.create(
    agent_session_id="sess_travel_1",
    device_id="dev_00000000000000000000000000000001",
    options=[flight("6:05 am nonstop", "412", 389), flight("9:40 am nonstop", "1520", 412), flight("1:15 pm, one stop", "433", 298)],
)
```

```json
{
  "object": "intent_authorization",
  "status": "approval_pending",
  "option_group_id": "optg_01M5WK3T8Q2R6V9X1Z4B7D0F3H",
  "approval_id": "appr_01M5WK3T8R5T8W1Y3A6C9E2G5J",
  "approval_expires_at": "2026-10-26T18:10:00.000Z",
  "expires_at": "2026-10-26T22:00:00.000Z",
  "biometric_bound": false,
  "options": [
    { "index": 0, "label": "6:05 am nonstop", "intent_token": "eyJhbGciOiJFUzI1NiJ9.eyJqdGkiOiIwIn0.c2ln", "attestation_id": "5f0c1e2a-7b3d-4c8e-9a1f-2d4b6e8f0a13" },
    { "index": 1, "label": "9:40 am nonstop", "intent_token": "eyJhbGciOiJFUzI1NiJ9.eyJqdGkiOiIxIn0.c2ln", "attestation_id": "9a3e5c7b-1d2f-4e6a-8c0b-3f5d7e9a1c24" },
    { "index": 2, "label": "1:15 pm, one stop", "intent_token": "eyJhbGciOiJFUzI1NiJ9.eyJqdGkiOiIyIn0.c2ln", "attestation_id": "2b4d6f8a-0c1e-4a3b-9d5f-7e9a1c3b5d36" }
  ]
}
```

Every token carries the same `option_group_id` and its own `jti` and `action_hash`. One approval holds the group, and the person is asked now, before the agent acts.

The account's policy runs on each option. An option it denies outright comes back with `disabled: true` and its `disabled_reason`, and the person sees it greyed out.

## 2. The person approves one

The person sees one lettered card per option, with its label, the key facts and the exact action, and **Approve this one** on each. **None of these** declines every option. With a passkey rule, the assertion signs sha256 of the group and the chosen option's `action_hash`, so the passkey signs the choice itself.

Here you approve the second option with the key, through [`POST /v1/mandate/approvals/{id}/respond`](https://provenanceauth.com/docs/api/approvals.md#post-v1-mandate-approvals-id-respond):

**curl**

```bash
curl -s $PROVENANCE_API/v1/mandate/approvals/$APPROVAL_ID/respond \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "decision": "approve", "option_index": 1 }'
```

**Node**

```ts
await prov.mandate.approvals.respond(offer.approvalId, { decision: "approve", optionIndex: 1 });
```

**Python**

```python
prov.mandate.approvals.respond(offer["approval_id"], decision="approve", option_index=1)
```

```json
{
  "id": "appr_01M5WK3T8R5T8W1Y3A6C9E2G5J",
  "object": "approval",
  "status": "approved",
  "action_description": "Choose one: 6:05 am nonstop · 9:40 am nonstop · 1:15 pm, one stop",
  "option_group_id": "optg_01M5WK3T8Q2R6V9X1Z4B7D0F3H",
  "chosen_option": { "index": 1 }
}
```

Once the group is decided, nothing switches the choice: approving another option answers `409 approval_already_decided`.

## 3. Verify the chosen option

Verify the chosen option's token with its own action and payload. It's valid:

**curl**

```bash
curl -s $PROVENANCE_API/v1/mandate/assessments \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "intent_token": "'"$PICK_TOKEN"'",
    "action_description": "Book flight NW 1520 BOS to SFO on Nov 3",
    "action_payload": { "flight": "NW1520", "fare": 412 },
    "context": { "transaction_amount": 412 }
  }'
```

**Node**

```ts
const pick = offer.options[1]!;
const result = await prov.mandate.assessments.create({
  intentToken: pick.intentToken,
  actionDescription: "Book flight NW 1520 BOS to SFO on Nov 3",
  actionPayload: { flight: "NW1520", fare: 412 },
  context: { transactionAmount: 412 },
});
```

**Python**

```python
result = prov.mandate.assessments.create(
    intent_token=offer["options"][1]["intent_token"],
    action_description="Book flight NW 1520 BOS to SFO on Nov 3",
    action_payload={"flight": "NW1520", "fare": 412},
    context={"transaction_amount": 412},
)
```

```json
{
  "object": "mandate_assessment",
  "valid": true,
  "payload_bound": true
}
```

## 4. Other options are refused

Every other option's token fails with `option_not_chosen`, and `chosen_option` names the one the person picked:

**curl**

```bash
curl -s $PROVENANCE_API/v1/mandate/assessments \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "intent_token": "'"$OTHER_TOKEN"'",
    "action_description": "Book flight NW 412 BOS to SFO on Nov 3",
    "action_payload": { "flight": "NW412", "fare": 389 },
    "context": { "transaction_amount": 389 }
  }'
```

**Node**

```ts
const other = await prov.mandate.assessments.create({
  intentToken: offer.options[0]!.intentToken,
  actionDescription: "Book flight NW 412 BOS to SFO on Nov 3",
  actionPayload: { flight: "NW412", fare: 389 },
  context: { transactionAmount: 389 },
});
```

**Python**

```python
other = prov.mandate.assessments.create(
    intent_token=offer["options"][0]["intent_token"],
    action_description="Book flight NW 412 BOS to SFO on Nov 3",
    action_payload={"flight": "NW412", "fare": 389},
    context={"transaction_amount": 389},
)
```

```json
{
  "object": "mandate_assessment",
  "valid": false,
  "reason": "option_not_chosen",
  "option_group_id": "optg_01M5WK3T8Q2R6V9X1Z4B7D0F3H",
  "chosen_option": { "index": 1 }
}
```

The `mandate.approval.approved` webhook carries the pick as `chosen_option: { index, jti }`, so your server knows which token to run without polling.

## Use options in a policy

Verify on an option token adds two facts your rules can read:

| Fact | Value |
| --- | --- |
| `approval.option_count` | How many options the person chose from |
| `approval.chosen_option` | The index of the option they approved |

## Errors you might see

| Code | Status | What to do |
| --- | --- | --- |
| `parameter_invalid` | 400 | Send 2 to 5 options with distinct labels, and no `action_description`, `action_payload`, `approval` or `mandate_token` beside them. On respond, send `option_index` with `approve` only. |
| `approval_already_decided` | 409 | The group was decided; read it with `GET /v1/mandate/approvals/{id}` instead. |
| `option_not_chosen` | 200 | A verify reason, not an error: run only the chosen option. |

## See also

- [Ask a person to approve](https://provenanceauth.com/docs/mandate/guides/step-up-approval.md)
- [Handle a change request](https://provenanceauth.com/docs/mandate/guides/change-requests.md)
- [Policies](https://provenanceauth.com/docs/concepts/policies.md)
