#LMD E-commerce System
Authentication using jwt.
POST /api/customersregister a new customer Customers ApiPOST /api/vendorsregister a new vendor Vendors ApiPOST /api/authLogin to your accountGET /api/users/meAuthorize user
Content-Type = application/json{
"email":"mkassim@gmail.com",
"password":"Kassim@1234"
}response with the jwt TokenContent-Type = application/json
x-auth-token = `jwt access token` false error if user authorizedGET /api/customers
return Array of customers objects.
[
{
"_id": "5cb0963bd8d27a37a4072790",
"fName": "mark",
"lName": "3abslam",
"phone": 123456789,
"birthDate": "1996-01-10T22:00:00.000Z",
"imageURL": "url",
"address": [
{
"_id": "5cb0963bd8d27a37a4072791",
"address1": "egypt",
"address2": "tanta",
"state": "tanta",
"city": "ta",
"zip": "t"
}
],
},...
]POST /api/customers
Content-Type = application/json{
"address": {
"address1": "egypt",
"address2": "tanta",
"state": "tanta",
"city": "ta",
"zip": "t"
},
"fName":"mark",
"lName":"3abslam",
"phone":"01199999999",
"birthDate":"1-11-1996",
"email":"mark@gmail.com",
"password":"Mark@1234",
"imageURL":"https://via.placeholder.com/350x150"
}return Array of customers objects.
response with the created customerDELETE /api/customers/:id
Content-Type = application/jsonreturn Array of customers objects.
response with the deleted customerGET /api/vendors/GET /api/vendors/:idPOST /api/vendors/DELETE /api/vendors/:id
###Create Vendor
Content-Type = application/json{
"address": {
"address1": "egypt",
"address2": "tanta",
"state": "tanta",
"city": "ta",
"zip": "t"
},
"name": "Maha",
"category": "food",
"phone": 1234,
"vendorType": "FOOD",
"imageURL": "dfdsf",
"email":"maha@maha.com",
"password":"Maha@1234"
}response with the created customerEvery vendor has his own list of products
GET /api/productsreturn all the lists of products for all vendorsGET /api/products/:idreturn products list of the specified vendorPOST /api/productsDELETE /api/products/:iddelete products list of the specified vendor
Content-Type = application/json{ "vendorProducts": [{
"name": "tshirt",
"category": "ayhaga",
"description": "good quality",
"rate": "5",
"price": "100",
"specs": "pplister",
"quantity": "10",
"unit": "LE",
"sku": "asd55",
"barCode": "sadsad",
"productId": "12",
"options": {
"image": "https://i.pinimg.com/originals/35/9e/97/359e972e525a703306e909e642e077c8.jpg",
"color": "Yellow",
"size": "21"}
},...]
}response with the created product list