MonetaryAI / Docs
API ReferenceAccounting settings

Add a subaccount

Defaults to ADMIN/ACCOUNTANT. Code is unique within this company and parent; hierarchy is exactly one level. Parent must be enabled. A global parent is materialized as company metadata on first child creation; reload its version before configuring. No global ledger changes. Company permission: `createCompanySubaccount`. 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.

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

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

Request Body

application/json
  1. body
code*string
Match^[A-Za-z0-9][A-Za-z0-9._-]{0,31}$
Length1 <= length
enabled*boolean
name*string
Length0 <= length <= 200

Response Body

Subaccount created

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