Period routes: close, lock, recognize
The Period Verbs close, lock, recognize as api.sb routes, with inputs, result, refusals and an example.
Reference for Period, one group of Period routes.
Period.close
Close ends a month’s books once every Entry in the Period is reconciled, and makes its statements final. Verb page.
POST /{namespace}/ periods/ {period}/ closePath: period. Emits Period.closed.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
period | Period | required | The open Period. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
period | Period | required | The closed Period. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | 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 | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |
Example
curl -X POST https: //api.sb/ leaseline.app/ periods/ period_VEVuYACTsH/ close \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"api": "https: //api.sb/ leaseline.app",
"period": {
"$id": "https: //api.sb/ leaseline.app/ periods/ period_VEVuYACTsH",
"$type": "Period",
"month": "2026-10-22",
"status": "Closed"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Period.close",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}Period.lock
Lock seals a closed Period, so any later correction posts to the next open Period. Verb page.
POST /{namespace}/ periods/ {period}/ lockPath: period. Emits Period.locked.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
period | Period | required | The closed Period. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
period | Period | required | The locked Period. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | 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 | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |
Example
curl -X POST https: //api.sb/ leaseline.app/ periods/ period_VEVuYACTsH/ lock \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"api": "https: //api.sb/ leaseline.app",
"period": {
"$id": "https: //api.sb/ leaseline.app/ periods/ period_VEVuYACTsH",
"$type": "Period",
"month": "2026-10-22",
"status": "Locked"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Period.lock",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}Period.recognize
Recognize moves the revenue a Period earned out of deferred revenue, by the Startup’s revenue-recognition Policy. Verb page.
POST /{namespace}/ periods/ {period}/ recognizePath: period. Emits Period.recognized.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
period | Period | required | The open Period to recognize. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
entries | list of Entry | required | The recognition Entries it posted. |
period | Period | required | 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 | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X POST https: //api.sb/ leaseline.app/ periods/ period_VEVuYACTsH/ recognize \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"api": "https: //api.sb/ leaseline.app",
"entries": [
{
"$id": "https: //api.sb/ leaseline.app/ entries/ entry_syZbJCW683",
"$type": "Entry",
"account": "cash",
"amount": {
"amount": 29,
"currency": "USD"
},
"direction": "debit",
"startup": "startup_l3hr1EnUGY"
}
],
"period": {
"$id": "https: //api.sb/ leaseline.app/ periods/ period_VEVuYACTsH",
"$type": "Period",
"month": "2026-10-22",
"status": "Open"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Period.recognize",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}