For us devout members of that distinctive American subculture known as procrastinators, mid-April can feel like a recurring nightmare. Every year, the federal tax deadline sneaks up like some latent-effect scorching-hot pepper. (This year, it’s April 18, or in other words: Monday. Yikes!) And suddenly we find ourselves scrambling for any form of relief from the oncoming financial burn.

Can salvation be found in a shoebox full of crinkly restaurant receipts? Possibly.

Dining out is a big part of doing business in this country, even if food and drink have very little to do with your specific business. As such, some of these meals can be deducted from your annual obligations to Uncle Sam. Of course, there are strict rules about doing so. And like other parts of the U.S. tax code, it’s about as clear as day-old deli coffee.

“The rules are very confusing,” says Jackie Perlman, principal tax research analyst at the Tax Institute at H&R Block, who nonetheless agreed to guide us through the basics. (In some cases below, we’ll use a restaurant-industry example, but the same could apply to basically any business.)

Whether you are self-employed or an employee, the rules for deducting meals are very similar, though the paperwork is a bit different in each case. “If I am a business owner, there are two very broad reasons that I can deduct my dining or my food,” Perlman explains. “One is that I am traveling for business, and the other is that I am entertaining a client or potential client.”

Dining on the Road

Let’s start with travel. Generally, independent businesspeople can deduct any meal while on the road at some significant distance from his or her “tax home,” Perlman says. (That’s tax lingo for basically whatever city or town where your business is usually located.) This gets tricky, however, when your place of business keeps moving, like with traveling nurses or construction workers, who hop from city to city for separate months-long stints throughout the year. “There are many complicated court cases with that,” Perlman notes.

More often than not, however, even jet-setting entrepreneurs have some sort of homebase. Say you’re an independent restaurateur with multiple locations in multiple cities. Maybe you have a restaurant in New York, and that’s where you spend most of your time and where you’re registered to vote. But you also have restaurants in Los Angeles and Chicago, where you travel several times a year to check on things. In that case, your meals in L.A. and Chicago would be deductible; New York not so much. Unless, of course, you’re only dining in your own restaurants. In which case, you’d be eating that expense. Literally.

Dining With Clients

Taking employees or clients out to eat is also a potential deduction, albeit limited to 50 percent of the final bill, under federal rules. Another catch: This more social sort of breaking-bread ritual needs to be “ordinary and necessary” (more tax talk) in your line of work, Perlman notes: “If it’s typical for my industry to do certain things, then those meals are deductible.”

Say you own an Italian restaurant but your next venture is more of a taco joint. Enlisting your top kitchen lieutenants or trusted purveyors in a cross-city taco crawl could be reasonably explained as standard research and development toward that next venture.

“If I go out today and have tacos for lunch, that is not ordinary and necessary for my line of work,” says the tax analyst, “but it could be for yours.”

Dining With Proper Documentation

Perhaps the most crucial element of successfully deducting meals on your taxes is keeping good records. And simply hanging onto a bunch of restaurant receipts doesn’t always cut it. It’s also important to jot down additional details — particularly who you dined with and “what was the business purpose of being with these people,” Perlman says.

Here, the tax analyst invokes yet another bit of jargon: “contemporaneous.By that, she means “writing things down as they happen.” Sticking with the taco-crawl example quickly: “You are considering doing something with tacos, and it’s necessary for you to go out with some other colleagues who have done this and you go to a restaurant — you’re writing all this down, so if you ever have to explain to the IRS or the tax court, you can explain exactly what you did this day and why,” Perlman says.

Emailing those details to yourself is one way to accomplish this in a properly time-stamped and easily searchable manner. But what about Instagram? Taking photos of food is certainly “ordinary” and arguably “necessary” in the restaurant industry. Could colorful taco snapshots help make your case with the IRS? “In of itself, no,” Perlman says, “but in conjunction with other record-keeping, yes.”

Dining Toward a Higher Deduction

So what if you’re not the self-employed owner of this restaurant or other business? Maybe you’re the chef or sous chef, a regular old employee. Maybe you’re charged with developing the menu for this new taco joint out of your own pocket, and organizing a taco crawl is similarly “ordinary and necessary” to do it right. Is your own R&D mission also deductible? Maybe.

While the criteria for justifying these deductions is pretty much the same, employees are required to “jump through some extra hoops,” Perlman explains. Make that more of a pole vault, really. For employees, business expenses are categorized under miscellaneous itemized deductions — and only the expenses that are more than 2% of your adjusted gross income are deductible. And for those costs to even qualify, the deductible total of all itemized expenses must exceed the standard deduction granted to all individual taxpayers. For a single taxpayer in 2016, that figure is $6,300.

“That’s a lot of tacos,” Perlman laughs.