In this conversation:

" Man: Our basketball team is playing in the finals but I don’t have a ticket. I guess I’ll just watch it on TV. Do you want to come over?
Woman: Actually I have a ticket. But I’m not feeling well. You can have it for what it cost me."

Is the last sentence right? If so, what does it mean?

I got this conversation from a listening test. Actually, I think the last sentence sounds like "you can have it for what it costs to me." Am I right? If so, what do "cost" and "cost to" mean?

This is my first post here. Thank you!
The sentence is correct.

It means that she will sell him the ticket for the price that she paid for it.

Cost = price/what you must pay for something.

I can't think of any situation that "costs to" would be used.
I see! Thank you very much!