Build1 publisher3 min readPublished
Zomato's grand total row adds a section its own label leaves out
A developer parsed 24 real delivery payout files and found the charges that move money sitting past the summary tab, under a deductions total labelled (A)+(B)+(C) that sums four sections. His own parser doubled the discount figure on its first pass.
The Engineer · Build desk

What happened
- A developer parsed 24 payout files published by the restaurants that received them: one Swiggy payout annexure and 23 Zomato settlement reports.
- One Zomato row showed an onboarding fee with the full amount under Total amount, zero under Adjusted amount, and the same figure again under Outstanding amount.
- Some Swiggy discount rows carry an amount with no campaign details, only the remark Unable to fetch Campaign Details, one of them worth about 3% of that week's total discounts.
Compiled by The EngineerSomething wrong?How this is made
Why it matters
- decision Anyone booking these files has to choose a column before writing the journal entry, because Total amount can include an outstanding balance and only Adjusted amount tracks the cash that moved.
- exposure A discount line with no campaign details still carries a deduction, so a restaurant can be charged for a promotion the report itself cannot identify.
- contradiction The file's own total row is the obvious thing to reconcile against, and where its label and its arithmetic disagree the check flags a mismatch that is really a labelling fault.
The parser bug in the post is the part worth copying. On its first pass the author's script read the Swiggy Discount Summary total row as if it were data, because that sheet puts the word TOTAL in the Restaurant Share column and leaves the label column blank [6]. The script reported almost exactly twice the true number, and a test comparing the parsed sum against the file's own total row caught it [7]. Automated extraction alone got it wrong; the cross-check against a figure the workbook already carries is what found the error. The post's headline says three of the 24 files disagree with their own stated totals [1]. That is one file in eight [1]. On the Zomato reports the grand total row is labelled "Total Deductions (A)+(B)+(C)", and the figure on that row is the sum of A + B + C + D, with D being "Adjustments from previous weeks" [17]. A parser that adds sections A through C and asserts equality with the labelled total will fail by exactly section D, on a correct reading of both. The three-file count comes from the headline; the discrepancy the post walks through in detail is that label. Swiggy's payout annexure is one workbook with seven sheets, and the ads live on "Other charges and deductions" along with every other restaurant-level adjustment [3]. That sheet holds two blocks, one for the current week and one for adjustments carried over from the previous week, each with its own header row [4]. The first header reads "Adjustment Type". The second reads "Adjusment Type", in the real file, which the author says is why rows vanish from scripts written to read these workbooks [5]. A header lookup keyed on string equality returns nothing for the second block. No exception is raised, and the sheet simply looks shorter than it is. On the Zomato side the tab is called "Addition Deductions Details" with no slash, because Excel forbids "/" in a sheet name; the "Addition/Deductions Details" form is how it renders in a PDF print [10]. Inside are five sections, each with its own header row, under titles including Addition Type, Deduction Type, A) Investments in growth services, B) Investments in Hyperpure, C) Other deductions and D) Adjustments from previous weeks [11]. The first section is money added to the payout, so summing the column without reading the section titles counts cancellation refunds as charges [12]. Ads sit under section A, labelled ADS [13]. Every row carries Total amount and Adjusted amount side by side, and they are often equal; Total amount can include an outstanding balance that has not yet been deducted from this cycle, so Adjusted amount is the figure for what left the payout [14]. The author saw an onboarding fee with the full amount under Total amount, zero under Adjusted amount, and the same figure again under Outstanding amount [15]. The Glossary tab that documents the fields omits two or three columns that appear in the sheet and lists the tax block in a different order than the data [16]. Back on the Swiggy discount sheet, one column decides who paid for a promotion. Where Restaurant Share (%) reads 100 the entire discount came out of the payout, where it reads 50 it was split, and the coupon codes look identical either way [8]. Some rows there have no campaign details at all, just a remark reading "Unable to fetch Campaign Details" with an amount attached, and in the file the author examined one of those lines was worth about 3% of that week's total discounts [9]. "If you run a restaurant on these platforms, the short version is that the number you care about is probably not on the tab you're looking at," the author wrote [18].
What to watch
- Whether Swiggy corrects the Adjusment Type header, which would silently change the behaviour of every parser written to match the typo.
- Whether the author publishes the three files that disagree with their own totals and the size of each gap.
- Whether Zomato relabels the Total Deductions (A)+(B)+(C) row or drops section D out of the figure.