# Budget

> B2B spending allowance with lifecycle, usage, reset period, and validity

A **Budget** is a spending allowance granted to a cost center, employee, or business unit and drawn down as orders are placed.

**Since v0.26.0** in `@laioutr-core/canonical-types`.

**Entity: Budget**

Components: status, allowance, base, info, validity

Links:

- b2b/budget/cost-centers → CostCenter (multi)

## Components

### Base

Budget identity, code, source identifier, and custom fields.

### BudgetBase `base`

```ts
import { BudgetBase } from '@laioutr-core/canonical-types/entity/budget';
```

#### Schema

```json
{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"name":{"description":"Human-readable display name, e.g. \"Marketing 2026\".","type":"string"},"code":{"description":"Human/ERP identifier distinct from the internal id, e.g. \"BUD-2026-01\".","type":"string"},"externalId":{"description":"Identifier of this budget in the source system it was imported from.","type":"string"},"customFields":{"allOf":[{"$ref":"#/definitions/CustomFields"}]}},"required":["name"],"additionalProperties":false,"id":"entity:Budget:base","definitions":{"CustomFields":{"description":"Custom fields are a way for implementations to pass arbitrary data to actions, queries, etc.","title":"CustomFields","id":"CustomFields","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}
```

### Status

Whether the budget is active or inactive.

### BudgetStatus `status`

```ts
import { BudgetStatus } from '@laioutr-core/canonical-types/entity/budget';
```

#### Schema

```json
{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"status":{"description":"The status value set — shared with the `b2b/organization/budget-*` actions so the vocabulary has a single source.","type":"string","enum":["active","inactive"]}},"required":["status"],"additionalProperties":false,"id":"entity:Budget:status"}
```

### Info

Short summary fields for budget lists.

### BudgetInfo `info`

```ts
import { BudgetInfo } from '@laioutr-core/canonical-types/entity/budget';
```

#### Schema

```json
{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"description":{"description":"Short plain-text description shown as a list subtitle. Not HTML.","type":"string"}},"additionalProperties":false,"id":"entity:Budget:info"}
```

### Allowance

Spending limit, amount spent, reset period, and notification threshold.

### BudgetAllowance `allowance`

```ts
import { BudgetAllowance } from '@laioutr-core/canonical-types/entity/budget';
```

#### Schema

```json
{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"limit":{"$ref":"#/definitions/Money"},"period":{"type":"string"},"periodLabel":{"description":"Connector-resolved display label for `period` — the fallback shown when the period key is not mapped to a localized label.","type":"string"},"spent":{"allOf":[{"$ref":"#/definitions/Money"}]},"notificationThreshold":{"description":"Notify the responsible party once consumption reaches this percentage of `limit` (0–100), when the source supports spend alerts (B2B Sellers `notificationPercentage`).","type":"number"}},"required":["limit"],"additionalProperties":false,"id":"entity:Budget:allowance","definitions":{"Money":{"description":"A Money object describes a monetary value. You can use e.g. `@screeny05/ts-money` to create and manipulate Money objects more elegantly.","title":"Money","id":"Money","type":"object","properties":{"amount":{"description":"Amount in smallest unit of currency. E.g. cents, pence, etc.","type":"number"},"currency":{"description":"ISO 4217 currency code. E.g. 'USD', 'EUR', 'GBP', etc.","type":"string"}},"required":["amount","currency"],"additionalProperties":false}}}
```

### Validity

Optional absolute validity window, separate from the recurring allowance period.

### BudgetValidity `validity`

```ts
import { BudgetValidity } from '@laioutr-core/canonical-types/entity/budget';
```

#### Schema

```json
{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"validity":{"$ref":"#/definitions/Timespan"}},"required":["validity"],"additionalProperties":false,"id":"entity:Budget:validity","definitions":{"Timespan":{"description":"A timespan between two dates.","title":"Timespan","id":"Timespan","anyOf":[{"type":"object","properties":{"min":{"type":"string","format":"date-time"},"granularity":{"$ref":"#/definitions/__schema0"}},"required":["min"],"additionalProperties":false},{"type":"object","properties":{"max":{"type":"string","format":"date-time"},"granularity":{"$ref":"#/definitions/__schema0"}},"required":["max"],"additionalProperties":false},{"type":"object","properties":{"min":{"type":"string","format":"date-time"},"max":{"type":"string","format":"date-time"},"granularity":{"$ref":"#/definitions/__schema0"}},"required":["min","max"],"additionalProperties":false}]},"__schema0":{"type":"string","enum":["date","datetime"]}}}
```

## Links

- **BudgetCostCenters** → [CostCenter](/frontend/api-reference/entities/cost-center) `multi` — Resolves cost centers that draw against the budget.
