iotoms Docs

Generate accounting periods for a year

POST
/api/v1/accounting/periods

Creates 12 monthly accounting periods for a fiscal year starting at startMonth. Idempotent: if the year already has periods, they are returned unchanged. Fails if a new period would overlap an existing one.

How to use it

  1. Send the fiscalYear and the startMonth the fiscal year begins in (1-12).
  2. Twelve monthly OPEN periods are created and returned; if the year already has periods they are returned unchanged.
  3. Journal entries can now be posted for dates in those months; the call fails if a month would overlap an existing period.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Header Parameters

X-TenantID*string

Your merchant's tenant code — the value typed in the Domain field on the iotoms login screen. See Concepts.

Request Body

application/json
  1. body
fiscalYear*integer

Fiscal year to create periods for, between 1970 and 2999. The first period starts in this calendar year.

Formatint32
startMonth*integer

Calendar month the fiscal year starts in, 1 (January) to 12 (December). Defaults to 1.

Formatint32

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request was processed; otherwise an error status.

message*string

Short human-readable message describing the outcome, e.g. which record was saved or why the call failed.

data?array<>|

The accounting periods, each with its dates and open or closed status.

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/accounting/periods' \  -H 'X-TenantID: your-tenant-code' \  -H 'Content-Type: application/json' \  -d '{  "fiscalYear": 0,  "startMonth": 0}'
Example Response
{  "status": "string",  "message": "string",  "data": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "fiscalYear": 0,      "name": "string",      "startDate": "2019-08-24",      "endDate": "2019-08-24",      "status": "OPEN"    }  ]}