# Period programs: close, lock, recognize

URL: /code/mcp/period/verbs · Id: `page:code/mcp/period/verbs`

> The Period Verbs close, lock, recognize as MCP do programs, with inputs, result, refusals and an example.

Reference for [Period](/business/nouns/period), one group of [Period programs](/code/mcp/period).

### Period.close
Close ends a month’s books once every Entry in the Period is reconciled, and makes its statements final. [Verb page](/business/nouns/period/close?interface=mcp).

```text
do: return await $.Period.close(input)
```

Emits [`Period.closed`](/business/events/Period.closed).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `period` | [Period](/business/nouns/period) | Yes | The open Period. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `period` | [Period](/business/nouns/period) | Yes | The closed Period. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | [`refused`](/code/api/errors/refused) | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |

**Example**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Period.close({ period: 'period_VEVuYACTsH' })"
  }
}
```

### Period.lock
Lock seals a closed Period, so any later correction posts to the next open Period. [Verb page](/business/nouns/period/lock?interface=mcp).

```text
do: return await $.Period.lock(input)
```

Emits [`Period.locked`](/business/events/Period.locked).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `period` | [Period](/business/nouns/period) | Yes | The closed Period. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `period` | [Period](/business/nouns/period) | Yes | The locked Period. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | [`refused`](/code/api/errors/refused) | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |

**Example**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Period.lock({ period: 'period_VEVuYACTsH' })"
  }
}
```

### Period.recognize
Recognize moves the revenue a Period earned out of deferred revenue, by the Startup’s revenue-recognition Policy. [Verb page](/business/nouns/period/recognize?interface=mcp).

```text
do: return await $.Period.recognize(input)
```

Emits [`Period.recognized`](/business/events/Period.recognized).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `period` | [Period](/business/nouns/period) | Yes | The open Period to recognize. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `entries` | list of [Entry](/business/nouns/entry) | Yes | The recognition Entries it posted. |
| `period` | [Period](/business/nouns/period) | Yes | The Period whose revenue was recognized. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Period.recognize({ period: 'period_VEVuYACTsH' })"
  }
}
```