# am.noz.at.spl.expense

> Published by [noz.am](https://lexicon.garden/identity/did:plc:lmkzmvv6sdxntwtyxpg7fqqq)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:lmkzmvv6sdxntwtyxpg7fqqq/am.noz.at.spl.expense)
- [Documentation](https://lexicon.garden/lexicon/did:plc:lmkzmvv6sdxntwtyxpg7fqqq/am.noz.at.spl.expense/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:lmkzmvv6sdxntwtyxpg7fqqq/am.noz.at.spl.expense/examples)

## Definitions

### `am.noz.at.spl.expense`

**Type**: `record`

An immutable expense revision header. Items are stored in am.noz.at.spl.item records with the same expenseId and revisionId.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `base` | `ref` → `lex:am.noz.at.spl.expense#recordRef` | No | The effective revision this revision was based on. |
| `notes` | `string` | No |  |
| `paidBy` | `array` | Yes |  |
| `voided` | `boolean` | Yes | A voiding revision replaces destructive deletion in normal application flows. |
| `groupId` | `string` | No | Optional organizational group or trip within the ledger Space. Omitted for ungrouped expenses. |
| `receipt` | `blob` | No |  |
| `category` | `string` | No |  |
| `currency` | `string` | Yes | Uppercase ISO 4217 currency code. |
| `merchant` | `string` | No |  |
| `createdAt` | `string` (datetime) | Yes |  |
| `expenseId` | `string` | Yes | Stable application identifier shared by every revision. |
| `itemCount` | `integer` | Yes |  |
| `minorUnit` | `integer` | Yes |  |
| `occurredAt` | `string` (datetime) | Yes |  |
| `receiptAlt` | `string` | No |  |
| `revisionId` | `string` | Yes |  |
| `totalMinor` | `integer` | Yes | Exact total in currency minor units; never a floating-point amount. |
| `description` | `string` | Yes |  |
| `schemaVersion` | `integer` | Yes |  |
| `recurringSource` | `string` (at-uri) | No |  |

### `am.noz.at.spl.expense#recordRef`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | Yes |  |
| `uri` | `string` (at-uri) | Yes |  |

### `am.noz.at.spl.expense#moneyAllocation`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `amountMinor` | `integer` | Yes |  |

## Raw Schema

```json
{
  "id": "am.noz.at.spl.expense",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "schemaVersion",
          "expenseId",
          "revisionId",
          "description",
          "occurredAt",
          "createdAt",
          "currency",
          "minorUnit",
          "totalMinor",
          "paidBy",
          "itemCount",
          "voided"
        ],
        "properties": {
          "base": {
            "ref": "lex:am.noz.at.spl.expense#recordRef",
            "type": "ref",
            "description": "The effective revision this revision was based on."
          },
          "notes": {
            "type": "string",
            "maxLength": 4000,
            "maxGraphemes": 1000
          },
          "paidBy": {
            "type": "array",
            "items": {
              "ref": "lex:am.noz.at.spl.expense#moneyAllocation",
              "type": "ref"
            },
            "maxLength": 250,
            "minLength": 1
          },
          "voided": {
            "type": "boolean",
            "description": "A voiding revision replaces destructive deletion in normal application flows."
          },
          "groupId": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "description": "Optional organizational group or trip within the ledger Space. Omitted for ungrouped expenses."
          },
          "receipt": {
            "type": "blob",
            "accept": [
              "image/jpeg",
              "image/png",
              "image/webp",
              "application/pdf"
            ],
            "maxSize": 10000000
          },
          "category": {
            "type": "string",
            "maxLength": 64,
            "knownValues": [
              "food",
              "transport",
              "accommodation",
              "entertainment",
              "groceries",
              "utilities",
              "shopping",
              "other"
            ]
          },
          "currency": {
            "type": "string",
            "maxLength": 3,
            "minLength": 3,
            "description": "Uppercase ISO 4217 currency code."
          },
          "merchant": {
            "type": "string",
            "maxLength": 500,
            "maxGraphemes": 120
          },
          "createdAt": {
            "type": "string",
            "format": "datetime"
          },
          "expenseId": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "description": "Stable application identifier shared by every revision."
          },
          "itemCount": {
            "type": "integer",
            "maximum": 500,
            "minimum": 1
          },
          "minorUnit": {
            "type": "integer",
            "maximum": 4,
            "minimum": 0
          },
          "occurredAt": {
            "type": "string",
            "format": "datetime"
          },
          "receiptAlt": {
            "type": "string",
            "maxLength": 2000,
            "maxGraphemes": 300
          },
          "revisionId": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1
          },
          "totalMinor": {
            "type": "integer",
            "minimum": 1,
            "description": "Exact total in currency minor units; never a floating-point amount."
          },
          "description": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 1,
            "maxGraphemes": 200
          },
          "schemaVersion": {
            "type": "integer",
            "const": 1
          },
          "recurringSource": {
            "type": "string",
            "format": "at-uri"
          }
        }
      },
      "description": "An immutable expense revision header. Items are stored in am.noz.at.spl.item records with the same expenseId and revisionId."
    },
    "recordRef": {
      "type": "object",
      "required": [
        "uri",
        "cid"
      ],
      "properties": {
        "cid": {
          "type": "string",
          "format": "cid"
        },
        "uri": {
          "type": "string",
          "format": "at-uri"
        }
      }
    },
    "moneyAllocation": {
      "type": "object",
      "required": [
        "did",
        "amountMinor"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did"
        },
        "amountMinor": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
