Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:4:135

O you who have believed, be persistently standing firm in justice, witnesses for Allah, even if it be against yourselves or parents and relatives. Whether one is rich or poor, Allah is more worthy of both. So follow not ˹personal˺ inclination, lest you not be just. And if you distort ˹your testimony˺ or refuse ˹to give it˺, then indeed Allah is ever, with what you do, Acquainted.  

O you who believe, be upright in justice; witnesses, of the truth, for God, even though it, the witnessing, be against yourselves, so be witness against them ˹your selves˺ by affirming the truth and not concealing it; or, against, parents and kinsmen, whether the person, witnessed against, be rich or poor; God is closer to the two, than you and He has better knowledge of what is good for them. So do not follow any whim, in your testimonies by being partial to the rich one, seeking his pleasure, or ˹by being partial˺ to the poor one out of compassion for him, lest you swerve, so that you do not incline away from the truth, for if you twist (a variant reading ˹for talwūw˺ has talū) ˹if˺ you distort your testimony, or refrain, from giving it, surely God is ever aware of what you do, and will requite you accordingly.
القرآن:٤:١٣٥

يَا أَيُّهَا الَّذِينَ آمَنُوا كُونُوا قَوَّامِينَ بِالْقِسْطِ شُهَدَاءَ لِلَّهِ وَلَوْ عَلَىٰ أَنْفُسِكُمْ أَوِ الْوَالِدَيْنِ وَالْأَقْرَبِينَ ۚ إِنْ يَكُنْ غَنِيًّا أَوْ فَقِيرًا فَاللَّهُ أَوْلَىٰ بِهِمَا ۖ فَلَا تَتَّبِعُوا الْهَوَىٰ أَنْ تَعْدِلُوا ۚ وَإِنْ تَلْوُوا أَوْ تُعْرِضُوا فَإِنَّ اللَّهَ كَانَ بِمَا تَعْمَلُونَ خَبِيرًا  

{يا أيها الذين آمنوا كونوا قوامين} قائمين {بالقسط} بالعدل {شهداء} بالحق {لله ولو} كانت الشهادة {على أنفسكم} فاشهدوا عليها بأن تقروا بالحق ولا تكتموه {أو} على {الوالدين والأقربين إن يكن} المشهود عليه {غنيّا أو فقيرا فالله أولى بهما} منكم وأعلم بمصالحهما {فلا تتَّبعوا الهوى} في شهادتكم بأن تحابوا الغني لرضاه أو الفقير رحمةّ له لـ {أن} لا {تعدلوا} تميلوا عن الحق {وإن تلووا} تحرفوا الشهادة وفي قراءة بحذف الواو الأولى تخفيفا {أو تعرضوا} عن أدائها {فإن الله كان بما تعملون خبيرا} فيجازيكم به.