That line will not work.
1. GetInboxHeaderInfo() require you to send the index of the mail to get any info. The player also have to be at the mail box.
2. AuctionHouse() is not a valid API function i think.
local invoiceType, playerName, sender, subject, money
for i=1, GetInboxNumItems() do
invoiceType, itemName, playerName = GetInboxInvoiceInfo(i);
if invoiceType and invoiceType == "seller" then
_, _, sender, subject, money = GetInboxHeaderInfo(i);
print(("%d: %s just bought %s for %s!"):format(i, playerName, itemName, GetCoinTextureString(money)))
You can checkout MySales to see how it tracks auction sales.