Import a pricing model
This guide imports one pricing model file into the engine database, where a run resolves the prices of the period it rates. What such a file may declare is in the pricing model file reference.
Before you start
- The engine database reachable from the machine you run the CLI on, and its connection string.
- The pricing model file, with a
valid_fromat or before the first instant of the month it is to price.pricing/2026-03.yamlis the model the worked examples are priced with. tally-engineat the version the deployment runs, with its subcommands on the engine CLI page.- The engine settings page, which names
TALLY_ENGINE_DB_URL, the one variable this guide sets.
Import the file
Point the engine at its own database.
pricing importreads that database and nothing else:shexport TALLY_ENGINE_DB_URL='postgres://tally:password@db.internal:5432/tally_engine?sslmode=require'Import the file. The line names the version it stored and the instant that version is valid from:
shtally-engine pricing import pricing/2026-03.yamltextimported pricing model 2026-03 valid from 2026-03-01T00:00:00ZA second import of the same file stores nothing and says so:
shtally-engine pricing import pricing/2026-03.yamltextpricing model 2026-03 already importedA file that carries a version already imported and prices something else is refused with
this version is already imported and prices something else, and a corrected price belongs in a new version. A corrected price goes in under a version of its own.
Check the result
List the catalogs the database holds. The version the file declares stands on a line with its validity, its currency and when it was imported:
shtally-engine pricing listtext2026-03 valid_from=2026-03-01T00:00:00Z currency=EUR imported_at=2026-07-09T14:22:00ZA database that holds no catalog at all answers
no pricing models, and a run of a period no imported model is valid for fails withno pricing model is valid for this period.