iotoms Docs

Create default posting rules

POST
/api/v1/accounting/posting-rules/seed-defaults

Creates the standard posting rules against the default chart of accounts. Safe to repeat: existing rules and missing accounts are skipped.

How to use it

  1. Make sure the standard chart of accounts exists (check List ledger accounts); rules whose accounts are missing are skipped.
  2. Call this once; event types that already have a rule are left as they are, so repeating it is safe.
  3. Check createdCount and skippedCount, then review the result with Get posting rules and event catalog and adjust with Update posting rules.

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.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request worked, ERROR when it did not.

message*string

Short human-readable message describing the result, for logs or display; do not parse it.

data?

How many default rules were created or skipped, and the resulting rules.

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/accounting/posting-rules/seed-defaults' \  -H 'X-TenantID: your-tenant-code'
Example Response
{  "status": "string",  "message": "string",  "data": {    "createdCount": 0,    "skippedCount": 0,    "rules": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "eventType": "string",        "name": "string",        "active": true,        "lines": [          {            "direction": "DEBIT",            "accountId": "3d07c219-0a88-45be-9cfc-91e9d095a1e9",            "accountCode": "string",            "accountName": "string",            "amountSource": "GRAND_TOTAL"          }        ],        "createdAt": "2019-08-24T14:15:22Z",        "updatedAt": "2019-08-24T14:15:22Z"      }    ]  }}