> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sumvin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Resources and conditions

> What a Stamped Mandate is bound to, who it is addressed to, and the conditions that must hold before a purchase goes ahead.

Scopes say what an agent may do. Resources say what the mandate is bound to, the audience says who it is for, and conditions say what must be true first.

## Resources

A resource is an identifier for one specific thing. A mandate with resources applies to those things only. A mandate with none is bound to nothing beyond its scopes.

| Resource | Shape               | Binds the mandate to                                                                                                                                     |
| -------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Errand   | `sr:us:errand:{id}` | One errand. The mandate can be used for that errand's purchase and no other.                                                                             |
| Mandate  | `sr:us:pint:{id}`   | Another mandate. A smaller mandate drawn from a larger one names the larger one here. See [Narrowing](/concepts/mandates/limits#a-mandate-only-narrows). |
| Person   | `sr:us:person:...`  | Your own account.                                                                                                                                        |

Resource rules:

* Each resource must be a well-formed identifier of a known family. Anything else is refused.
* A resource identifier takes no parameters. A `?` in a resource is refused.
* A scope name is never a resource. `sr:us:pint:spend:visa_checkout` in the resources is refused.
* A condition is never a resource. Conditions have their own place in the mandate.
* Resources are signed exactly as written: the same order, nothing removed or merged.

## Audience

Every mandate is addressed to one party. A mandate addressed to one party is not valid for another.

| Addressed to           | Written as                                                                                   |
| ---------------------- | -------------------------------------------------------------------------------------------- |
| Your own account       | Your account's identifier. This is what a mandate is addressed to when no one else is named. |
| A service Sumvin knows | That service's identifier.                                                                   |
| Any website            | Its bare hostname, in lowercase, such as `reservations.example.com`.                         |

A hostname must be exactly that: lowercase letters, digits, hyphens and dots, with no scheme, port, path or `@`. `https://reservations.example.com/` and `Reservations.example.com` are refused, not tidied up, because two spellings of one site could be read as two different sites.

Naming a website grants it nothing on its own. A mandate addressed to a website by hostname may carry only these scopes:

* `sr:us:pint:sigil:kyc_status`
* `sr:us:pint:sigil:proof_of_personhood`
* `sr:us:pint:sigil:age_over_18`

Anything else, such as spending or reading your data, must be addressed to a party Sumvin knows.

## Conditions

A condition is a fact that must hold before a purchase can go ahead without asking you again. Conditions apply to purchases only. Every condition on a mandate must hold: they combine with AND. There is no OR, and no nesting.

```text theme={null}
sr:us:condition:{type}?{key}={value}&{key}={value}
```

Every condition takes at least one parameter. Each key may appear once, and no value may be empty.

| Type               | Holds when                                           | Parameters                                                                                    |
| ------------------ | ---------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `price_target`     | The best price compares to a target as stated.       | `op`, `value`, `currency` (all required)                                                      |
| `budget_cap`       | The basket total is at most a figure.                | `max`, `currency` (both required)                                                             |
| `availability`     | The offer has one of the listed availability states. | `statuses` (required, comma-separated, such as `in_stock,pre_order`)                          |
| `time_window`      | The purchase happens inside a window.                | `not_before`, `not_after` (at least one; Unix time in **milliseconds**)                       |
| `flight_route`     | The flight runs between two airports.                | `origin`, `destination` (required, IATA codes), `max_stops` (optional; `0` means direct only) |
| `coverage_minimum` | Coverage is at least a percentage.                   | `min_pct` (required, 0 to 100)                                                                |
| `jurisdiction`     | The seller is in one of the listed countries.        | `allowed` (required, comma-separated ISO 3166-1 alpha-2 codes)                                |

`op` on `price_target` is one of:

| `op`  | Means               |
| ----- | ------------------- |
| `lte` | At most the target  |
| `gte` | At least the target |
| `lt`  | Below the target    |
| `gt`  | Above the target    |
| `eq`  | Exactly the target  |

Amounts in conditions are written as plain decimals with no trailing zeros, such as `value=180` or `value=179.5`.

Every condition appears in plain words on the page where you approve the mandate. A condition that can't be described in plain words can't be signed.

```text Example theme={null}
sr:us:condition:price_target?op=lte&value=180&currency=USD
sr:us:condition:jurisdiction?allowed=GB,IE
```

Reads as: "the price is at most 180 USD" and "the seller is in GB, IE".

## Next

<Columns cols={2}>
  <Card title="Limits and narrowing" icon="sliders-horizontal" href="/concepts/mandates/limits">
    Ceilings, units and expiry.
  </Card>

  <Card title="Examples" icon="list-checks" href="/concepts/mandates/examples">
    Resources and conditions in a full mandate.
  </Card>
</Columns>
