Skip to content

FlowerC9/E-commerce_Rest_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ecommerce_Rest_API

API Reference

Register User

  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 Screenshot 2023-12-16 162436 else Screenshot 2023-12-16 162556 response will be registered users json data

Login

  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 Screenshot 2023-12-16 162703 else Screenshot 2023-12-16 162812 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 Screenshot 2023-12-16 163202

GET /api/buyer/seller-catalog/:seller_id
Parameter Type Description
seller_id string Required

Screenshot 2023-12-16 163243 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. Screenshot 2023-12-16 163338

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. Screenshot 2023-12-16 163419

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. Screenshot 2023-12-16 163503

Run Locally

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published