MonetaryAI / Docs
API ReferenceAccounting settings

Configure a subaccount

Defaults to ADMIN/ACCOUNTANT. Name and enabled status may change using expectedVersion; parent and code cannot change. An enabled child requires an enabled parent. Audit is atomic. Company permission: `configureCompanySubaccount`. Defaults: ADMIN, ACCOUNTANT. Current company role permissions and active membership are checked on every request; signed legacy role claims alone do not authorize this operation.

PUT
/api/v1/accounting-settings/{legalEntityId}/accounts/{code}/subaccounts/{subaccountId}

Authorization

bearerAuth
headerAuthorizationBearer <token>

Obtained from POST /api/v1/auth/login, on the tenant's own subdomain. Presenting it on another tenant's subdomain is a 403.

Path Parameters

legalEntityId*string
Formatuuid
code*string
subaccountId*string
Formatuuid

Request Body

application/json
  1. body
enabled*boolean
expectedVersion*integer
Formatint64
Range1 <= value
name*string
Length0 <= length <= 200

Response Body

Subaccount saved with new version

application/json
  1. response
code?string
enabled?boolean
id?string
Formatuuid
name?string
parentCode?string
version?integer
Formatint64
curl -X PUT 'https://api.monetaryai.uz/api/v1/accounting-settings/497f6eca-6276-4993-bfeb-53cbbbba6f08/accounts/string/subaccounts/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{  "enabled": true,  "expectedVersion": 1,  "name": "string"}'
{  "code": "string",  "enabled": true,  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "parentCode": "string",  "version": 0}