The Risāla by ash-Shafi'i (d. 820), full title Kitab ar-Risāla fī Uṣūl al-Fiqh (Arabic: كتاب الرسالة في أصول الفقه "book of the communication on the foundations of comprehension (i.e. Islamic jurisprudence)") is a seminal text on the principles of Islamic jurisprudence
The word risāla in Arabic means a "message" or "letter, communication". Shafi'i's treatise received its name owing to a traditional, though unverified, story that Shafi'i composed the work in response to a request from a leading traditionist in Basra, ‘Abd al-Raḥmān bin Mahdī; the story goes that Ibn Mahdī wanted Shafi'i to explain the legal significance of the Quran and the sunna, and the Risāla was Shafi'i's response.
In this work, al-Shafi'i is said to have outlined four sources of Islamic law, though this division based on four has been attributed to later commentators on the work rather than to Shafi'i himself. Al-Shafi'i is said he revised and re-read Al-Risala four hundred times.
The above list of contents follows Khadduri's translation. However, Khadduri rearranged the treatise in two places. Khadduri's chapters 8 and 3 (in that order) both follow Shafi'i's chapter on Traditions in the original. Khadduri rearranged those chapters because they did "not appear to fit into the logical order of the book." Therefore, if one wishes to read Khadduri's translation while following Shafi'i's original arrangement, one can read the chapters in the following order: 1, 2, 4, 5, 6, 7, 9, 8, 3, 10, 11, 12, 13, 14, 15.
The primary sources of law attributed to Shafi'is book are the Qur'an and the prophetic tradition. Most Muslim commentators have also referred to Shafi'is sections on consensus and analogical reason as comprising legal sources.
On the question of consensus, Shafi'i obligated affirmation of all living Muslims - both the learned and the laymen - in order to declare a true consensus. Later followers of his school considered this to be practically impossible, and thus expanded upon the definition.