Skip to main content

tallyprime_sdk/
lib.rs

1//! Blocking Rust SDK for [TallyPrime](https://tallysolutions.com/) over XML/HTTP.
2//!
3//! This crate talks to a running TallyPrime instance (default `http://localhost:9000`)
4//! using Tally's XML messaging format. Requests and responses use UTF-16 so currency
5//! symbols such as `₹` round-trip correctly.
6//!
7//! # Requirements
8//!
9//! - TallyPrime with XML/HTTP enabled
10//! - Dates in `YYYYMMDD` form for most public methods (for example `20250401`)
11//! - Optional company selection via [`config::TallyConfig::current_company`] or the
12//!   active company loaded in Tally
13//!
14//! # Quick start
15//!
16//! ```no_run
17//! use tallyprime_sdk::config::TallyConfig;
18//! use tallyprime_sdk::TallyClient;
19//!
20//! fn main() -> tallyprime_sdk::Result<()> {
21//!     let client = TallyClient::new(TallyConfig {
22//!         host: "localhost".into(),
23//!         port: 9000,
24//!         current_company: Some("My Company Pvt. Ltd.".into()),
25//!         ..Default::default()
26//!     })?;
27//!
28//!     client.test_connection()?;
29//!     let ledgers = client.get_ledgers()?;
30//!     println!("Found {} ledgers", ledgers.len());
31//!     Ok(())
32//! }
33//! ```
34//!
35//! # Capabilities
36//!
37//! - **Masters**: read/create ledgers, groups, stock items; read currencies and rich
38//!   ledger/stock details
39//! - **Vouchers**: create accounting vouchers; fetch day-book style voucher ranges
40//! - **Reports**: trial balance, balance sheet, profit and loss, GST computation
41//! - **GST**: voucher-derived GSTR-1 style summary ([`TallyClient::get_gstr1`]) when
42//!   Tally does not expose a builtin HTTP `GSTR-1` report
43//! - **Advanced**: lower-level [`xml_builder::XmlBuilder`] and [`TallyClient::post_xml`]
44//!   for custom Tally XML flows
45//!
46//! # Modules
47//!
48//! - [`client`] — [`TallyClient`] and response helpers
49//! - [`config`] — connection and company settings
50//! - [`models`] — typed request/response structs
51//! - [`xml_builder`] — XML envelope builders for advanced integrations
52//! - [`errors`] — [`TallyError`] and [`Result`]
53
54#![warn(missing_docs)]
55
56pub mod client;
57pub mod config;
58pub mod errors;
59pub mod models;
60pub mod xml_builder;
61
62pub use crate::client::TallyClient;
63pub use crate::errors::*;
64pub use crate::models::*;
65
66pub use crate::client::voucher_parser;