---
title: LineItem
description: "One phase's one billing line: what was consumed, and what that costs."
---

One phase's one billing line: what was consumed, and what that costs.

## Accessors

### amount

#### Get Signature

```ts
get amount(): Amount;
```

##### Returns

[`Amount`](/microvms-agentd/reference/typescript/classes/amount/)

***

### displayQuantity

#### Get Signature

```ts
get displayQuantity(): string;
```

The quantity at display precision, for a column a human scans.

##### Returns

`string`

***

### duration

#### Get Signature

```ts
get duration(): Duration | null;
```

##### Returns

[`Duration`](/microvms-agentd/reference/typescript/classes/duration/) | `null`

***

### line

#### Get Signature

```ts
get line(): string | null;
```

The AWS billing line, or `null` for a phase with no published rate to attribute it
to.

##### Returns

`string` | `null`

***

### note

#### Get Signature

```ts
get note(): string;
```

##### Returns

`string`

***

### phase

#### Get Signature

```ts
get phase(): string;
```

##### Returns

`string`

***

### quantity

#### Get Signature

```ts
get quantity(): string;
```

The consumed quantity, exact, as a string.

Exact so a reader can check the arithmetic against the rate table, which is the only
defence against a rate that drifts without anyone noticing.

##### Returns

`string`

***

### unit

#### Get Signature

```ts
get unit(): string;
```

##### Returns

`string`

## Methods

### toJson()

```ts
toJson(): string;
```

Core's JSON shape for a line item, as a JSON **string**.

A string rather than an object because the unpriced case must **omit** the `usd` key
entirely, and a `#[napi(object)]` return type cannot express an absent key — an
`Option` field serializes as `null`, which is the one value that gets summed as zero
by anything permissive. A caller does `JSON.parse`, which is one visible step.

#### Returns

`string`

***

### toString()

```ts
toString(): string;
```

#### Returns

`string`

## Provenance

This page is generated from `bindings/microvms-js/index.d.ts` by TypeDoc 0.28.20 and typedoc-plugin-markdown 4.13.1, run from `site/scripts/gen-reference.mjs` on every `pnpm run sync`, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding's Rust source, then regenerate the declarations with `mise run dts`. `mise run dts:check` fails when the committed file no longer matches the source.