Following are the different entities in the system:
Two types: buyers and sellers A user can sign up as a buyer or as a seller
A catalog belongs to a seller One seller can have one catalog A catalog consists of Products
A product has a name and a price
An order can be created by a buyer to purchase items from a seller's catalog An order consists of a list of products
Following are a few examples of the API endpoints you should expose.
POST /api/auth/register
Register a user (accept username, password, type of user - buyer/seller)
POST /api/auth/login
Let a previously registered user log in (e.g. retrieve authentication token)
GET /api/buyer/list-of-sellers
Get a list of all sellers
GET /api/buyer/seller-catalog/:seller_id
Get the catalog of a seller by seller_id
POST /api/buyer/create-order/:seller_id
Send a list of items to create an order for seller with id = seller_id
POST /api/seller/create-catalog
Send a list of items to create a catalog for a seller
GET /api/seller/orders
Retrieve the list of orders received by a seller