What is meant by “the Book of Allah” in this ḥadith is His ruling, and that, by extension, includes the Sunnah of Allah’s Messenger ﷺ. Although such a condition is void, the sale itself is not invalidated. The proof is the case of Barīrah: when her seller stipulated that her walāʾ (the right of succession owed by a freed slave) would remain his should she be emancipated, the Prophet ﷺ annulled the condition but upheld the contract, declaring, “The walāʾ belongs only to the one who sets the slave free.”
Accordingly, every Muslim who engages in buying and selling ought to learn the rulings of commerce—what conditions are valid and what conditions are not—so that he may transact with clear insight and so that quarrels and disputes among Muslims may cease. Most of these conflicts arise because one or both parties are ignorant of the rules of sale and because they introduce corrupt stipulations into their contracts.