Update posting rules
PUT
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
- Call Get posting rules and event catalog to see the allowed amount sources and debit/credit sets for each event type.
- Pick active, non-group ledger accounts in one currency from List ledger accounts for each line.
- 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.
- Each event type you send is fully replaced, lines included; send active false to switch a rule off. Unbalanced or invalid rules are rejected.
BearerAuthheader
AuthorizationBearer <JWT>X-TenantID*stringYour merchant's tenant code — the value typed in the Domain field on the iotoms login screen. See Concepts.
application/json- body
rules*array<>Rules to save, at most one per event type. Must not be empty. Event types you leave out are not changed.
OK
*/*- response
status*stringOutcome of the call: SUCCESS when the request worked, ERROR when it did not.
message*stringShort 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" } ]}