featured article

Shopify Discount Codes in Your Books: Gross Sales, Discounts, and the Margin You Kept

Konstantine Christofakis

November 5, 2026

Shopify records a discount code as a separate negative line between gross sales and net sales, and your books should do the same. Book gross sales at full price, book discounts to their own contra-revenue account, and net sales falls out as the difference. Booking only the net amount gives you the same revenue figure but erases the cost of every code you ran, and after Black Friday that cost is the number you most need to see. One trap sits outside the discount line entirely: markdowns made through compare-at pricing never appear as discounts at all.

How Shopify defines the lines

Shopify's Finance reports help page sets out the arithmetic. Per that page:

  • Gross sales equals product selling price times ordered quantity. It excludes discounts, sales reversals, taxes, shipping, and fees.
  • Discounts equals the product's own discount plus the product's proportional share of any cart-wide discount, shown as a negative on the date the order was placed.
  • Sales reversals are the value of goods returned, shown as a negative on the date the return was processed.
  • Net sales equals gross sales minus discounts minus sales reversals. It excludes shipping and taxes.
  • Total sales equals gross sales minus discounts minus sales reversals plus taxes, shipping charges, and fees.

The Discounts by order report separates line-item discounts (applied to one product) from order-level discounts (applied to the whole order). The same help page states that discounts are not related to compare-at prices.

Two consequences follow. A cart-wide code gets spread across every product in the order by value, which means SKU-level margin can absorb the discount correctly. And a product sold at a lowered price with a compare-at price shown gets recorded at the lower price as gross sales, with zero discount.

Worked example: one order, one code, one return

Illustrative numbers. Take a store selling three products in one order, with a Black Friday code for 20 percent off the order.

  • Product 1 at $40.00, landed cost $12.00
  • Product 2 at $25.00, landed cost $7.50
  • Product 3 at $15.00, landed cost $4.00

Gross sales: $80.00.

The code takes $16.00 off. Shopify allocates it in proportion to each product's share of the order: $8.00 to Product 1, $5.00 to Product 2, $3.00 to Product 3. Net sales: $64.00.

The customer pays $6.00 shipping and, at an illustrative 8 percent tax rate on the $64.00, $5.12 in tax. Total sales: $64.00 plus $5.12 plus $6.00 equals $75.12.

Payment processing at an illustrative 2.9 percent plus $0.30 on $75.12 comes to $2.48. Use your own plan's rate. The payout for this order is $72.64.

The journal entry, in summary:

  • Sales, gross: credit $80.00
  • Discounts (contra revenue): debit $16.00
  • Shipping income: credit $6.00
  • Sales tax payable: credit $5.12
  • Payment processing fees: debit $2.48
  • Shopify clearing account: debit $72.64

Debits total $91.12, credits total $91.12.

Now the margin. With a 3PL charging an illustrative $7.50 to pick, pack, and ship, contribution is $64.00 plus $6.00 shipping income, minus $23.50 COGS, minus $2.48 processing, minus $7.50 fulfillment: $36.52.

Without the code the order would have contributed $52.02, because processing would have been $2.98 on a $92.40 total. The $16.00 discount cost $15.50 of contribution, since processing fell $0.50 along with the order total. That is the margin you gave up. Whether the code paid depends on whether this order would have happened without it.

The return

The customer returns Product 2. Shopify records a sales reversal of the product's $25.00 gross value, along with a $5.00 discount reversal, since $5.00 of the code was allocated to it. Net sales fall by $20.00, and the refund is $20.00 plus the $1.60 of tax on it, $21.60. If the unit goes back on the shelf, its $7.50 cost returns to inventory.

Booking returns at the discounted value matters. If the books reverse $25.00 of revenue for a $20.00 refund, they overstate the return by $5.00 and understate net sales by the same amount. Over a holiday season with thousands of coded orders, that error compounds.

Check separately whether your payment provider returns the processing fee on refunds. Treat it as a cost of the return if it does not.

Dates matter at period end

Shopify places the discount on the date the order was placed and the reversal on the date the return was processed. A Black Friday order returned on January 12 shows its full $16.00 discount in November and its $5.00 discount reversal in January. November's discount rate is accurate for November. January's net sales take a hit for a sale that happened in another year. When you review the holiday, pull returns by original order date, not by refund date, or the event will look better than it was and January worse.

The compare-at trap

Say Product 1 normally sells for $50.00 and you lowered its price to $40.00 for Black Friday, showing $50.00 as the compare-at price. Shopify records $40.00 of gross sales and nothing in Discounts. Your report shows a 20 percent discount rate on the order above. The real markdown from list price was $26.00 on $90.00, close to 29 percent.

Neither number is wrong. They measure different things. But a seller comparing "discounts given" this year against last year will see a smaller figure if the strategy shifted from codes to compare-at markdowns, and conclude they discounted less. Keep a simple record of compare-at changes by SKU and date, or measure markdowns by comparing each SKU's average selling price against its list price for the period.

Measuring what Black Friday cost in discounts

Three ratios, from the Shopify finance reports, per period:

  • Discount rate: discounts divided by gross sales. In the example, $16.00 over $80.00 is 20 percent.
  • Return rate on discounted sales: sales reversals on orders that used a code, divided by net sales on those orders.
  • Contribution per coded order versus uncoded order: the only one of the three that tells you whether the code made money.

Before setting the code value, check it against each product's floor price: the lowest price at which the product still covers its variable costs. The method is in setting a Black Friday discount floor for every SKU. A 20 percent cart-wide code applied to a low-margin accessory can push that product below its floor even when the order overall looks healthy.

Getting it into QuickBooks or Xero

The gross-plus-contra structure only helps if every payout posts that way, every day, including the week your order count spikes.

ConnectBooks reconciles Shopify payouts, including the sales, refunds, and fees inside them, into QuickBooks Online, QuickBooks Desktop, or Xero. For QuickBooks Online, sellers can choose summarized entries or item-level detail. With COGS on FIFO and landed cost allocated, the margin after discounts is visible by product, not only by order. The setup for QuickBooks Online is on the Shopify and QuickBooks Online page, and the broader approach is on QuickBooks for Shopify sellers.

Once entries post, the payout still has to tie to the bank deposit. That step is covered in reconciling Shopify payouts to bank deposits.

The short version

Book gross, book discounts separately, reverse returns at the discounted value, and track compare-at markdowns outside Shopify's discount line. Then ask the only question that matters after the event: which codes earned more contribution than they gave away.

Take Control of Your E-Commerce Business with ConnectBooks

Running an e-commerce business comes with plenty of challenges, but ConnectBooks is here to make your life easier. With real-time insights, seamless integrations, and detailed tracking of your profitability and inventory, you can stay ahead of the game. Whether you’re selling on Amazon, Shopify, Walmart, TikTok or eBay, ConnectBooks helps you manage your finances with 100% accuracy and confidence, so you can focus on growing your business.

Ready to level up? Start making smarter, data-driven decisions every step of the way. Try ConnectBooks Free Today or Schedule a Demo