This is how I envision the Contract API in OpenBazaar.
Disclaimer: I may not be staying completely within the bounds of Ricardian Contracts; I am prioritizing flexibility and ease of use above formality, because I would like to have a working prototype soon, and polish it for FOSDEM. The structure will accept plugins that will ultimately enable OpenBazaar to support diverse kinds of business.
The new Contract API comprises of 3 major types of Classes: ContractParts, Contracts and Trades. Here's a breakdown:
A ContractPart is the smallest autonomous part of a contract, and as such, it is meant to be used as a building block. Each ContractPart represents exactly one step towards the materialization of the contract. Subclasses of ContractPart will be tailored to the semantic role of the relevant part/step. So, there can be a BuyerContractPart, a SellerContractPart, a NotaryContractPart, etc. Each such subclass shall be mapped to a JSON object in a 1-1 way. For this