iotoms Docs

Create the default chart of accounts

POST
/api/v1/accounting/accounts/seed-defaults

Creates a standard retail chart of accounts, with an optional currency. Idempotent: accounts that already exist are left alone, and the response says how many were created.

How to use it

  1. Optionally send a currency code; otherwise the merchant's configured currency is used.
  2. Call once when setting up accounting; it adds the standard groups and accounts such as Cash, Bank, Accounts Receivable and Sales Revenue.
  3. Accounts whose code already exists are skipped, so it is safe to run again; check createdCount and skippedCount.

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
currency?|

Three-letter ISO currency code for the new accounts. Defaults to the merchant's configured currency.

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?

How many default accounts were created or already existed, plus the default accounts themselves.

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/accounting/accounts/seed-defaults' \  -H 'X-TenantID: your-tenant-code' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "createdCount": 0,    "skippedCount": 0,    "accounts": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "code": "string",        "name": "string",        "type": "ASSET",        "reportGroup": "DIRECT_INCOME",        "parentId": "70850378-7d3c-4f45-91b7-942d4dfbbd43",        "currency": "string",        "isGroup": true,        "isControl": true,        "active": true,        "createdAt": "2019-08-24T14:15:22Z",        "updatedAt": "2019-08-24T14:15:22Z"      }    ]  }}