Inside an Amazon warehouse in Peterborough, Britain.

With widespread double-digit sales gains, it’s been another banner year for e-commerce retailers — but the business doesn’t come cheap.

Costs associated with e-commerce shipping, returns, marketing, customer acquisition, site maintenance and upgrades, data security and digital advertising are all on the rise and will cut into margins for the year. Just how deep the wounds are vary from retailer to retailer, depending on how advanced their online infrastructures and technologies are, how fast they handle fulfillment and returns, what kind of products they sell, and how much they can offset the costs by growing the revenues.

Retailers trumpet their online operations and rightly so: E-commerce has grown to account for a quarter to a third or more of total sales in many cases. But they’re less likely to discuss the growing pains.

“Online returns often draw additional attention in December due to the large volume of e-commerce during the holiday season. But the challenge of processing and reselling those returns — often called reverse logistics — is a year-round conundrum for retailers and shippers,” said David Egan, global head of industrial and logistics research at CBRE.

Online returns could total as much as $37 billion for this holiday season, according to CBRE research. That projection is based on eMarketer’s projection of $123 billion of online sales during the November-December holiday selling period this year. In 2017, CBRE projected $32 billion in online returns during the holiday season.

There’s an 8 percent return rate on in-store purchases, while the online return rate can be as much as 30 percent, depending on the category. Fashion is particularly high.

There are other significant costs. “From operating the sites themselves and the functionality, keeping the sites up to date, the risk mitigation, security and the shipping, there is significant investment behind all of those aspects,” said Coye Nokes, consumer and retail practice partner, OC&C Strategy Consultants. “And Amazon Prime set up customers’ expectations for free shipping,” added Nokes. “So it’s difficult for retailers to cover all those costs in the margin. You really can’t pass that on to consumers.”

Companies like Lands’ End, L.L. Bean, and Qurate Retail Group, which operates QVC and HSN, have long had infrastructures in place to ship products to consumers and manage returns. “They would certainly have a different profile of investment than some other retailers,” said Nokes. “If you are operating a subscription business, there’s some predictability around it and you can manage your costs better.”

A record $110.6 billion was spent online in the U.S. from Nov. 1 through Dec. 19 this year, an increase of 17.8 percent from last year’s record $93.9 billion during the same holiday stretch, according to Adobe Analytics.

“The increase in sales is good news, but some of those costs are fixed and some are variable,” Noyes explained. “It’s not uncommon to see lower margins on e-commerce sales versus regular retail and if you do the math, if the share of sales shifts more online and those sales are lower margins, you can see the margin mix change.

However, “Even though the margins are under pressure if you put more volume through the channel, then the fixed costs of that investment will be able to spread over more revenue, achieving better economies of scale,” Noyes said. “And the more you ship, the better you can negotiate rates with carriers.”

“There still is a misconception that online selling is super cheap. That’s not quite the way it works,” said Vic Drabicky, founder and chief executive officer of January Digital, a digital marketing and analytics firm specializing in retail.

While there are newer technologies that enable selling online to be cheaper and easier, such as the Shopify e-commerce platform, advertising costs are rising, Drabicky noted. Running ads on Google and Facebook, he said, represent roughly 70 percent of all ad spending. “Facebook ad prices are up 100 percent year over year,” he said. “Digital advertising is getting more expensive. The barrier to entry is going down but the costs to run a successful business is going up. We see that with our clients.

“Whenever you are making an investment in infrastructure or technology, it’s measured in quarters or years – not days or weeks,” said Drabicky.

“Lands’ End has built a really strong customer data. They can use that data well to lower their costs for marketing,” Drabicky said. MatchesFashion.com, he suggested, also has a great tech infrastructure. “Digital-first brands have the leg up over traditional retailers.”

Consumers expect free shipping, which is another hit to the margin. “Twenty percent will abandon the site if they are not getting free shipping,” Drabicky said. Between all the picking, packing and delivering of orders, free shipping can take $3 to $10 out of every order, Drabicky estimated. “It’s interesting to watch how each brand handles that.” One solution — use cheaper boxes for shipping.

He also said that the cost for acquiring customers is getting more expensive. “Once you have that data, it’s about making sure that it’s safe, accurate and you can deploy it properly.”

Increasingly, retailers are enabling consumers to pick up their online orders in stores. That service is called BOPIS (buy online, pickup in stores). And while it can serve as a driver of in-store traffic, it’s also another cost retailers incur.

Package Concierge, based in Medfield, Mass., sets up BOPIS systems for retailers by providing automated package lockers in stores, as well as the related software and support. The software tracks the packages and deliveries.

“It’s very inexpensive,” said Georgianna Oliver, founder of Package Concierge, noting that for less than $20,000, the system, including support, can be installed. There’s also an annual service fee. For retail chains, requiring multiple BOPIS installations, there’s room to negotiate the price down, Oliver said.

At a minimum, the locker installation is 7 feet wide, 7 feet high and 2 feet deep, though they could be as much as 13 feet wide.

A standard return process can involve several sets of hands, and a lot of time and space as well as the manpower, CBRE’s Egan said. “The number of touches can dramatically reduce the value of the item, even if it’s in perfectly pristine shape,” he said. “Speed is definitely of the essence. Apparel is very seasonal. Dealing with this efficiently and quickly is critical.”

Typically, it’s a very physical process — opening boxes, inspecting the products inside, determining whether they’re suitable for resale or to be discarded, repacking the boxes, deciding where to ship the boxes whether it’s the online fulfillment center, a store or an off-price retailer.

“There are a lot of handling decisions that need to be made. It’s a laborious process. And with every step of the way, the item becomes a little less valuable,” said Egan.

“It costs about 4.5 percent of revenues to deal with online returns,” said Egan.

According to Optoro, a technology company that works with retailers and manufacturers to manage their returns and excess inventory, fashion apparel can lose 40 to 50 percent of its value over an eight-to-16-week span after being returned. With consumer electronics, returns can lose 4 to 8 percent of their value for each month they’re not resold.

“Traditionally, it took retailers weeks or even months to process returned inventory,” said John Hsu, Optoro’s senior director of solutions. “In many cases, a return would come back to a store or warehouse, and then sit for a few months until it was consolidated and shipped to another location to be processed. On average, returns are touched three to five times before reaching an end disposition.

“For some categories, such as consumer electronics, there are even more steps involved if the item needs to be tested or wiped of data before being resold or dispositioned to another channel,” Hsu added.

He said that Amazon and Best Buy are two retailers that have done a good job at managing returns. “Amazon often allows consumers to keep their item if they know that it will cost more to ship back and process. Best Buy has been a leader for many years, and often sells open box returns in their stores.”

“The speed and efficiency with which a company can process and resell or dispose of online returns can be the difference between making money or losing it on their holiday e-commerce sales,” said Egan. “The most effective retailers and shippers have built their supply chain to handle a reverse flow of merchandise, or they have hired the right partners to handle that for them.”