A trove of hidden documents detailing how Facebook made money off children will be made public, a federal judge ruled late Monday in response to requests from Reveal.

A glimpse into the soon-to-be-released records shows Facebook’s own employees worried they were bamboozling children who racked up hundreds, and sometimes even thousands, of dollars in game charges. And the company failed to provide an effective way for unsuspecting parents to dispute the massive charges, according to internal Facebook records.

The documents are part of a 2012 class-action lawsuit against the social media giant that claimed it inappropriately profited from business transactions with children.

The lead plaintiff in the case was a child who used his mother’s credit card to pay $20 while playing a game on Facebook. The child, referred to as “I.B.” in the case, did not know the social media giant had stored his mom’s payment information. As he continued to play the game, Ninja Saga, Facebook continued to charge his mom’s credit card, racking up several hundred dollars in just a few weeks.

The child “believed these purchases were being made with virtual currency, and that his mother’s credit card was not being charged for these purchases,” according to a previous ruling by U.S. District Court Judge Beth Freeman.

When the bill came, his mom requested Facebook refund the money, saying she never authorized any charges beyond the original $20. But the company never refunded any money, forcing the family to file a lawsuit in pursuit of a refund.

The court documents, which have remained hidden for years, came to light after Reveal from The Center for Investigative Reporting intervened last year to request the records be unsealed. There is increased public interest in Facebook’s business practices in the wake of high-profile scandals, including fake news published on the site and the leaking of user data. On Monday, the court agreed to unseal some of the records.

Facebook has 10 days to make the bulk of the documents – more than a hundred pages – available to the public, according to the order.

Reveal’s legal effort in the case has already uncovered some of the previously sealed information. Four documents that were either originally sealed or redacted were made partially available to Reveal in October. The documents show widespread confusion by children and their parents, who didn’t understand Facebook continued to charge them as they played games.

Facebook employees began voicing their concerns that people were being charged without their knowledge. The social media company decided to analyze one of the most popular games of the time, Angry Birds, and discovered the average age of people playing it on Facebook was 5 years old, according to newly revealed information.

“In nearly all cases the parents knew their child was playing Angry Birds, but didn’t think the child would be allowed to buy anything without their password or authorization first,” according to an internal Facebook memo. The memo noted that on other platforms, such as Apple’s iPhone, people were required to reauthorize additional purchases, such as by re-entering a password.

A Facebook employee noted that children were likely to be confused by the in-game purchases because it “doesn’t necessarily look like real money to a minor.”

Yet the company continued to deny refunds to children, profiting from their confusion.

In one of the unsealed documents, two Facebook employees deny a refund request from a child whom they refer to as a “whale” – a term coined by the casino industry to describe profligate spenders. The child had entered a credit card number to play a game, and in about two weeks racked up thousands of dollars in charges, according to an excerpt of messages between two employees at the social media giant.

Gillian: Would you refund this whale ticket? User is disputing ALL charges…

Michael: What’s the users total lifetime spend?

Gillian: It’s $6,545 – but card was just added on Sept. 2. They are disputing all of it I believe. That user looks underage as well. Well, maybe not under 13.

Michael: Is the user writing in a parent, or is this user a 13ish year old

Gillian: It’s a 13ish yr old. says its 15. looks a bit younger. she* not its. Lol.

Michael: … I wouldn’t refund

Gillian: Oh that’s fine. cool. agreed. just double checking

Facebook often failed to send receipts for these purchases, and links on the company’s website to dispute charges frequently failed to work, according to court records. A Facebook employee is quoted describing their attempt to dispute a charge.

“I was stuck in an infinite-loop of questions just today,” the employee wrote. “It feels like the form is this Frankenstein beast that we’ve bolted together.”

In unsealing some of the documents in the case, the judge wrote, “this information would be of great public interest, particularly since it relates specifically to Facebook’s transactions with minors.”

“I’m glad to hear the public will get to learn more about this matter,” said attorney Ben Edelman, who represented the children and parents.

The two sides settled the lawsuit in 2016. Edelman declined to say more, citing a confidentiality clause in the settlement.

The judge agreed with Facebook’s request to keep some of the records sealed, saying certain records contained information that would cause the social media giant harm, outweighing the public benefit.

In response to a request for an interview, Facebook provided a one-sentence statement: “We appreciate the court’s careful review of these materials.”

We’ll continue to cover this story as the Facebook documents are made public in the coming days.

Nathan Halverson can be reached at nhalverson@revealnews.org. Follow him on Twitter: @eWords.

Everyone should have access to the facts. Yes, I want to help!