iotoms Docs

Update a ledger account

PUT
/api/v1/accounting/accounts/{id}

Changes a ledger account's name, parent group, active flag or report group. Its code, account type and currency cannot be changed after creation, and reclassifying does not affect child accounts.

How to use it

  1. Find the account ID with List ledger accounts.
  2. Send only what changes: name, active, reportGroup (must suit the account type) or a new parentId (a group account of the same type).
  3. Code, type and currency stay fixed; reclassifying an account does not change its children.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Path Parameters

id*string

ID of the record (UUID).

Formatuuid

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

New display name. Omit to keep the current name; blank is rejected.

parentId?|

Move the account under this group account. The parent must be a group of the same type, and an account cannot be moved under itself or its own children.

Formatuuid
active?|

Set false to deactivate the account or true to reactivate it. Omit to leave unchanged.

reportGroup?|

Reclassify the account, e.g. mark a new bank account as CASH_AND_BANK. Must suit the account type; child accounts are not changed.

Value in"DIRECT_INCOME""INDIRECT_INCOME""DIRECT_EXPENSE""INDIRECT_EXPENSE""CURRENT_ASSET""CASH_AND_BANK""RECEIVABLE""FIXED_ASSET""CURRENT_LIABILITY""PAYABLE""LONG_TERM_LIABILITY""EQUITY"null

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?

The ledger account after the call.

Example Request
curl -X PUT 'https://beta.iotoms.com/api/v1/accounting/accounts/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'X-TenantID: your-tenant-code' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "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"  }}