PDF Generator API
PDF generator API_The Unexpected Nightmare of Invoice Generation in Recommerce

The Unexpected Nightmare of Invoice Generation in Recommerce

For the past two years, I worked as the Head of Sales Solutions at Foxway Recommerce. Our business was straightforward—buy used smartphones, refurbish them, and sell them through various sales channels. My job? Make sure our Sales IT budget was well spent, ensuring our sales teams had the tools they needed to succeed.

One of those responsibilities? Invoice generation. Sounds simple, right? Just generate an invoice when a sale happens. But if you’re in the refurbished tech industry, you know it’s anything but simple.

The Complexity of Invoicing in Refurbished Tech

The first and most critical nuance in this industry is VAT exceptions. When devices are purchased from private individuals, they fall under a special scheme called Marginal VAT—meaning VAT is only applied to the margin between the purchase and sales price, not the total value. That means invoices must clearly communicate when this VAT scheme is used.

Then comes another challenge: IMEI management. Every smartphone has a unique identifier, and different sales channels and customers have different requirements:

  • Marketplaces like Backmarket or Amazon require IMEI numbers on invoices.
  • Some B2B customers need IMEIs listed.
  • Other B2B customers explicitly do not want IMEIs included because they buy in bulk and don’t want invoices hundreds of pages long.

This led to four different invoice templates:

  1. Traditional VAT, no IMEI
  2. Traditional VAT, with IMEI
  3. Marginal VAT, no IMEI
  4. Marginal VAT, with IMEI

Managing these templates was already tricky. But the real problems started when business scaled and legacy IT constraints came into play.

When IT Bottlenecks Become Business Problems

We had a major scalability challenge. If we sold 1,000+ items on a marketplace in a single day, we had to generate invoices quickly—sometimes within minutes—to meet shipping deadlines. The IMEI for each order was only assigned at the time of picking an item to an order, making real-time invoice generation a necessity.

To make matters worse, we were stuck with hard-coded invoice templates. Any change had to go through our IT development cycle, which took at least two weeks per sprint. But hey, invoices don’t change that often, right? At least, that’s what I thought…

Then came The Great Invoice Template Fiasco.

A Real-Life IT Horror Story

One Tuesday afternoon, a developer pinged me for a simple request—what font should be used on invoices? Easy enough, I thought. I checked our branding guidelines, found the font, but realized it was a custom font that could cause issues. So, I picked a standard alternative, gave my answer, and moved on.

Then another Head of Solutions, let’s call him John, jumped in. He wanted to tweak the line spacing — just a small adjustment, 0.5 or so. The developer made the change. But then something else looked off. More changes. More tweaks. The back-and-forth continued for hours.

By the time I logged off for the night, I assumed it was sorted. But the next morning, chaos erupted.

A furious salesperson stormed over to my desk: “What the f*ck is going on with the invoices? My customers can’t work like this!”

We checked, and sure enough—every invoice had just one line per page. Even the shortest invoices were now hundreds of pages long.

This is pretty much how all our invoices looked like the next morning. By the way, this here is pdfviewer.com/ — a tool we developed to easily embed PDF viewing functionality into any web application. Check it out.

We scrambled to fix it. But by then, over a thousand orders had already been processed with broken invoices. Customers were frustrated. Support was overwhelmed. And all of this because of… line spacing?

The Real Question: Should You Even Be Managing This?

Here’s what I learned that day: Invoice generation is NOT where a business should be spending its IT resources.

Our company’s real value was extending the life of electronic devices, not fighting invoice formatting battles. Yet, we burned IT hours and resources on something that should have just worked.

Could we have built our own invoice management system? Sure. We had the talent. But was it the best use of our time? Absolutely not.

This is why businesses need flexible, API-driven solutions for document generation. Hard-coded templates, IT bottlenecks, and last-minute formatting tweaks should never delay shipments or frustrate customers.

So, before you go down the path of building invoice generation in-house, ask yourself: is this really where you want to invest your time?

I’ve been there. And trust me—you don’t.