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.
bayhaqi:20345Abū al-Ḥasan ʿAlī b. Aḥmad b. ʿAbdān > Aḥmad b. ʿUbayd al-Ṣaffār > Ismāʿīl b. al-Faḍl > Aḥmad b. ʿĪsá > Ibn Wahb > ʿAmr b. al-Ḥārith > Bukayr b. ʿAbdullāh > Yazīd b. Abū Ḥabīb > Maslamah b. Mukhallad > Qām > Zayd b. Thābit > Yā Ibn ʿAmmī Ukrihnā > al-Qaḍāʾ

[Machine] Zaid, decide according to the book of Allah. If it is not found in the book of Allah, then according to the tradition of the Prophet. If it is not found in the tradition of the Prophet, then consult the people of knowledge and strive and choose for yourself, and there is no problem.  

البيهقي:٢٠٣٤٥أَخْبَرَنَا أَبُو الْحَسَنِ عَلِيُّ بْنُ أَحْمَدَ بْنِ عَبْدَانَ أنبأ أَحْمَدُ بْنُ عُبَيْدٍ الصَّفَّارُ ثنا إِسْمَاعِيلُ بْنُ الْفَضْلِ ثنا أَحْمَدُ بْنُ عِيسَى ثنا ابْنُ وَهْبٍ أَخْبَرَنِي عَمْرُو بْنُ الْحَارِثِ أَنَّ بُكَيْرَ بْنَ عَبْدِ اللهِ أَخْبَرَهُ عَنْ يَزِيدَ بْنِ أَبِي حَبِيبٍ عَنْ مَسْلَمَةَ بْنِ مُخَلَّدٍ أَنَّهُ قَامَ عَلَى زَيْدِ بْنِ ثَابِتٍ فَقَالَ يَا ابْنَ عَمِّي أُكْرِهْنَا عَلَى الْقَضَاءِ فَقَالَ

زَيْدٌ اقْضِ بِكِتَابِ اللهِ ﷻ فَإِنْ لَمْ يَكُنْ فِي كِتَابِ اللهِ فَفِي سُنَّةِ النَّبِيِّ ﷺ فَإِنْ لَمْ يَكُنْ فِي سُنَّةِ النَّبِيِّ ﷺ فَادْعُ أَهْلَ الرَّأْيِ ثُمَّ اجْتَهِدْ وَاخْتَرْ لِنَفْسِكَ وَلَا حَرَجَ