Create the default chart of accounts
POST
Creates a standard retail chart of accounts, with an optional currency. Idempotent: accounts that already exist are left alone, and the response says how many were created.
How to use it
- Optionally send a currency code; otherwise the merchant's configured currency is used.
- Call once when setting up accounting; it adds the standard groups and accounts such as Cash, Bank, Accounts Receivable and Sales Revenue.
- Accounts whose code already exists are skipped, so it is safe to run again; check createdCount and skippedCount.
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
currency?|Three-letter ISO currency code for the new accounts. Defaults to the merchant's configured currency.
OK
*/*- response
status*stringOutcome of the call: SUCCESS when the request was processed; otherwise an error status.
message*stringShort human-readable message describing the outcome, e.g. which record was saved or why the call failed.
data?How many default accounts were created or already existed, plus the default accounts themselves.
Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/accounting/accounts/seed-defaults' \ -H 'X-TenantID: your-tenant-code' \ -H 'Content-Type: application/json' \ -d '{}'Example Response
{ "status": "string", "message": "string", "data": { "createdCount": 0, "skippedCount": 0, "accounts": [ { "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" } ] }}