POST /api/auth/register
Parameter | Type | Description |
---|---|---|
username |
string |
Required. |
password |
string |
Required. |
userType |
buyer or seller |
Required. |
if User already exists then this response will be genrated
else
response will be registered users json data
POST /api/auth/login
Parameter | Type | Description |
---|---|---|
username |
string |
Required |
password |
string |
Required |
userType |
buyer or seller |
Required |
is login credentials are right then this response will be generated
else
this response will be generated ie.invalid credentials
GET /api/buyer/list-of-sellers
this request Requires jwt token of logged in user in headers ie logged in buyer to verify the user using middleware
the successful response is this
GET /api/buyer/seller-catalog/:seller_id
Parameter | Type | Description |
---|---|---|
seller_id |
string |
Required |
this request will give response of catalog of the seller corrosponding to that seller_id.this request also takes jwt token in headers.
POST /api/buyer/create-order/:seller_id
this request will create order corrosponding to seller id and takes jwt token in headers and response is order list.
POST /api/seller/create-catalog
this request takes productName,price and category object and add these products to catalog. and response is newly added product.
POST /api/seller/orders
this request show all orders placed by all the buyers.
it takes jwt token of logged in seller and response is list of orders.
Clone the project
git clone https://github.com/FlowerC9/E-commerce_Rest_API.git
Go to the project directory
cd E-commerce_Rest_API
Install dependencies
npm install
Start the server
npm run dev