Assuming this is the first time you have been fired or had performance issues, you start by accentuating the positive, perhaps by saying something like.
"I've worked for x companies and have always been a high performer.....", perhaps give examples.
Then you admit that not every job is a perfect fit.
"Sometimes, as in any relationship, things just don't work out. "
Without bashing your company, you make your defense
"In my mind, I did everything I understood I should do. I believe that I behaved ethically and I am comfortable with my behavior; I have no regrets and harbor no ill will against my previous employer. I believe that it was all an unfortunate misunderstanding."
Then you affirm that you have learned from the situation and it will not be repeated;
"In the future, I will make sure that all of my transactions are completely open, so there will be no room for miscommunication. "
Such an approach, I believe, goes a long way to diffuse the situation.
Under no circumstances let yourself be roped into bashing your previous company or managers. There is no scenario in which that helps your case.