Skip to content

Period programs: close, lock, recognize

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

Reference for Period, one group of Period programs.

Period.close

Close ends a month’s books once every Entry in the Period is reconciled, and makes its statements final. Verb page.

Text
do: return await $.Period.close(input)

Emits Period.closed.

Inputs

InputTypeRequiredDescription
periodPeriodrequiredThe open Period.

Returns

OutputTypeRequiredDescription
periodPeriodrequiredThe closed Period.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse 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.refusedRead 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.

Text
do: return await $.Period.lock(input)

Emits Period.locked.

Inputs

InputTypeRequiredDescription
periodPeriodrequiredThe closed Period.

Returns

OutputTypeRequiredDescription
periodPeriodrequiredThe locked Period.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse 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.refusedRead 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.

Text
do: return await $.Period.recognize(input)

Emits Period.recognized.

Inputs

InputTypeRequiredDescription
periodPeriodrequiredThe open Period to recognize.

Returns

OutputTypeRequiredDescription
entrieslist of EntryrequiredThe recognition Entries it posted.
periodPeriodrequiredThe Period whose revenue was recognized.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse 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' })"
  }
}