In the contract you will find different attributes in relation if you are the seller or the buyer.
name is the name that the seller assigned to the contract.
description is a short description of what the contract should offer.
status explicit the condition of the contract. It can be:
- idle: the contract can be retrieved only by the creator. The creator can modify the different attributes and generate the preferred agreement that it wishes to obtain;
- commit: the contract is ready to be published;
- published: the contract has been published. The buyers can buy the contracts and the creator of the contract cannot modify it anymore;
- unpublish: the contract is ready to be unpublished;
- unpublished: the contract is not anymore public. The users that have previously accepted the contract can continue to use the contract until the period expiration.
seller: Identifier of the seller of the contract.
parent: Type, version and id of the object where the contract is assigned.
type: Type of the contract. It can be:
- single_payment: contract can be bought and it will be assigned to the buyer for forever. Single payment should have the attribute "payment", it cannot have the attribute "subscription".
- subscription : subscription will be renewed in the time span decided by the seller. Single payment should have the attribute "subscription", it cannot have the attribute "payment".
on_sell: Boolean that denotes if the object is on sell or not.
contract_group: Identifier of the contract assigned by the seller. It can be used to assign different type of contracts (for example one with more installation services and one with less).
bought: a boolean that returns if the contract has been acquired or not.
buyer: list of ids ("global", users or usergroups) that can retrieve and accept the contracts when it will be published.
Payment attribute is an hash used for single_payment contracts. It has the following values:
price: Cost of the object when it is bought once.
discount: Discount percentage valid from a start to an end period. The percentate value should be between 1 and 100.
Subscription attribute is an hash used for subscription contracts. It has the following values:
price: Cost of the object paid at the begin of the month. date_last_payment: Date of when the last payment was done. date_next_payment: Date of when the next payment is due date_last_update: Date of when the state was last udpated monthly: If true, the subscription will be renewed monthly day_period: If monthly is false, a day_period (between 1 or 30) can be specified in this attribute end_contract: Date of when the contract will expire rate_event: A value in seconds of how often a state should be updated
If a subscription is provided with a rate_event, then the success_rate can be retrieved from this attribute. This has three values:
total: How often the contract was fulfilled from the publication of the contract last_period: How often the contract was fulfilled in the last period of the subscription this_period: How often the contract was fulfilled in the current period of the subscription
These are the ACL restrictions and permissions that will be assigned to the user that accept the contract.
Restriction value cannot be assigned to applications' contracts.