# blue.hearth.tier

> Published by [hearth.blue](https://lexicon.garden/identity/did:web:hearth.blue)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:web:hearth.blue/blue.hearth.tier)
- [Documentation](https://lexicon.garden/lexicon/did:web:hearth.blue/blue.hearth.tier/docs)
- [Examples](https://lexicon.garden/lexicon/did:web:hearth.blue/blue.hearth.tier/examples)

## Definitions

### `blue.hearth.tier`

**Type**: `record`

A subscription tier offered by a creator. Lives in the creator's repository, so the creator is the repo owner and is not repeated as a field. Tiers are tied to the creator's DID rather than to any publication or app.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes | Display name of the tier. |
| `unit` | `string` | Yes | Billing period. Closed set, matching network.attested.payment.recurring exactly. Closed rather than knownValues because an unrecognised unit is not forward-compatible, it is uncomputable: a verifier cannot derive a billing period from a value it does not know, so accepting one would mean writing a tier nothing can price. |
| `amount` | `integer` | Yes | Price per billing period, in the smallest unit of the currency (e.g. cents). Matches network.attested.payment.recurring's amount so no conversion is needed when the payment record is written. |
| `closedAt` | `string` (datetime) | No | When this tier stopped accepting NEW subscriptions. Closing is not deleting: existing entitlements keep referencing this record and must keep resolving, so a tier is never removed once anyone has subscribed to it. |
| `currency` | `string` | Yes | ISO 4217 currency code, e.g. USD. |
| `createdAt` | `string` (datetime) | Yes |  |
| `frequency` | `integer` | No | Multiplier on unit, so unit=monthly with frequency=3 bills every three months. Defaults to 1. Mirrors network.attested.payment.recurring. |
| `description` | `string` | No | What a subscriber gets. Prose, not machine-read. |

## Raw Schema

```json
{
  "id": "blue.hearth.tier",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "name",
          "amount",
          "currency",
          "unit",
          "createdAt"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 640,
            "description": "Display name of the tier.",
            "maxGraphemes": 64
          },
          "unit": {
            "enum": [
              "monthly",
              "quarterly",
              "semiannual",
              "yearly"
            ],
            "type": "string",
            "description": "Billing period. Closed set, matching network.attested.payment.recurring exactly. Closed rather than knownValues because an unrecognised unit is not forward-compatible, it is uncomputable: a verifier cannot derive a billing period from a value it does not know, so accepting one would mean writing a tier nothing can price."
          },
          "amount": {
            "type": "integer",
            "minimum": 1,
            "description": "Price per billing period, in the smallest unit of the currency (e.g. cents). Matches network.attested.payment.recurring's amount so no conversion is needed when the payment record is written."
          },
          "closedAt": {
            "type": "string",
            "format": "datetime",
            "description": "When this tier stopped accepting NEW subscriptions. Closing is not deleting: existing entitlements keep referencing this record and must keep resolving, so a tier is never removed once anyone has subscribed to it."
          },
          "currency": {
            "type": "string",
            "maxLength": 3,
            "minLength": 3,
            "description": "ISO 4217 currency code, e.g. USD."
          },
          "createdAt": {
            "type": "string",
            "format": "datetime"
          },
          "frequency": {
            "type": "integer",
            "default": 1,
            "minimum": 1,
            "description": "Multiplier on unit, so unit=monthly with frequency=3 bills every three months. Defaults to 1. Mirrors network.attested.payment.recurring."
          },
          "description": {
            "type": "string",
            "maxLength": 10000,
            "description": "What a subscriber gets. Prose, not machine-read.",
            "maxGraphemes": 1000
          }
        }
      },
      "description": "A subscription tier offered by a creator. Lives in the creator's repository, so the creator is the repo owner and is not repeated as a field. Tiers are tied to the creator's DID rather than to any publication or app."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
