Before you invest time on Upwork, you should invest time reading the threads in the New to Upwork community discussions sections. Find out how to get paid and what happens when there is a dispute so that you can protect yourself from these types of situations.
The outcome of your current situation will depend on the type of contract you had, whether or not you followed the proper procedures and various other factors.
Do not take this personally.
Most Upwork clients are great people and behave ethically.
There ARE some bad clients and bad people who use the site. They will hire freelancers to do work for them and try to get their money back for no reason other than they think they can get free work and free money that way.
When a client hires you and then tries to get a refund, it doesn't mean you did something wrong. It is possible that you made a tactical error or otherwise did something wrong. But it is also possible that the client is simply a scoundrel.
Tonya provided great advice. The more you know about how Upwork functions, the more you can protect yourself from the small percentage of clients who try to get work done free by manipulating the system In ways that were never intended.
If you did the work as agreed, you should be paid as agreed. You should not agree to any refund, in which case you may have to get Upwork mediation involved. Let that process play itself out; you might be able to reach a compromise with the client.
If both of you refuse any compromise, under a fixed price contract with dishonest or clueless clients your best hope (but not assurance) of getting paid in full is to go to arbitration. If the client agrees to go to arbitration, you will have to pay $291 and the client will have to pay $291. If the client refuses to pay the $291, the dispute will automatically be decided in your favor by Upwork. And vice versa.
Payments for your work are far less subject to the whims of dishonest or clueless clients if you properly do your contracts under Upwork’s hourly rules, but fixed rates make more sense for some projects.
This rarely happens to me, but it has. And every time Upwork's payment protection has saved me. So no worries. But do yourself a favor and sudy how payment protection works so you know when you're safe. The only times I ended up losing out are because I wasn't paying attention to the details of an offer or when I was competing against other freelancers for a contract without realizing it. So IMO it's a really good idea to communicate with the client prior to accepting an offer. If they blindly send an offer make sure you check it out to ensure that they haven't inserted a "test project" milestone without explicitly mentioning this to you. TLDR: read about payment protection and always read the details of your offers. Good luck!
You have the option of telling the client that you don't want to dispute this, and that you would prefer to keep the finished product for yourself. If the client does not pay for it fully, it belongs to you.
You can post it as a portfolio item. You can issue a takedown notice if the client posts it online anywhere. The client could be in a lot of trouble if he tired to post work content that does not belong to him.