tally_create_master
Create a new TallyPrime master—group, cost centre, unit, stock item, voucher type, or budget—with validation and a preview before confirming the write.
Instructions
Create a NEW master in TallyPrime: an account group, cost centre, unit of measure, stock group, godown (location), stock item, voucher type or budget. For ledgers use tally_create_ledger.
Fields by kind: group needs parent (an existing group — its nature follows the parent). costCentre takes parent and category. unit takes formalName and decimalPlaces (name is the symbol, e.g. "kg"). stockGroup and godown take parent. stockItem takes parent (stock group), baseUnits (required) and an optional opening quantity and rate. voucherType needs parent (the type it is based on, e.g. "Sales") and takes numberingMethod. budget takes parent only; budget AMOUNTS are entered in TallyPrime itself.
REFUSES a name that already exists (TallyPrime would otherwise overwrite it) and any parent, category or unit that does not exist.
WRITES TO TALLYPRIME, in two steps. This call only PREVIEWS: it checks the change against the live books and returns exactly what would be written plus a confirmToken — nothing is changed. Show the preview to the user, and only after they approve it call tally_confirm_write with the token. Never confirm on your own initiative, and never confirm a preview the user has not seen.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | group, costCentre, unit, stockGroup, godown, stockItem, voucherType or budget. (Ledgers have their own tools.) | |
| name | Yes | ||
| parent | No | group: parent group (required). costCentre: parent cost centre. stockGroup: parent stock group. godown: parent godown. stockItem: its stock group. voucherType: the type it is based on, e.g. "Sales" or "Journal" (required). budget: parent budget. Empty for top level. | |
| company | No | Company name. Omit to use whichever company TallyPrime has loaded. If given and it is not the loaded one, the call fails with TALLY_COMPANY_NOT_LOADED rather than returning another company's data. | |
| category | No | costCentre only: its cost category. | |
| baseUnits | No | stockItem only: unit symbol, e.g. "kg". Required on create. | |
| formalName | No | unit only: full name, e.g. "Kilograms". | |
| openingRate | No | stockItem only: opening rate per base unit. | |
| decimalPlaces | No | unit only: decimal places for quantities. | |
| numberingMethod | No | voucherType only: number vouchers automatically or by hand. | |
| openingQuantity | No | stockItem only: opening quantity in its base unit. |