This page describes how to check the Offer state: how to know when an offer is sold, etc.
The domain of
Offerlooks like this:
- This is the Offer that is put on sale, it can be an AUCTION or SALE.
- The Offer can be
- for one non-fungible item; OR
- for one or more fungible items.
- Such a multi-item offer can be bought multiple times (by the same person, or by different persons)
- This represents the BUYING or CANCELING of one item of the offer.
- A Fulfillment can have the following types:
- REIMBURSEMENT: an Offer was canceled and the item is returned to the seller
- PURCHASE: an item in the Offer was bought and the item is send to the buyer
- TERMINATION: the offer was terminated by a Market Admin
- Because of the multi-item offers, an Offer can be linked with multiple Fulfillments (it can be bought multiple times)
Fulfillmentlink has the following consequences:
- To know the state of the
Offer, an aggregation needs to be done on the state of the different
Fulfillments(if there are multiple):
- For example: for one
Offerwith multiple items, it is possible that there are:
- 2 Fulfillments of type PURCHASE
- 3 Fulfillments of type REIMBURSEMENT
- If you want to show an aggregated state to an end-user, you will need to decide on how to visually represent this scenario.
Offer state diagram
As mentioned, to know the true state of an offer (e.g. to know if it is sold or not), the state of the underlying Fulfillments have to be taken into account. To do this, two methods can be used:
GET /fulfillmentsfor the
Offerand check the
- Use the
- These represent the respective underlying Fulfillment states.
For example, our own Marketplace-UI uses the following logic: