Background with light gradient and lines

Ecommerce inventory accounting means recording every unit you buy at its full landed cost, picking one cost flow method such as FIFO or weighted average, and moving that cost into cost of goods sold (COGS) only when the unit ships to a customer. Marketplace fees, payment fees and outbound shipping stay out of inventory and sit in their own expense lines.

For tax years beginning in 2026, a seller whose average annual gross receipts for the prior three years do not exceed $32 million can use the simpler small business inventory rules in Internal Revenue Code section 471(c) and skip the uniform capitalization rules of section 263A. This guide covers how ecommerce inventory accounting works in practice, with a worked COGS example, and points to separate guides for the sales tax side.

What Ecommerce Inventory Accounting Has to Track

An online store's books need to tie three records together each month. The order record shows what the customer bought and paid. The payout record from Shopify Payments, Stripe, PayPal or a marketplace shows what arrived after fees, refunds and reserves. The bank statement shows the cash. Inventory sits underneath all three, because every order relieves units from stock and every purchase order adds them back.

Start with a clean SKU master. Give every product and every variant (size, color, pack count) its own SKU, a unit of measure and a cost field. Use the same SKU in the storefront, the warehouse or 3PL system and the ledger, so a unit sold in the cart is the same unit relieved from inventory. Kits that are assembled at the time of sale should relieve each component SKU. A prebuilt bundle with its own SKU carries its own cost like any other item.

Physical counts keep the subledger honest. Cycle count fast movers during the month and run a full count at least once a year, recording damage, loss and theft as adjustments. The retail inventory shrinkage accounting guide walks through the journal entries for write downs.

Landed Cost: What Goes Into Inventory

Product cost is more than the supplier invoice. For merchandise bought for resale, the federal tax regulations at 26 CFR 1.471-3 define cost as "the invoice price less trade or other discounts" with "transportation or other necessary charges" added. For an importer, that typically means inbound freight to your warehouse or the 3PL, customs duty, customs broker fees and inbound insurance.

When freight and duty arrive on one bill for a whole shipment, allocate them to SKUs using one consistent driver. Units work for products of similar size. Weight or cubic volume works better when a shipment mixes heavy and light items. Invoice value works when duty is charged on value. Write the driver into your accounting policy and use it every time.

Costs that occur after the unit is ready for sale stay out of inventory for book purposes. Outbound shipping to customers, marketplace referral fees, fulfillment fees, payment processing fees and advertising are selling or fulfillment expenses. Packaging is a judgment call: branded boxes or inserts that ship inside every unit and can be counted per unit can be added to product cost, while general shipping supplies belong in fulfillment expense.

Choosing a Cost Flow Method for Online Sellers

Most ecommerce brands choose between two cost flow methods. IRS Publication 538 explains that the FIFO (first-in first-out) method "assumes the items you purchased or produced first are the first items you sold." Weighted average pools the cost of all units on hand and charges each sale at the average unit cost, recalculated when new stock arrives.

FIFO suits sellers whose unit costs move a lot between purchase orders, for example because of tariffs or freight swings, since ending inventory reflects the most recent landed costs. Weighted average is easier to run across a large catalog and smooths out lot to lot noise in gross margin. Both are standard choices in inventory and accounting software. The comparison of FIFO, LIFO and weighted average for retailers covers the method choice in more depth.

Whichever method you pick, keep it. Publication 538 states: "Your inventory practices must be consistent from year to year." It also says that to change your inventory method for tax "you must file Form 3115." Switching methods mid-year without that process makes margins impossible to compare and creates a tax compliance problem.

Worked Example: COGS Under FIFO and Weighted Average

A Shopify and Amazon seller starts the quarter with 200 units of one SKU at a landed cost of $10.00 each. It then imports 500 units:

  • supplier invoice: $5,500.00 ($11.00 per unit)
  • inbound freight: $400.00
  • customs duty: $275.00
  • total landed cost: $6,175.00, or $12.35 per unit

During the quarter it sells 550 units at $30.00, for revenue of $16,500.00. Marketplace referral fees average 15% of the sale price ($2,475.00) and fulfillment fees are $3.50 per unit ($1,925.00).

LineFIFOWeighted average
Units sold550550
Cost per unit basis200 at $10.00, then 350 at $12.35$8,175.00 / 700 = $11.6786
COGS$6,322.50$6,423.21
Ending inventory (150 units)$1,852.50$1,751.79
Gross profit$10,177.50$10,076.79
Gross margin61.68%61.07%
Less referral fees$2,475.00$2,475.00
Less fulfillment fees$1,925.00$1,925.00
Contribution after marketplace fees$5,777.50$5,676.79

Under both methods, beginning inventory plus purchases ($2,000.00 + $6,175.00 = $8,175.00) equals COGS plus ending inventory, which is a quick check worth running every close. The fees sit below gross profit, so gross margin stays comparable between your own store and the marketplace.

Landed cost changes the answer too. If the $675.00 of freight and duty were expensed when paid instead of added to inventory, the quarter would carry $6,525.00 of product cost and freight under FIFO ($5,850.00 of COGS at invoice cost plus $675.00). That is $202.50 more than the $6,322.50 above, because 150 units still on hand carry $1.35 each of freight and duty that belongs in ending inventory. For more on how these lines feed pricing decisions, see the guide on ecommerce profitability across COGS, fees and shipping.

The 2026 Small Business Inventory Rules: Section 471(c)

The tax rules for ecommerce inventory accounting depend on size. Revenue Procedure 2025-32, published in Internal Revenue Bulletin 2025-45, states: "For taxable years beginning in 2026, a corporation or partnership meets the gross receipts test of § 448(c)" when its average annual gross receipts for the three prior tax years do not exceed $32,000,000. Sole proprietors apply the same test to their business receipts.

A seller that meets this test and is not a tax shelter can use section 471(c). Its inventory method is accepted for tax if it either "treats inventory as non-incidental materials and supplies" or "conforms to such taxpayer's method of accounting reflected in an applicable financial statement." A business without audited or regulator-filed financial statements can follow "the books and records of the taxpayer prepared in accordance with the taxpayer's accounting procedures."

For a typical brand under $32 million, this means two things. First, the books you keep each month carry real weight, because the tax inventory method can follow them. Second, the method has to be written down and applied the same way every year. Moving to section 471(c) from a prior method is a change in accounting method, so speak with your tax preparer about Form 3115 before the return is filed. The reporting side sits on Form 1125-A for corporations and partnerships, covered in the guide to Form 1125-A and reporting COGS on your taxes.

Section 263A: Uniform Capitalization and the Exemption

Section 263A, the uniform capitalization (UNICAP) rules, requires certain taxpayers to add a share of indirect costs, such as purchasing, warehousing and handling, to inventory. It covers "Real or personal property described in section 1221(a)(1) which is acquired by the taxpayer for resale," which includes ecommerce stock.

The same gross receipts test removes most online sellers from these rules, other than tax shelters. Section 263A(i) says that for a taxpayer that "meets the gross receipts test of section 448(c) for any taxable year," the section "shall not apply with respect to such taxpayer for such taxable year." For 2026, that is the $32 million average. Sellers above the threshold need a UNICAP calculation each year, which usually pulls part of warehouse rent, 3PL storage and purchasing staff cost into ending inventory.

Marketplace Fees, Payouts and Returns

Amazon describes its referral fee as follows: "For every item sold, you'll pay a percentage of the total price or a minimum amount, whichever is greater" (Amazon seller pricing). Record that fee, fulfillment fees, storage fees and advertising as separate expense accounts, and book the sale at the gross price the buyer paid. Recording the net settlement as revenue hides fees and makes gross margin look lower than it is.

Use a clearing account for each marketplace. Post the settlement report into it as gross sales, fees, refunds, reimbursements and reserves, then clear it against the bank deposit. Inventory held at a marketplace warehouse is still your inventory until it sells, and lost or damaged unit reimbursements should reduce the write off for those units. The guide to outsourced bookkeeping for Amazon FBA sellers covers settlement reconciliation in detail.

When a return comes back in saleable condition, reverse the COGS and put the unit back into inventory at the cost it left at. When it cannot be resold, record a write off. Tie each refund to its original order so margin by SKU stays accurate.

Month-End Close and Cut-Off for Inventory

COGS is only as good as the period boundaries. Goods in transit at month-end, purchase orders received without a supplier invoice, and orders paid but not yet shipped all need a clear rule for which period they fall in. The playbook on cut-off procedures for close teams sets out how to test receiving and shipping records around the period end.

A practical close sequence for an online store:

  1. Post payouts and marketplace settlements to clearing accounts and reconcile them to bank.
  2. Post inventory receipts with their landed cost allocation, including freight and duty bills that arrived after the goods.
  3. Reconcile the inventory subledger to the general ledger and investigate count variances.
  4. Review gross margin by SKU and channel, and confirm that beginning inventory plus purchases equals COGS plus ending inventory.

Where Sales Tax Fits

Inventory and sales tax interact in one place: stock stored in a state, including at a marketplace or 3PL warehouse, can create physical nexus there. Track warehouse locations alongside the inventory subledger so tax registrations stay current. For the sales tax rules themselves, use the dedicated guides: economic nexus thresholds by state, the sales tax compliance checklist for small businesses, and SaaS billing sales tax for brands that also sell subscriptions or digital products.

Frequently Asked Questions

Which cost flow method suits an ecommerce business? FIFO fits sellers whose landed costs change often, because ending inventory reflects recent purchase costs. Weighted average is simpler for large catalogs with frequent restocks. Either works for book purposes if it is applied consistently, and a later change for tax needs Form 3115.

Do marketplace fees count as cost of goods sold? Under the cost definition in 26 CFR 1.471-3, inventory cost for a reseller is the invoice price less discounts plus the charges needed to acquire the goods. Referral, fulfillment and storage fees arise when selling or holding the goods, so most sellers record them as selling and fulfillment expenses below gross profit. Confirm the presentation for the tax return with your preparer.

What is the 2026 gross receipts threshold for small business inventory rules? For tax years beginning in 2026, the section 448(c) test is met when average annual gross receipts for the three prior tax years do not exceed $32,000,000, according to Rev. Proc. 2025-32. Sellers that meet it can use section 471(c) and are exempt from section 263A.

Are freight and customs duty part of inventory cost? Yes. Inbound freight and duty are charges needed to acquire the goods, so they are added to the cost of the units and expensed through COGS as the units sell. Outbound shipping to customers is a fulfillment expense.

Next Step

Madras Accountancy provides outsourced bookkeeping and accounting support for ecommerce businesses and the CPA firms that serve them, including inventory subledger reconciliation, landed cost allocation, marketplace settlement reconciliation and month-end close. To discuss your setup, contact our team.

Table of Contents

Explore More Blogs

Image
Section 4960 Excise Tax: The 2026 Expansion Nonprofits Need to Know
Published On:
October 27, 2026

The section 4960 excise tax is 21% of nonprofit pay over $1M. From 2026 it covers all employees. See the medical carve-outs, Form 4720 and a worked example.

Image
Paid Family and Medical Leave Tax Credit: The Permanent Section 45S Rules for 2026
Published On:
October 27, 2026

The paid family and medical leave tax credit is permanent from 2026. See the 12.5% to 25% rates, the premium option, the 6-month rule and how Form 8994 works.

Image
Opportunity Zones 2026: What Changes When the Program Becomes Permanent
Published On:
September 30, 2026

Opportunity zones become permanent in 2027 under the One Big Beautiful Bill. See the new deferral, rural bonus, and the 2026 handoff.

View all posts
Icon
Icon