File your return correctly claiming your child in accordance to the court order. You will need to file a paper return since your spouse already filed claiming your child.
The IRS will process your return and send you your refund, in the normal time. You will receive a letter from the IRS, stating that your child was claimed on another return, telling you that if you made a mistake to file an amended return and if you didn't make a mistake to do nothing.
The other party will get the same letter you did. If one of you doesn't file an amended return, unclaiming the child, the next letter, from the IRS, will require you to provide proof. Be sure to reply in a timely manner.
**Mark the post that answers your question by clicking on "Mark as Best Answer"
"I have already received my refund". What does that mean? You received a refund that did not include claiming your child; or something else?
As the other reply/answer indicates, you do NOT send any info to the IRS at this time. You just file a paper return, claiming your child. The IRS will sort it out later.
But there are several things you need to know, now:
1. The IRS will give NO credence to your court order. They will not even consider it, unless it was dated before 2009. They go by their rules (more later on what those rules are). Your only remedy against the ex is to take her/him back to court for sanctions
2. For tax purposes, there is no such thing as joint custody, regardless of what your legal agreement says. The requirement, to be custodial parent, is that the child live with you MORE than 50% of the time. One of you has to be the custodial parent and the other the non-custodial parent. The IRS goes by physical custody, not legal custody. Yes, the IRS expects you to count the numbers of nights the child sleeps at each parent's home.
3. The custodial parent has first priority on claiming the children on her taxes; regardless of the amount of support provided by the non-custodial parent. The IRS goes by physical custody, not legal custody. The non-custodial parent can only claim the child as a dependent if the custodial parent gives permission (on form 8332) or if it's spelled out in a pre 2009 divorce decree. Even if a divorce decree, dated after 2008, gives the non-custodial parent the right to claim the child, he must still get form 8332 from the custodial parent. A properly worded decree should require her to provide that form. https://www.irs.gov/pub/irs-pdf/f8332.pdf
4. There is a special rule in the case of divorced & separated (including never married) parents. When the non-custodial parent is claiming the child as a dependent/exemption/child tax credit; the custodial parent is still allowed to claim the same child for Earned Income Credit, Head of Household filing status, and day care credit. This "splitting of the child" is not available to parents who lived together at any time during the last 6 months of the year; then only one of you can claim the child for any tax reasons. The tax benefits may not be split in any other manner.
Note in particular that the non-custodial parent can never claim the Earned Income Credit, Head of Household filing status or the day care credit, based on that child, even when the custodial parent has released the dependency to him.
So, could the problem be that you claimed one, or more, of those items you are not allowed.
Scroll down to "Children of divorced or separated parents (or parents who live apart)"