Skip to main content
GullySystem

How to Integrate E-Commerce with Inventory and Accounting

By Ganesh HS, Strategy and Technology, GullySystem

Integrating e-commerce with inventory and accounting means deciding which system is the single source of truth for stock and money, then mapping every sales event — order, return, cancellation — to the update it should trigger in both, and testing that mapping against real edge cases before relying on it.

Decide Which System Owns Stock, Orders and the Books

Before connecting anything, decide explicitly which system is authoritative for each type of data. For most SMBs, the inventory or ERP system should own actual stock levels, the storefront should own the customer-facing order, and the accounting system — often Tally for Indian businesses — should own the books. Ambiguity here, where two systems both think they're in charge of the same number, is the root cause of most integration bugs.

Writing this ownership down explicitly, before any integration work starts, forces decisions that otherwise get made implicitly and inconsistently by whoever builds each connector.

Map Every Sales, Return and Cancellation Event to a Stock Update

A sale should decrement available stock; a cancellation before fulfilment should return it; a return after delivery should restock it (or write it off, if damaged) and separately trigger a financial credit note. It's common for an integration to handle the straightforward sale correctly and then miss or mishandle the return and cancellation paths, because they're tested less often.

Consider a footwear retailer running a warehouse alongside an online store: a customer return that updates stock in the warehouse system but never generates the matching credit note in accounting will quietly throw off both the stock count and the books, and the mismatch usually isn't noticed until a monthly reconciliation turns up a discrepancy nobody can immediately explain.

Get SKU Identifiers, Tax Fields and Reconciliation Right

Every system involved needs to agree on the same product identifier — a SKU that means the same thing in the storefront, the inventory system and the accounting system — or the integration ends up doing fragile, manual mapping between different codes. Decide this once, early, rather than retrofitting it after each system has its own scheme.

Tax fields (GST rate, HSN code, place of supply) need to flow through consistently from product setup to invoice generation, not be re-entered at the accounting stage. A regular reconciliation habit — comparing order totals in the storefront against what landed in accounting — catches drift from sync failures before it compounds into a larger problem.

Plan for Sync Frequency, Failures and Overselling

Decide deliberately whether stock sync needs to be near-instant (webhook or event-driven) or can run on a short interval (every few minutes), based on how fast your stock actually moves and how costly overselling would be for a given product. Faster isn't automatically better — it's more infrastructure to maintain, and it needs to be justified by the actual risk.

Whatever the sync method, plan for what happens when it fails: a webhook that doesn't arrive, an API call that times out. Overselling controls — a small buffer stock held back, or an automatic hold on an order when a sync check fails — are cheaper to design in from the start than to bolt on after the first oversold order upsets a customer.

Test Real Edge Cases Before You Rely on the Integration

Before go-live, test scenarios beyond the standard successful order: a return on a partially refunded order, a cancellation that happens after the accounting entry has already been created, two orders racing for the last unit of stock, and a sync failure mid-transaction. These are the situations most likely to expose a gap in the ownership mapping done earlier.

Treat this testing as a deliberate exercise with a written list of scenarios, not an assumption that 'it worked in the demo' means it will hold up under real order volume and real customer behaviour.

Commerce-stock-accounting flow

A flow diagram tracing an order, a cancellation and a return each through the storefront, inventory system and accounting system, marking which system is authoritative at each step and where a financial entry (invoice, credit note) must be generated alongside the stock update.

Frequently asked questions

Can stock sync happen in real time?

Technically yes, with webhook-based integration, but 'real time' still carries a lag and a failure window. Plan for near-real-time with a reconciliation check behind it, rather than assuming a perfectly instant sync that never needs a fallback.

How should returns affect accounting?

A return should reverse both stock and the financial entry together — restocking (or writing off) the item and generating a credit note — not just one side. A common bug is inventory being updated while the matching accounting entry is missed, which throws off reconciliation.

Next step

Have a specific situation to work through?

This article covers the general case. Tell us what you're actually dealing with and we'll respond directly.

Discuss Your Requirement