TripleBooks
Ledger

Periods

GET
/api/ledger/periods

List periods for an entity/book. Auto-generates monthly or quarterly periods if none exist.

Authorization

bearerAuth
AuthorizationBearer <token>

Create keys under Settings → API keys. Prefix ak_. Send as Authorization: Bearer ak_....

In: header

Query Parameters

entityId*string
Formatuuid
bookId*string
Formatuuid

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/ledger/periods?entityId=497f6eca-6276-4993-bfeb-53cbbbba6f08&bookId=497f6eca-6276-4993-bfeb-53cbbbba6f08"
[  {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "entityId": "156e622c-6cdf-4c27-9bc9-2f2db69919f5",    "bookId": "710266f4-0087-48f9-97e1-4b13ac48f353",    "name": "string",    "startDate": "2019-08-24",    "endDate": "2019-08-24",    "status": "OPEN",    "closedAt": "2019-08-24T14:15:22Z"  }]
{  "error": "string"}
{  "error": "string"}
POST
/api/ledger/periods/close

Soft-close or hard-close a period. Requires all prior periods to be closed. Computes and stores a balance snapshot.

Authorization

bearerAuth
AuthorizationBearer <token>

Create keys under Settings → API keys. Prefix ak_. Send as Authorization: Bearer ak_....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/api/ledger/periods/close" \  -H "Content-Type: application/json" \  -d '{    "periodId": "7cc85576-6d6b-4609-a8e6-020187b27a09",    "action": "SOFT_CLOSE"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "entityId": "156e622c-6cdf-4c27-9bc9-2f2db69919f5",  "bookId": "710266f4-0087-48f9-97e1-4b13ac48f353",  "name": "string",  "startDate": "2019-08-24",  "endDate": "2019-08-24",  "status": "OPEN",  "closedAt": "2019-08-24T14:15:22Z"}
{  "error": "string"}
{  "error": "string"}
POST
/api/ledger/periods/reopen

Hard-closed periods cannot be reopened.

Authorization

bearerAuth
AuthorizationBearer <token>

Create keys under Settings → API keys. Prefix ak_. Send as Authorization: Bearer ak_....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/api/ledger/periods/reopen" \  -H "Content-Type: application/json" \  -d '{    "periodId": "7cc85576-6d6b-4609-a8e6-020187b27a09"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "entityId": "156e622c-6cdf-4c27-9bc9-2f2db69919f5",  "bookId": "710266f4-0087-48f9-97e1-4b13ac48f353",  "name": "string",  "startDate": "2019-08-24",  "endDate": "2019-08-24",  "status": "OPEN",  "closedAt": "2019-08-24T14:15:22Z"}
{  "error": "string"}
{  "error": "string"}
GET
/api/ledger/periods/snapshot

Authorization

bearerAuth
AuthorizationBearer <token>

Create keys under Settings → API keys. Prefix ak_. Send as Authorization: Bearer ak_....

In: header

Query Parameters

periodId*string
Formatuuid

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/ledger/periods/snapshot?periodId=497f6eca-6276-4993-bfeb-53cbbbba6f08"
[  {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "periodId": "7cc85576-6d6b-4609-a8e6-020187b27a09",    "version": 0,    "snapshotHash": "string",    "balances": {},    "createdAt": "2019-08-24T14:15:22Z"  }]
{  "error": "string"}
{  "error": "string"}

On this page