iotoms Docs

Update posting rules

PUT
/api/v1/accounting/posting-rules

Saves posting rules. Each event type you include is fully replaced and must balance; event types you leave out are unchanged.

How to use it

  1. Call Get posting rules and event catalog to see the allowed amount sources and debit/credit sets for each event type.
  2. Pick active, non-group ledger accounts in one currency from List ledger accounts for each line.
  3. Send one rule per event type with at least two lines whose debit and credit sources each match an allowed set, so every entry balances.
  4. Each event type you send is fully replaced, lines included; send active false to switch a rule off. Unbalanced or invalid rules are rejected.

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
rules*array<>

Rules to save, at most one per event type. Must not be empty. Event types you leave out are not changed.

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

The posting rules that were saved by this request, as they now stand.

Example Request
curl -X PUT 'https://beta.iotoms.com/api/v1/accounting/posting-rules' \  -H 'X-TenantID: your-tenant-code' \  -H 'Content-Type: application/json' \  -d '{  "rules": [    {      "eventType": "string",      "active": true,      "lines": [        {          "direction": "DEBIT",          "accountId": "3d07c219-0a88-45be-9cfc-91e9d095a1e9",          "amountSource": "GRAND_TOTAL"        }      ]    }  ]}'
Example Response
{  "status": "string",  "message": "string",  "data": [    {      "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"    }  ]}