The invoices were made during the time you were tax resident in country A but you didn’t take the money from the Xolo partnership.
Usually in the country where you were tax resident, but it depends on where you were tax resident. Most countries have a principle called “constructive receipt” (google it).
Since the money was yours and you could have paid it out any time, the tax was due already that year. If it was your decision whether you wanted to pay the money out or not, then you already had control of the money, so then you also had to pay the tax.
But of course, there may be some countries that don’t have such a rule and which will only tax money that is actually paid out, especially countries with territorial taxation, I would imagine.
I am a bit skeptical of companies like Xolo:
They have a partnership agreement with you, meaning they are only responsible for the billing. The way I understand it, they would in no way offer liability protection. They are basically like a freelancer platform like Upwork, the only difference being that they don’t match customers and freelancers and that they charge the company on your behalf. Maybe PayPal would be a better analogy.
So if something goes wrong, they can always point their finger at you, nothing will happen to them. They also explicitly state that they won’t help you with your taxes. They give you a report of any amounts paid out and that’s all.
So many people think they only pay taxes on what they paid out because the money is “Xolo’s,” but it’s not - the way I understand it. The money was yours all along, they are only some sort of
escrow service, if you like.
For that reason I also don’t think the payments from Xolo would classify as capital gains! It can’t be a dividend since you’re not a shareholder. I’m pretty sure any payments from Xolo must be classified as freelance/business income. I don’t see how it could be anything else.
But maybe someone else has more knowledge about this topic.