-
Notifications
You must be signed in to change notification settings - Fork 4
BUYO API Documentation
Base URL: http://localhost:8080/
Base URL on Amazon server: http://3.138.113.101:8080/
This is backend of a e-commerce product which serves web and android applications.
Once you are inside the backend/product_service folder, install docker and run
docker-compose build
docker-compose up
Web app is available on the base URL, you can query the app with any request tool.
All of the endpoints returns responses in JSON format.
Allows users to signin/signup to the platform using Google Signin.
Endpoint: /google-signin
Method: POST
Authorization: None
Parameters: email=[email protected]&name=erdincoguz&token=HASd879ahs(RECEIVED_TOKEN_FROM_GOOGLE)
Response: `{ "status": { "code": 200, "message": "OK" }, "data": { "userId": 10 }
Deletes a comment from a product.
Endpoint: /comment
Method: DELETE
Authorization: None
Parameters: id=5fcf71186e8db70012a8e2f3
Response: { "status": { "code": 200, "message": "OK" } }
Reports a comment with a message.
Endpoint: /report/comment
Method: POST
Authorization: None
Parameters: commentId=600c42d45b75b5001906d833&message=mymessage
Response: { "status": { "code": 200, "message": "OK" , "commentReportId":"5fcf71186e8db70012a8e2f3"}}
Reports a product with a message.
Endpoint: /report/product
Method: POST
Authorization: None
Parameters: productId=600c42d45b75b5001906d833&message=mymessage
Response: { "status": { "code": 200, "message": "OK" , "productReportId":"5fcf71186e8db70012a8e2f3"}}
Verifies an account with given id and user type.
Endpoint: /account/verify
Method: GET
Authorization: None
Parameters: userType=customer&id=5ffb0ac4d94c150012bf7d3d
Response: { "status": { "code": 200, "message": "OK"}}
Gets user email and send an email to that user for changing his/her password.
Endpoint: /account/forgotPassword
Method: POST
Authorization: None
Parameters: email=[email protected]
Response: { "status": { "code": 200, "message": "OK"}}
Adds an address to a customer. Note: addressTitle must be unique.
Endpoint: /account/address
Method: POST
Authorization: None
Parameters: id=123&address={"addressTitle": "home", "city": "istanbul", "province": "sarıyer", "street": "elm", "address": "dksdssd"}
Response: { "status": { "code": 200, "message": "OK" }}
Updates adress of a customer with given addressTitle.
Endpoint: /account/address
Method: PATCH
Authorization: None
Parameters: id=123&address={"addressTitle": "home", "city": "denizli", "province": "merkez", "street": "elm", "address": "dksdssd"}
Response: { "status": { "code": 200, "message": "OK" }}
Deletes address of a customer with given addressTitle.
Endpoint: /account/address
Method: DELETE
Authorization: None
Parameters: id=123&address={"addressTitle": "home"}
Response: { "status": { "code": 200, "message": "OK" }}
Adds a comment to a product.
Endpoint: /comment
Method: POST
Authorization: None
Parameters: userId=123&productId=123&comment=asdadsdsadas&rating=4.23
Response: { "status": { "code": 200, "message": "OK" }, "data": {"commentId": 324}}
Sorts products according to rating, name and price in ascending or descending order. sortingFactor parameter can be rating, name and price. sortingType can be ascending or descending.
Endpoint: /products
Method: POST
Authorization: None
Parameters: categories=["Kids"]&sortingFactor=rating&subcategory=T-shirt&size=XS&brand=Adidas&color=Blue&sortingType=descending
Response: { status: { code: 200, message: "OK", }, data: { products: []}}
Returns an inspirational quote from a famous, historical person.
Endpoint: /categories
Method: GET
Authorization: None
Parameters: None
Response: { status: { success: true, code: 200 }, data: { categories: [{ name: "Woman", path: "Woman", subcategories: [{ name: "Shoes", path: "Woman,Shoes", subcategories: []}] } ]}}
Gets the products of a category
Endpoint: /products
Method: GET
Authorization: None
Parameters(Query):?categories=["Phones"]
Warning: "filterCriterias" shows that which attributes can we use the current category.
Response:
{
"status": {
"code": 200,
"message": "OK"
},
"data": {
"products": {
"productList": [
{
"category": [
"Electronics",
"Phones"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "5.5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "64 GB"
}
],
"stockValue": 21
},
{
"attributes": [
{
"name": "screenSize",
"value": "5.5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "128 GB"
}
],
"stockValue": 18
}
],
"description": "Uncover the Ultimate Design. Beauty Beyond the Visual",
"name": "Samsung S8",
"price": 2800,
"originalPrice": 3000,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089907472046",
"rating": 4,
"brand": "Samsung",
"vendor": {
"name": "JohnsShop",
"rating": 4.23,
"id": "3129281hasda91892312"
},
"id": "5fe86281a17abd0012d601e6"
},
{
"category": [
"Electronics",
"Phones"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "5.5 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "64 GB"
}
],
"stockValue": 54
},
{
"attributes": [
{
"name": "screenSize",
"value": "5.5 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "128 GB"
}
],
"stockValue": 74
}
],
"description": "Uncover the Ultimate Design. Beauty Beyond the Visual",
"name": "Samsung S9",
"price": 4000,
"originalPrice": 4200,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089907472057",
"rating": 4.4,
"brand": "Samsung",
"vendor": {
"name": "Ahmet",
"rating": 3.22,
"id": "3129281hasda91892312"
},
"id": "5fe86281a17abd0012d601e7"
},
{
"category": [
"Electronics",
"Phones"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "6 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "64 GB"
}
],
"stockValue": 95
},
{
"attributes": [
{
"name": "screenSize",
"value": "6 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "128 GB"
}
],
"stockValue": 95
}
],
"description": "Uncover the Ultimate Design. Beauty Beyond the Visual",
"name": "Samsung S10",
"price": 4500,
"originalPrice": 5000,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089907472078",
"rating": 4.4,
"brand": "Samsung",
"vendor": {
"name": "AyseTeyze",
"rating": 3.21,
"id": "3129281hasda91892312"
},
"id": "5fe86281a17abd0012d601e8"
},
{
"category": [
"Electronics",
"Phones"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "64 GB"
}
],
"stockValue": 47
},
{
"attributes": [
{
"name": "screenSize",
"value": "5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "128 GB"
}
],
"stockValue": 94
}
],
"description": "Uncover the Ultimate Design. Beauty Beyond the Visual",
"name": "Samsung S7",
"price": 4500,
"originalPrice": 5000,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089907472099",
"rating": 3.5,
"brand": "Samsung",
"vendor": {
"name": "JohnsShop",
"rating": 4.23,
"id": "3129281hasda91892312"
},
"id": "5fe86281a17abd0012d601e9"
},
{
"category": [
"Electronics",
"Phones"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "5 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "64 GB"
}
],
"stockValue": 39
},
{
"attributes": [
{
"name": "screenSize",
"value": "5 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "128 GB"
}
],
"stockValue": 23
}
],
"description": "Uncover the Ultimate Design. Beauty Beyond the Visual",
"name": "Iphone 8",
"price": 4700,
"originalPrice": 5000,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/160899074721010",
"rating": 4.8,
"brand": "Apple",
"vendor": {
"name": "Pablos",
"rating": 2.43,
"id": "3129281hasda91892312"
},
"id": "5fe86281a17abd0012d601ea"
},
{
"category": [
"Electronics",
"Phones"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "64 GB"
}
],
"stockValue": 42
},
{
"attributes": [
{
"name": "screenSize",
"value": "5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "128 GB"
}
],
"stockValue": 45
}
],
"description": "Uncover the Ultimate Design. Beauty Beyond the Visual",
"name": "Iphone 6",
"price": 5200,
"originalPrice": 5500,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/160899074721211",
"rating": 4,
"brand": "Apple",
"vendor": {
"name": "Pablos",
"rating": 2.43,
"id": "3129281hasda91892312"
},
"id": "5fe86281a17abd0012d601eb"
}
],
"filterCriterias": [
{
"name": "screenSize",
"displayName": "Screen Size",
"possibleValues": [
"5.5 Inch",
"6 Inch",
"5 Inch"
]
},
{
"name": "RAM",
"displayName": "RAM",
"possibleValues": [
"4 GB",
"8 GB"
]
},
{
"name": "diskSize",
"displayName": "Disk Size",
"possibleValues": [
"64 GB",
"128 GB"
]
}
]
}
}
}
Returns the products whose title is the keyword.
Endpoint: /products
Method: GET
Authorization: None
Parameters(Query): search=cocuk
Response: { status: { code: 200, message: "OK", }, data: { products: [ { category: ["Cocuk", "Erkek Cocuk", "Ic Giyim"], sizes: null, colors: ["Red", "Blue", "White", "Purple", "Orange", "Black"], name: "Erkek Cocuk Pamuklu Atlet 2'li", id: 10001, imageUrl: "https://img-lcwaikiki.mncdn.com/mnresize/230/-/pim/productimages/20201/4041406/l_20201-0w1007z4-jyx_a.jpg", rating: 0.78, price: 22.99, originalPrice: 22.99, brand: "Adidas", stockValue: { Red: 17, Blue: 69, White: 72, Purple: 57, Orange: 71, Black: 44, }, vendor: { name: "Ahmet", rating: 3.22, id: "5823324823csdsadf237"}, }, { category: ["Cocuk", "Kiz Cocuk", "Kazak"], sizes: null, colors: ["Red", "Blue", "White", "Purple", "Orange", "Black", "Grey", "Green"], name: "Kiz Cocuk Kalin Triko Kazak", id: 10002, imageUrl: "https://img-lcwaikiki.mncdn.com/mnresize/230/-/productimages/20192/4/3870373/l_20192-9wp531z4-gzn_a.jpg", rating: 4.92, price: 19.99, originalPrice: 39.99, brand: "Nike", stockValue: { Red: 82, Blue: 37, White: 35, Purple: 15, Orange: 53, Black: 26, Grey: 49, Green: 17, }, vendor: { name: "Ahmet", rating: 3.22, id: "312873128jcds723e2" }, }, ], }, };
Returns the detailed information of a product.
Endpoint: /product
Method: GET
Authorization: None
Parameters(Query): id=5fe86281a17abd0012d601eb
Response:
{
"status": {
"code": 200,
"message": "OK"
},
"data": {
"result": {
"category": [
"Electronics",
"Phones"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "5.5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "64 GB"
}
],
"stockValue": 21
},
{
"attributes": [
{
"name": "screenSize",
"value": "5.5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "128 GB"
}
],
"stockValue": 18
}
],
"description": "Uncover the Ultimate Design. Beauty Beyond the Visual",
"name": "Samsung S8",
"price": 2800,
"originalPrice": 3000,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089907472046",
"rating": 4,
"brand": "Samsung",
"vendor": {
"name": "Pablos",
"rating": 2.43,
"id": "11323123asjdac8a123"
},
"id": "5ff37169542dbb0012339131",
"comments": [
{
"id": "5fe8af602e7b430019d8004c",
"rating": 4.23,
"text": "niceee",
"owner": {
"username": "Koray Cetin",
"email": "[email protected]",
"id": "3129281hasda91892312"
}
}
],
"filterCriterias": [
{
"name": "screenSize",
"displayName": "Screen Size",
"possibleValues": [
"5.5 Inch"
]
},
{
"name": "RAM",
"displayName": "RAM",
"possibleValues": [
"4 GB"
]
},
{
"name": "diskSize",
"displayName": "Disk Size",
"possibleValues": [
"64 GB",
"128 GB"
]
}
]
}
}
}
Triggers the like or dislike event from a user to a product.
Endpoint: /like
Method: POST
Authorization: None
Parameters(Query): customerId=12341&productId=10003
Response: { "status": { "code": 200, "message": "OK" } }
Gets the wishlist of a user.
Endpoint: /wishlist
Method: GET
Authorization: None
Parameters: customerId=12341
Response: { "status": { "code": 200, "message": "OK" }, "data": { "products": [ { "category": [ "Cilt", "Yüz Bakımı", "Yüz Maskesi" ], "sizes": null, "colors": null, "name": "Saf Kil Detoks Maskesi 50 ml", "id": 12312, "imageUrl": "https://img-watsons.mncdn.com/Content/Images/Thumbs/0320616_saf-kil-detoks-maskesi-50-ml.png", "rating": 1.2, "price": 69.95, "originalPrice": 69.95, "brand": "Nike", "stockValue": { "self": 45 }, "vendor": { "name": "AyseTeyze", "rating": 3.21, "id": "3129281hasda91892312" } } ] } }
Gets a customer user's information.
Endpoint: /account
Method: GET
Authorization: None
Parameters(Query): id=1024&userType=customer
Response: {"status": {"code": 200, "message": "OK"}, "data": {"result": {"address": [],"email": "[email protected]", "id": 1024, "password" = "1234", "gender" = "male"}}}
Gets a vendor user's information.
Endpoint: /vendor/vendorlist
Method: GET
Authorization: None
Warning: This endpoint added for development purposes. It makes easy to check vendorId. If you want to create a featureby using vendor list please communicate with backend team
Response: {"status":{"code":200,"message":"OK"},"data":{"result":[{"_id":"600d56a63bf84a001266eda4","name":"JohnsShop","email":"[email protected]","longitude":"41.0082° N","address":"Rumelihisari mah. Cami sk. No:123/32","latitude":"28.9784° E","rating":4.23,"website":"www.johns.com"},{"_id":"600d56a63bf84a001266eda5","name":"Ahmet","email":"[email protected]","longitude":"41.1082° N","address":"Rumelihisari mah. 6. sk. No:123/32","latitude":"28.9284° E","rating":3.22,"website":"www.ahmets.com"},{"_id":"600d56a63bf84a001266eda6","name":"AyseTeyze","email":"[email protected]","address":"Rumelihisari mah. 11. sk. No:123/32","longitude":"41.3082° N","latitude":"28.9484° E","rating":3.21,"website":"www.ayseteyzeshop.com"},{"_id":"600d56a63bf84a001266eda7","name":"Pablos","email":"[email protected]","longitude":"41.6082° N","address":"Rumelihisari mah. 14. sk. No:123/32","latitude":"28.9184° E","rating":2.43,"website":"www.pablos.com"}]}}
Gets a vendor user's information.
Endpoint: /account
Method: GET
Authorization: None
Parameters(Query): id=1024&userType=vendor
Response: {"status": {"code": 200, "message": "OK"}, "data": {"result": {"longitude": "long", "longitude": "lang", "email": "[email protected]", "id": 1024, "password" = "1234", "company" = "vendor's company", "website" = "www.vendor.com",}}}
Performs the login event of a user.
Endpoint: /login
Method: POST
Authorization: None
Parameters(Query): userType=customer&email=[email protected]&password=1234
Response: { "status": { "code": 200, "message": "OK" }, "data": { "userId": 10 } }
Performs the sign-up event for a vendor user.
Endpoint: /signup
Method: POST
Authorization: API key from .env file
**Parameters(Query):**userType=vendor&email=[email protected]&password=1234&longitude=long&latitude=lang&website=website.com&company=company&name=Mark Zuckerberg
Response: { "status": { "code": 200, "message": "OK" }, "data": { "userId": 10 } }
Performs the sign-up event for a customer user.
Endpoint: /signup
Method: POST
Authorization: API key from .env file
Parameters(Query): userType=customer&email=[email protected]&password=1234
Response: { "status": { "code": 200, "message": "OK" }, "data": { "userId": 10 } }
This endpoint is created for internal purposes, it can be used when the database is needed to initialized or reset.
Endpoint: /db/
init
Method: POST
Authorization: API key from .env file
Parameters: None
Response: { "status": { "code": 200, "message": "OK" } }
ProductInfo is an object where the attributes of a product and the quantity of it is defined. Its schema is as follows:
'{"attributes": [Attribute], "quantity": Number}'
where Attribute's schema is:
'{"name": <ATT_NAME>, "value": <ATT_VALUE>}
ATT_NAME: Name of the attribute the product have. E.g. size, color, material, diskSizem, ... ATT_VALUE: The value for the attribute specified. E.g. red, Large, L, wood, 256GB, ...
Below endpoints use the above structure for productInfo objects.
Add a product to customer's cart. Product Info can be created as below:
PRODUCT_INFO =
{"attributes": [{"name": "size","value": "L"},{"name": "color","value": "Blue"}], "quantity": 1}
Endpoint: /cart
Method: POST
Authorization: None
Parameters(Query): customerId=1234567890abc&productId=0987654321abc&productInfo=<PRODUCT_INFO>
Response: { "status": { "code": 200, "message": "OK" } }
Remove a product from customer's cart. Same endpoint as above is used, except the "quantity" field in ProductInfo should be missing when deletion is made. created as below:
PRODUCT_INFO =
{"attributes": [{"name": "size","value": "L"},{"name": "color","value": "Blue"}]}
Endpoint: /cart
Method: POST
Authorization: None
Parameters(Query): customerId=1234567890abc&productId=0987654321abc&productInfo=<PRODUCT_INFO>
Response: { "status": { "code": 200, "message": "OK" } }
Gets all products in a customer's cart. Product Info should be created as below:
Endpoint: /cart
Method: GET
Authorization: None
Parameters(Query): customerId=1234567890abc
Response: { "status": { "code": 200, "message": "OK"}, data: { products } }
Remove all products in a customer's cart.
Endpoint: /cart
Method: DELETE
Authorization: None
Parameters(Query): customerId=1234567890abc
Response: { "status": { "code": 200, "message": "OK"} }
Create an order from the products in the cart.
Endpoint: /order
Method: POST
Authorization: None
Parameters(Query): customerId=1234567890abc&creditCard={"name": "712837123","number": 1234666666667777,"expirationMonth": 10,"expirationYear": 2024,"cvc": 999}&address=ADDLATER
Response: { "status": { "code": 200, "message": "OK" }, data: { cartId: 7821478372, orderedProducts: orderedProducts, unavailableProducts: unavailableProducts, customerId: params.customerId, } }
Get the orders of a vendor, or customer.
Endpoint: /order
Method: GET
Authorization: None
Parameters(Query): id=721837123&userType=customer
Response for customer: { "status": { "code": 200, "message": "OK" }, "data": { orders: orders } }
Response for vendor: { "status": { "code": 200, "message": "OK" }, "data": { orders: orders, totalEarnings: totalEarnings } }
Update the status of the given order.
Available Status for client to use:
- For vendor:
-
- Approved(automatically approved in 5 days)
-
- Shipped(automatically shipped in 1 day)
-
- Cancelled(if not shipped)
- For customer:
-
- Approved(automatically approved in 5 days)
-
- Returned(if the product is delivered)
-
- Cancelled(if not shipped)
- For both(experimental):
-
- Allows any other string, but not sure about its use case.
Endpoint: /order
Method: PATCH
Authorization: None
Parameters(Query): userType=customer&userId=721837123&status=Approved&orderId=6as7dasdh
Response: { "status": { "code": 200, "message": "Order status is successfully changed." } }
Update the status of the given product in an order.
Available Status for client to use:
- For vendor:
-
- Approved(automatically approved in 5 days)
-
- Shipped(automatically shipped in 1 day)
-
- Cancelled(if not shipped)
- For customer:
-
- Approved(automatically approved in 5 days)
-
- Returned(if the product is delivered)
-
- Cancelled(if not shipped)
- For both(experimental):
-
- Allows any other string, but not sure about its use case.
Endpoint: /order
Method: PATCH
Authorization: None
Parameters(Query): userType=customer&userId=721837123&status=Approved&orderId=6as7dasdh&productId=6gashgdash26178867
Response: { "status": { "code": 200, "message": "Product status is successfully changed." } }
Filters the data according to given criterias.
Endpoint: /products
Method: GET
Authorization: None
Parameters(Query): /products?brand=LC Waikiki&color=Green&categories=["Bag"]
Warning: "filterCriterias" shows that which attributes can we use the current category.
Response:
{
"status": {
"code": 200,
"message": "OK"
},
"data": {
"products": {
"productList": [
{
"category": [
"Men Clothing",
"Bag",
"Backpack"
],
"productInfos": [
{
"attributes": [
{
"name": "size",
"value": "20L"
},
{
"name": "color",
"value": "Green"
}
],
"stockValue": 68
}
],
"description": "Men casual 20L backpack. It's smart and very useful.",
"name": "Men Casual Grey Backpack",
"price": 89.99,
"originalPrice": 111.99,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089146597058",
"rating": 3.97,
"brand": "LC Waikiki",
"vendor": {
"name": "Ahmet",
"rating": 3.22,
"id": "3129281hasda91892312"
},
"id": "5fe86281a17abd0012d601bb"
}
],
"filterCriterias": [
{
"name": "size",
"displayName": "Size",
"possibleValues": [
"70L",
"20L"
]
},
{
"name": "color",
"displayName": "Color",
"possibleValues": [
"Green"
]
}
]
}
}
}
Update the status of the given order.
Endpoint: /products
Method: GET
Authorization: None
Parameters(Query): ?sortingFactor=name&sortingType=ascending&categories=["Phones"]
**
{
"status": {
"code": 200,
"message": "OK"
},
"data": {
"products": {
"productList": [
{
"category": [
"Electronics",
"Phones"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "64 GB"
}
],
"stockValue": 42
},
{
"attributes": [
{
"name": "screenSize",
"value": "5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "128 GB"
}
],
"stockValue": 45
}
],
"description": "Uncover the Ultimate Design. Beauty Beyond the Visual",
"name": "Iphone 6",
"price": 5200,
"originalPrice": 5500,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/160899074721211",
"rating": 4,
"brand": "Apple",
"vendor": {
"name": "Pablos",
"rating": 2.43,
"id": "3129281hasda91892312"
},
"id": "5fe86281a17abd0012d601eb"
},
{
"category": [
"Electronics",
"Phones"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "5 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "64 GB"
}
],
"stockValue": 39
},
{
"attributes": [
{
"name": "screenSize",
"value": "5 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "128 GB"
}
],
"stockValue": 23
}
],
"description": "Uncover the Ultimate Design. Beauty Beyond the Visual",
"name": "Iphone 8",
"price": 4700,
"originalPrice": 5000,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/160899074721010",
"rating": 4.8,
"brand": "Apple",
"vendor": {
"name": "Pablos",
"rating": 2.43,
"id": "3129281hasda91892312"
},
"id": "5fe86281a17abd0012d601ea"
},
{
"category": [
"Electronics",
"Phones"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "6 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "64 GB"
}
],
"stockValue": 95
},
{
"attributes": [
{
"name": "screenSize",
"value": "6 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "128 GB"
}
],
"stockValue": 95
}
],
"description": "Uncover the Ultimate Design. Beauty Beyond the Visual",
"name": "Samsung S10",
"price": 4500,
"originalPrice": 5000,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089907472078",
"rating": 4.4,
"brand": "Samsung",
"vendor": {
"name": "AyseTeyze",
"rating": 3.21,
"id": "3129281hasda91892312"
},
"id": "5fe86281a17abd0012d601e8"
},
{
"category": [
"Electronics",
"Phones"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "64 GB"
}
],
"stockValue": 47
},
{
"attributes": [
{
"name": "screenSize",
"value": "5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "128 GB"
}
],
"stockValue": 94
}
],
"description": "Uncover the Ultimate Design. Beauty Beyond the Visual",
"name": "Samsung S7",
"price": 4500,
"originalPrice": 5000,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089907472099",
"rating": 3.5,
"brand": "Samsung",
"vendor": {
"name": "JohnsShop",
"rating": 4.23,
"id": "3129281hasda91892312"
},
"id": "5fe86281a17abd0012d601e9"
},
{
"category": [
"Electronics",
"Phones"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "5.5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "64 GB"
}
],
"stockValue": 21
},
{
"attributes": [
{
"name": "screenSize",
"value": "5.5 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "128 GB"
}
],
"stockValue": 18
}
],
"description": "Uncover the Ultimate Design. Beauty Beyond the Visual",
"name": "Samsung S8",
"price": 2800,
"originalPrice": 3000,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089907472046",
"rating": 4,
"brand": "Samsung",
"vendor": {
"name": "JohnsShop",
"rating": 4.23,
"id": "3129281hasda91892312"
},
"id": "5fe86281a17abd0012d601e6"
},
{
"category": [
"Electronics",
"Phones"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "5.5 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "64 GB"
}
],
"stockValue": 54
},
{
"attributes": [
{
"name": "screenSize",
"value": "5.5 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "128 GB"
}
],
"stockValue": 74
}
],
"description": "Uncover the Ultimate Design. Beauty Beyond the Visual",
"name": "Samsung S9",
"price": 4000,
"originalPrice": 4200,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089907472057",
"rating": 4.4,
"brand": "Samsung",
"vendor": {
"name": "Ahmet",
"rating": 3.22,
"id": "3129281hasda91892312"
},
"id": "5fe86281a17abd0012d601e7"
}
],
"filterCriterias": [
{
"name": "screenSize",
"displayName": "Screen Size",
"possibleValues": [
"5.5 Inch",
"6 Inch",
"5 Inch"
]
},
{
"name": "RAM",
"displayName": "RAM",
"possibleValues": [
"4 GB",
"8 GB"
]
},
{
"name": "diskSize",
"displayName": "Disk Size",
"possibleValues": [
"64 GB",
"128 GB"
]
}
]
}
}
}
Changes password of a user.
Endpoint: /account-change-password
Method: POST
Authorization: None
Parameters: userType=customer&id=5fe79b54500d4000191358c5&password=3244892
Response: { "status": { "code": 200, "message": "OK" } }
Updates information of a user.
Endpoint: /account
Method: POST
Authorization: None
Parameters: userType=customer&email=[email protected]&id=5fe79b54500d4000191358c5&name=Jim&surname=Morrison&gender=male&phoneNumber=3244892
Response: { "status": { "code": 200, "message": "OK" } }
Endpoint: /messages/last
Method: GET
Authorization: None
Parameters: userType=customer&id=5fff448a04ba0e00144ec688
Response:
{
"status": {
"code": 200,
"message": "OK"
},
"data": {
"lastMessages": [
{
"user": {
"name": "Koray",
"userType": "customer",
"id": "5fff449804ba0e00144ec689"
},
"lastMessage": "Test message",
"date": "2021-01-13T19:18:00.345Z"
}
]
}
}
Endpoint: /messages
Method: GET
Authorization: None
Parameters: id=5fff448a04ba0e00144ec688&userType=customer&withId=5fff449804ba0e00144ec689&withType=customer
Response:
{
"status": {
"code": 200,
"message": "OK"
},
"data": {
"messages": [
{
"message": "Test message",
"date": "2021-01-13T19:18:00.345Z",
"id": "5fff4768773c3e001488eb75",
"user": {
"id": "5fff448a04ba0e00144ec688",
"name": "Koray",
"userType": "customer"
}
},
{
"message": "Test message",
"date": "2021-01-13T19:17:28.002Z",
"id": "5fff4748773c3e001488eb74",
"user": {
"id": "5fff449804ba0e00144ec689",
"name": "Olcay",
"userType": "customer"
}
},
{
"message": "Test message",
"date": "2021-01-13T19:16:31.660Z",
"id": "5fff470fd3e781001467add6",
"user": {
"id": "5fff449804ba0e00144ec689",
"name": "Olcay",
"userType": "customer"
}
},
{
"message": "Test message",
"date": "2021-01-13T19:15:13.527Z",
"id": "5fff46c1ac554e0013ce59e6",
"user": {
"id": "5fff449804ba0e00144ec689",
"name": "Koray",
"userType": "customer"
}
},
{
"message": "Test message",
"date": "2021-01-13T19:14:07.595Z",
"id": "5fff467fa0a8ce00141ec450",
"user": {
"id": "5fff449804ba0e00144ec689",
"name": "Koray",
"userType": "customer"
}
}
]
}
}
Server gets user id with this event.
Event name: discover
Parameters: (payload, responseFn)
Payload: { "userType": "customer" | "vendor" | "admin", "id": "5ff37169542dbb00123390fd" }
Response function: function (response) { // handle response}
Response: { "status": { "code": 200, "message": "OK" } }
Send message
Event name: message
Parameters: (payload, responseFn)
Payload: { "userType": "customer" | "vendor" | "admin", "id": "5ff37169542dbb00123390fd", "withType": "customer" | "vendor" | "admin", "withId": "5ff37169542dbb00123390fd", "message": "Some message" }
Response function: function (response) { // handle response}
Response: { "status": { "code": 200, "message": "OK" } }
Endpoint: /vendor/products
Method: GET
Authorization: None
Parameters: 600bdf7f496a03001ce0e071
Body: {"categories": ["Earphone"]} (You can filter by using other attributes as well)
** Example request: http://3.138.113.101:5003/vendor/products/600bdf7f496a03001ce0e071. (This id might not exist in deployed one.)
{
"status": {
"code": 200,
"message": "OK"
},
"data": {
"result": {
"productList": [
{
"category": [
"Electronics",
"Earphone"
],
"sizes": [],
"colors": [],
"description": "Poweful sound & unique enjoyment!",
"name": "Sony Earphone XS-II",
"price": 400,
"originalPrice": 600,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/160899074722117",
"rating": 4.3,
"brand": "Sony",
"productInfos": [
{
"attributes": [
{
"name": "noiseCancelling",
"value": "No"
}
],
"stockValue": 38
}
],
"vendor": {
"name": "Pablos",
"rating": 2.43,
"id": "3129281hasda91892312"
},
"id": "600bdf7f496a03001ce0e0b0"
},
{
"category": [
"Electronics",
"Earphone"
],
"sizes": [],
"colors": [],
"description": "Poweful sound & unique enjoyment!",
"name": "Philips Earphone P-I",
"price": 400,
"originalPrice": 400,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/160899074722318",
"rating": 4.1,
"brand": "Philips",
"productInfos": [
{
"attributes": [
{
"name": "noiseCancelling",
"value": "No"
}
],
"stockValue": 31
}
],
"vendor": {
"name": "Pablos",
"rating": 2.43,
"id": "3129281hasda91892312"
},
"id": "600bdf7f496a03001ce0e0b1"
}
],
"filterCriterias": [
{
"name": "noiseCancelling",
"displayName": "Noise Cancelling",
"possibleValues": [
"No"
]
}
]
}
}
}
Endpoint: /vendor/products
Method: PATCH
Authorization: None
Parameters: 600bdf7f496a03001ce0e071
Body: {"name": "Iphone 12"} (You can change other first nested attributes as well)
** Example request: http://3.138.113.101:5003/vendor/products/600bdf7f496a03001ce0e071. (This product id might not exist in deployed one.)
Body Parameter1:
{
"attributes": [
{
"name": "size",
"value": "42"
},
{
"name": "color",
"value": "Black"
}
],
"stockValue": 1000000
}
Body Parameter2 - AS an alternative:
{
"name": "Buyo Best Product"
}
Body Parameter3 - As an alternative:
{
"price": 99999
}
Response:
{
"status": {
"code": 200,
"message": "OK"
},
"data": {
"result": {
"category": [
"Electronics",
"Computers"
],
"sizes": [],
"colors": [],
"_id": "600bdf7f496a03001ce0e0a2",
"description": "Engineered for long-lasting performance. Comfortable confidence.",
"name": "Macbook Pro",
"price": 6000,
"originalPrice": 6200,
"imageUrl": "",
"rating": 4.8,
"brand": "Macbook",
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "13 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "256 GB"
}
],
"stockValue": 53
},
{
"attributes": [
{
"name": "screenSize",
"value": "13 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "512 GB"
}
],
"stockValue": 29
},
{
"attributes": [
{
"name": "screenSize",
"value": "13 Inch"
},
{
"name": "RAM",
"value": "16 GB"
},
{
"name": "diskSize",
"value": "256 GB"
}
],
"stockValue": 92
},
{
"attributes": [
{
"name": "screenSize",
"value": "13 Inch"
},
{
"name": "RAM",
"value": "16 GB"
},
{
"name": "diskSize",
"value": "512 GB"
}
],
"stockValue": 46
}
],
"vendorId": "600bdf7f496a03001ce0e06e"
}
}
}
Endpoint: /vendor/wholeproducts
Method: PATCH
Authorization: None
Parameters: 600bdf7f496a03001ce0e071
** Example request: http://3.138.113.101:5003/vendor/wholeproducts/600bdf7f496a03001ce0e071. (This product id might not exist in deployed one.) Body Parameter:
{"category":["Women Clothing","987987"],"description":"Nice orange blouse. It's a causal and comfortable product you'll use in daily life. 987987 lo lo lo ","name":"Women Orange Casual Blouse olsun 987 987 ","price":987987,"originalPrice":180.12,"imag3eUrl":"https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089146596972","rating":4.86,"brand":"Coco Chanel","id":"600de877ce666a001911ea13","productInfos":[{"attributes":[{"name":"size","value":"XS"},{"name":"color","value":"Orange"}],"stockValue":987987},{"attributes":[{"name":"size","value":"S987987"},{"name":"color","value":"Orange"}],"stock4Value":987987}],"vendor":{"name":"JohnsShop","ratin4g":4.23}}
Response:
{
"status": {
"code": 200,
"message": "OK"
},
"data": {
"result": {
"category": [
"Women Clothing",
"987987"
],
"description": "Nice orange blouse. It's a causal and comfortable product you'll use in daily life. 987987 lo lo lo ",
"name": "Women Orange Casual Blouse olsun 987 987 ",
"price": 987987,
"originalPrice": 180.12,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089146596972",
"rating": 4.86,
"brand": "Coco Chanel",
"id": "600de877ce666a001911ea13",
"productInfos": [
{
"attributes": [
{
"name": "size",
"value": "XS"
},
{
"name": "color",
"value": "Orange"
}
],
"stockValue": 987987
},
{
"attributes": [
{
"name": "size",
"value": "S987987"
},
{
"name": "color",
"value": "Orange"
}
],
"stock4Value": 987987
}
],
"vendor": {
"name": "JohnsShop",
"rating": 4.23
}
}
}
}
Endpoint: /vendor/products
Method: POST
Authorization: None
Parameters: 600bdf7f496a03001ce0e071 (vendorId)
Body: It should be product list. You should add this exact product array to the body.
[{
"category": [
"Electronics",
"Computers"
],
"description": "Engineered for long-lasting performance. Comfortable confidence.",
"name": "Macbook Pro",
"price": 6000,
"originalPrice": 6200,
"imageUrl": "",
"rating": 4.8,
"brand": "Macbook",
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "13 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "256 GB"
}
],
"stockValue": 53
},
{
"attributes": [
{
"name": "screenSize",
"value": "13 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "512 GB"
}
],
"stockValue": 29
},
{
"attributes": [
{
"name": "screenSize",
"value": "13 Inch"
},
{
"name": "RAM",
"value": "16 GB"
},
{
"name": "diskSize",
"value": "256 GB"
}
],
"stockValue": 92
},
{
"attributes": [
{
"name": "screenSize",
"value": "13 Inch"
},
{
"name": "RAM",
"value": "16 GB"
},
{
"name": "diskSize",
"value": "512 GB"
}
],
"stockValue": 46
}
],
"vendorId": "600bdf7f496a03001ce0e06e"
}]
(You can change other first nested attributes as well) ** Example request: http://3.138.113.101:5003/vendor/products/600bdf7f496a03001ce0e071 (This vendor id might not exist in deployed one.) ** Response:
{"idList" :["1","2"] (Ids of added products)
Endpoint: /vendor/product
Method: POST
Authorization: None
Parameters: 600bdf7f496a03001ce0e071 (vendorId)
Body: It should be product list. You should add this exact product array to the body.
{
"productId": "t3f243434g3"
}
(You can change other first nested attributes as well) ** Example request: http://3.138.113.101:5003/vendor/product/600bdf7f496a03001ce0e071 (This vendor id might not exist in deployed one.)
{
"status": {
"code": 200,
"message": "The product is deleted successfully"
}
}
{
"status": {
"code": 400,
"message": "Please check your product information. It has never existed or been already deleted"
}
}
Endpoint: /file
Method: POST
Authorization: None
Request body form-data:
photoName(unused): file object Response:
{
status: { code: 200, message: "Success" },
data: {
urls: ["https: //19283u9128ejjasidklasmdsa.com/tr"],
},
}
Endpoint: /products/recommendation
Method: GET
Authorization: None
Request Params:
userId: String,
type: alsoPurchased | alsoLiked
Response:
{
"status": {
"code": 200,
"message": "OK"
},
"data": {
"productList": [
{
"category": [
"Electronics",
"Earphone"
],
"productInfos": [
{
"attributes": [
{
"name": "noiseCancelling",
"value": "No"
}
],
"stockValue": 31
}
],
"description": "Poweful sound & unique enjoyment!",
"name": "Philips Earphone P-I",
"price": 400,
"originalPrice": 400,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/160899074722318",
"rating": 4.1,
"brand": "Philips",
"vendor": {
"name": "AyseTeyze",
"rating": 1.471203743810447,
"id": "5ff37169542dbb00123390fc"
},
"id": "5ff37169542dbb001233913d"
},
{
"category": [
"Electronics",
"Computers"
],
"productInfos": [
{
"attributes": [
{
"name": "screenSize",
"value": "15 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "256 GB"
}
],
"stockValue": 36
},
{
"attributes": [
{
"name": "screenSize",
"value": "15 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "512 GB"
}
],
"stockValue": 28
},
{
"attributes": [
{
"name": "screenSize",
"value": "15 Inch"
},
{
"name": "RAM",
"value": "4 GB"
},
{
"name": "diskSize",
"value": "1024 GB"
}
],
"stockValue": 26
},
{
"attributes": [
{
"name": "screenSize",
"value": "15 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "256 GB"
}
],
"stockValue": 33
},
{
"attributes": [
{
"name": "screenSize",
"value": "15 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "512 GB"
}
],
"stockValue": 74
},
{
"attributes": [
{
"name": "screenSize",
"value": "15 Inch"
},
{
"name": "RAM",
"value": "8 GB"
},
{
"name": "diskSize",
"value": "1024 GB"
}
],
"stockValue": 96
},
{
"attributes": [
{
"name": "screenSize",
"value": "15 Inch"
},
{
"name": "RAM",
"value": "16 GB"
},
{
"name": "diskSize",
"value": "256 GB"
}
],
"stockValue": 43
},
{
"attributes": [
{
"name": "screenSize",
"value": "15 Inch"
},
{
"name": "RAM",
"value": "16 GB"
},
{
"name": "diskSize",
"value": "512 GB"
}
],
"stockValue": 100
},
{
"attributes": [
{
"name": "screenSize",
"value": "15 Inch"
},
{
"name": "RAM",
"value": "16 GB"
},
{
"name": "diskSize",
"value": "1024 GB"
}
],
"stockValue": 5
}
],
"description": "Engineered for long-lasting performance. Comfortable confidence.",
"name": "HP Pavilion Intel Pentium",
"price": 3800,
"originalPrice": 4500,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089907472025",
"rating": 3.8,
"brand": "HP",
"vendor": {
"name": "AyseTeyze",
"rating": 1.471203743810447,
"id": "5ff37169542dbb00123390fc"
},
"id": "5ff37169542dbb001233912f"
},
{
"category": [
"Men",
"Shoes",
"Sneakers"
],
"productInfos": [
{
"attributes": [
{
"name": "size",
"value": "40"
},
{
"name": "color",
"value": "Red"
}
],
"stockValue": 1
},
{
"attributes": [
{
"name": "size",
"value": "41"
},
{
"name": "color",
"value": "Red"
}
],
"stockValue": 86
},
{
"attributes": [
{
"name": "size",
"value": "42"
},
{
"name": "color",
"value": "Red"
}
],
"stockValue": 59
},
{
"attributes": [
{
"name": "size",
"value": "43"
},
{
"name": "color",
"value": "Red"
}
],
"stockValue": 3
},
{
"attributes": [
{
"name": "size",
"value": "44"
},
{
"name": "color",
"value": "Red"
}
],
"stockValue": 87
},
{
"attributes": [
{
"name": "size",
"value": "45"
},
{
"name": "color",
"value": "Red"
}
],
"stockValue": 55
}
],
"description": "Men colorful sneakers. You won't feel your shoes and make many miles with them.",
"name": "Men Black and Red Sneakers",
"price": 229.99,
"originalPrice": 339.99,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/160891465971013",
"rating": 4.03,
"brand": "Nike",
"vendor": {
"name": "Pablos",
"rating": 2.43,
"id": "5ff37169542dbb00123390fd"
},
"id": "5ff37169542dbb001233910b"
},
{
"category": [
"Cosmetics",
"Liquid Soap"
],
"productInfos": [
{
"attributes": [
{
"name": "aroma",
"value": "Rose"
}
],
"stockValue": 7
},
{
"attributes": [
{
"name": "aroma",
"value": "Vanilla"
}
],
"stockValue": 47
},
{
"attributes": [
{
"name": "aroma",
"value": "Strawberry"
}
],
"stockValue": 45
}
],
"description": "Quality liquid soap. 99.9% antibacterial.",
"name": "Clean Liquid Soap",
"price": 200.65,
"originalPrice": 49.9,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/16089789244670",
"rating": 3.6,
"aromas": [
"Rose",
"Vanilla",
"Strawberry"
],
"brand": "Clean",
"vendor": {
"name": "AyseTeyze",
"rating": 1.471203743810447,
"id": "5ff37169542dbb00123390fc"
},
"id": "5ff37169542dbb0012339115"
},
{
"category": [
"Women Clothing",
"Dress"
],
"productInfos": [
{
"attributes": [
{
"name": "size",
"value": "XS"
},
{
"name": "color",
"value": "Red"
}
],
"stockValue": 83
},
{
"attributes": [
{
"name": "size",
"value": "M"
},
{
"name": "color",
"value": "Red"
}
],
"stockValue": 62
},
{
"attributes": [
{
"name": "size",
"value": "L"
},
{
"name": "color",
"value": "Red"
}
],
"stockValue": 23
}
],
"description": "Women shiny red dress, makes you the most attractive person in the party.",
"name": "Women Red Dress",
"price": 112.99,
"originalPrice": 142.99,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/160891465970811",
"rating": 4,
"brand": "Inci",
"vendor": {
"name": "Pablos",
"rating": 2.43,
"id": "5ff37169542dbb00123390fd"
},
"id": "5ff37169542dbb0012339109"
}
]
}
}
Endpoint: /notifications
Method: GET
Authorization: None
Parameters: userType=customer&userId=5fe79b54500d4000191358c5
Response:
{
"status": {
"code": 200,
"message": "OK"
},
"data": {
"notifications" : {
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "BUYO Notifications",
"type": "Collection",
"totalItems": 2,
"items": [
{
"type": "Update",
"name": "Discount",
"startTime": "2014-12-31T23:00:00-08:00",
"summary": "<vendor>'s <productName> price dropped from <originalPrice> to <price>",
"actor": {
"type": "Organization",
"name": <vendor_name>,
"id": "<vendor_id>"
},
"target": "<product_id>",
},
{
"type": "Update",
"name": "Cancel Order",
"startTime": "2014-12-31T23:00:00-08:00",
"summary": "Your order <order_id> is cancelled by the customer!",
"actor": {
"type": "Person",
"name": <customer_email>,
"id": "<customer_id>"
},
"target": "<order_id>",
}
]
}
}
}
Endpoint: /admin/vendor/changeStatus
Method: POST
Authorization: None
Parameters: /600db67dc0283100194f7ed8
** Example Request ** : http://3.138.113.101:8080/admin/vendor/changeStatus/600db67dc0283100194f7ed8
Body Parameter: Status can be "verified", "not-verified", "banned"
Warning: If users status is already "banned" or "verified", our function will returned "Please check your parameters"
{"status" : "verified", "productId": "1wqeqwe"}
Response:
{
"status": {
"code": 200,
"message": "The vendor status is changed"
}
}
Endpoint: /admin/customer/changeStatus
Method: POST
Authorization: None
Parameters: /600db67dc0283100194f7ed8
** Example Request ** : http://3.138.113.101:8080/admin/customer/changeStatus/600db67dc0283100194f7ed8
Body Parameter : Status can be "verified", "not-verified", "banned"
Warning: If users status is already "banned" or "verified", our function will returned "Please check your parameters"
{"status" : "banned", "commentId" : "23werefwfwf"}
Response:
{
"status": {
"code": 200,
"message": "The customer status is changed"
}
}
Endpoint: /admin/report/product
Method: GET
Authorization: None
Parameters: No Parameter
** Example Request ** : http://3.138.113.101:8080/admin/report/product
{"status" : "banned"}
Response:
{
"status": {
"code": 200,
"message": "OK"
},
"data": {
"productReport": [
{
"message": "\"This is an old product. Do better job!\"",
"productDetails": {
"category": [
"Women Clothing",
"Shoes",
"Sneakers"
],
"sizes": [],
"colors": [],
"_id": "600de877ce666a001911ea25",
"description": "Women adidas shoes. It's most classic sneakers of adidas and proved itself since 2001.",
"name": "Women Adidas Black and White Sneakers",
"price": 253.99,
"originalPrice": 353.99,
"imageUrl": "https://elasticbeanstalk-us-east-2-334058266782.s3.amazonaws.com/images/160891465972020",
"rating": 4.92,
"brand": "Adidas",
"productInfos": "[{\"attributes\":[{\"name\":\"size\",\"value\":\"38\"},{\"name\":\"color\",\"value\":\"Black\"}],\"stockValue\":13},{\"attributes\":[{\"name\":\"size\",\"value\":\"39\"},{\"name\":\"color\",\"value\":\"Black\"}],\"stockValue\":38},{\"attributes\":[{\"name\":\"size\",\"value\":\"40\"},{\"name\":\"color\",\"value\":\"Black\"}],\"stockValue\":63}]",
"vendorId": "600de877ce666a001911ea0d"
}
}
]
}
}
Endpoint: /admin/report/comment
Method: GET
Authorization: None
Parameters: No Parameter
** Example Request ** : http://3.138.113.101:8080/admin/report/comment
{"status" : "banned"}
Response:
{
"status": {
"code": 200,
"message": "OK"
},
"data": {
"productReport": [
{
"message": "\"This is abusive comment \"",
"commentDetails": {
"userId": "600dasf3fe34t3tf01911ea0d"
"productId": "600de877ce666a001911ea25"
"vendorId": "600de877ce666a001911ea0d"
"rating": 4.23
"text": "I hate kids."
}
}
]
}
}
🏠 Home
- Requirements Specification
- Project Description
- Logo and project name ideas
- Scenarios and Mockups
- Design Documents
- Project Plan
- RAM
- Practice-app Documentation
- Backend Development Notes
- BUYO Product Data
- Android Development Guide📱
- BUYO API Documentation
- Burak Çuhadar
- Mehmet Erdinç Oğuz
- Koray Cetin
- Eylül Yalçınkaya (Communicator)
- Emre Girgin
- Berkay Alkan
- M. Olcayto Türker
- Çağrı Çiftçi
- Alperen Bağ
- Veli Can Ünal
- Berke Can Gürer
- Meriç Üngör
--- Former ---
--- CMPE 451 ---
Group Meetings
- 1st Meeting - 27.10.2020
- 2nd Meeting - 28.10.2020
- 3rd Meeting - 03.11.2020
- 4th Meeting - 10.11.2020
- 5th Meeting - 17.11.2020
- 6th Meeting - 22.11.2020
- 7th Meeting - 23.11.2020
- 8th Meeting - 25.11.2020
- 9th Meeting - 01.12.2020
- 10th Meeting - 08.12.2020
- 11th Meeting - 15.12.2020
- 12th Meeting - 22.12.2020
- 13rd Meeting - 26.12.2020
- 14th Meeting - 30.12.2020
- 15th Meeting - 05.01.2021
- 16th Meeting - 12.01.2021
- 17th Meeting - 19.01.2021
- 18th Meeting - 24.01.2021
Backend Meetings
- 1st Backend Meeting - 03.11.2020
- 2nd Backend Meeting - 09.11.2020
- 3rd Backend Meeting - 12.11.2020
- 4th Backend Meeting - 16.11.2020
- 5th Backend Meeting - 15.12.2020
- 6th Backend Meeting - 22.12.2020
- Backend-Frontend CI/CD Discussions - 22.12.2020
- Backend-Android : Payment Flow Discussion - 22.12.2020
Frontend Meetings
- 1st Frontend Meeting - 03.11.2020
- 2nd Frontend Meeting - 07.11.2020
- 3rd Frontend Meeting - 17.11.2020
- 4th Frontend Meeting - 28.11.2020
- 5th Frontend Meeting - 8.12.2020
- 6th Frontend Meeting - 15.12.2020
- 7th Frontend Meeting - 22.12.2020
- 8th Frontend Meeting - 06.01.2021
- 9th Frontend Meeting - 14.01.2021
- 10th Frontend Meeting - 19.01.2021
Android Meetings
- 1st Android Meeting - 04.11.2020
- 2nd Android Meeting - 11.11.2020
- 3rd Android Meeting - 17.11.2020
- 4th Android Meeting - 21.11.2020
- 5th Android Meeting - 22.11.2020
- 6th Android Meeting - 01.12.2020
- 7th Android Meeting - 17.12.2020
- 8th Android Meeting - 07.01.2021
- 9th Android Meeting - 20.01.2021
--- CMPE 352 ---
- 1st Meeting - 14.02.2020
- 2nd Meeting - 20.02.2020
- 3rd Meeting - 27.02.2020
- 4th Meeting - 05.03.2020
- 5th Meeting - 11.03.2020
- 6th Meeting - 16.04.2020
- 7th Meeting - 24.04.2020
- 8th Meeting - 01.05.2020
- 9th Meeting - 10.05.2020
- 10th Meeting - 17.05.2020
- Front-end Meetings for practice-app
- 1st Customer Meeting - 02.03.2020