The Order API is used to manage orders in the system. It allows you to create and read orders.
-
Description: Creates a new order for the specified user.
user_id
: The ID of the user who is placing the order.
The JSON object represents an order submitted by a user.
payment_method
: The payment method used for the order (e.g.cod
for Cash on Delivery, andonline
for Online Payment).address
: The address to which the order should be delivered.
Request Payload:
{ "payment_method": "cod", "address": "user_adress" }
-
Description: Retrieves all orders for the specified user.
user_id
: The ID of the user.
-
Description: Retrieves a specific order by its ID.
order_id
: The ID of the order.
The Payment API is used to manage payments in the system. It allows you to create payments
-
Description: Makes a payment for the specified order.
order_id
: The ID of the order for which the payment is being made.
The JSON object represents a payment submitted by a user.
payment_method_id
: The ID of the payment method used for the payment.
Request Payload:
{ "payment_method_id": "pm_card_visa" }
The Product API is used to manage products in the system. It allows you to create, read and update products and manage their reviews and ratings along with filtering of products based on Price, Category, Rating and filtering product reviews based on Ratings.
-
Description: Adds a review for a product.
This JSON object represents a product review submitted by a user.
user
: The ID of the user who submitted the review.product
: The ID of the product being reviewed.rating
: The rating given to the product by the user (out of 5).review
: The textual review provided by the user.
Request Payload:
{ "user": 4, "product": 3, "rating": 5, "review": "Good product" }
-
Description: Creates a new product in the system.
The JSON object represents a product to be created.
name
: The name of the product.description
: The description of the product.price
: The price of the product.quantity
: The quantity of the product available.brand
: The brand of the product.category
: The category of the product.image_path
: The path to the image of the product.
Request Payload:
{ "name": "Product", "description": "Product Description", "price": 40.00, "quantity": 5, "brand": "Brand Name", "category": "Category", "image_path": "/images/products/product.jpg" }
-
Description: Deletes a product from the system.
The JSON object represents the product to be deleted.
id
: The ID of the product to be deleted.
Request Payload:
{ "id": 1 }
-
Description: Deletes a review for a product.
user_id
: The ID of the user who submitted the review.product_id
: The ID of the product being reviewed.
-
Description: Retrieves the details of a specific product by its ID.
product_id
: The ID of the product.
-
Description: Retrieves reviews for a product filtered by rating.
product_id
: The ID of the product.rating
: The rating to filter by.
-
Description: Retrieves products filtered by brand.
The JSON object represents the filter criteria.
brand
: The brand to filter by.
Request Payload:
{ "brand": "Brand Name" }
-
Description: Retrieves products filtered by category.
The JSON object represents the filter criteria.
category
: The category to filter by.
Request Payload:
{ "category": "Category Name" }
-
Description: Retrieves products filtered by price range.
The JSON object represents the filter criteria.
min_price
: The minimum price.max_price
: The maximum price.
Request Payload:
{ "min_price": 20.00, "max_price": 50.00 }
-
Description: Retrieves reviews for a specific product by its ID.
product_id
: The ID of the product.
-
Description: Retrieves a list of products for a specific user.
user_id
: The ID of the user.
-
Description: Searches for products based on a keyword. All the keys are optional. If a key is not provided, it is not used in the search. It also supports partial search for the keyword. For example, if the keyword is "lap", it will return products with names like "Laptop", "Lapdesk", etc.
The JSON object represents the search criteria.
name
: The keyword to search for.brand
: The brand to search in.category
: The category to search in.min_price
: The minimum price.max_price
: The maximum price.
Request Payload:
{ "name": "", "brand": "", "min_price": 80000, "max_price": 150000, "category": "Lap" }
-
Description: Updates a product. All the keys are optional. If a key is not provided, it is not used in the update. The ID of the product to be updated must be provided.
The JSON object represents the product to be updated.
id
: The ID of the product to be updated.name
: The name of the product.description
: The description of the product.price
: The price of the product.quantity
: The quantity of the product available.brand
: The brand of the product.category
: The category of the product.image_path
: The path to the image of the product.
Request Payload:
{ "id": 1, "name": "Product", "description": "Product Description", "price": 40.00, "quantity": 5, "brand": "Brand Name", "category": "Category", "image_path": "/images/products/product.jpg" }
-
Description: Updates a review for a product.
user_id
: The ID of the user who submitted the review.product_id
: The ID of the product being reviewed.
The JSON object represents the updated review.
rating
: The updated rating given to the product by the user (out of 5).review
: The updated textual review provided by the user.
Request Payload:
{ "rating": 4, "review": "Updated review" }
The User API is used to manage users in the system. It allows you to create, read, update, delete, signup and signin users. It also provides endpoints for adding, updating and removing from a user's cart and wishlist.
-
Description: Adds a product to the user's cart.
The JSON object represents the product to be added to the cart.
user_id
: The ID of the user.product_id
: The ID of the product.
Request Payload:
{ "user_id": 1, "product_id": 2 }
-
Description: Adds a product to the user's wishlist.
user_id
: The ID of the user.product_id
: The ID of the product.
-
Description: Clears the user's cart.
user_id
: The ID of the user.
-
Description: Deletes a user.
id
: The ID of the user to be deleted.
The JSON object represents the user to be deleted. Request Payload:
{ "id": 1 }
-
Description: Retrieves the user's cart.
user_id
: The ID of the user.
-
Description: Retrieves the user's wishlist.
user_id
: The ID of the user.
-
Description: Logs in a user.
The JSON object represents the user's login credentials.
email
: The email of the user.password
: The password of the user.
Request Payload:
{ "email": "user_email", "password": "user_password" }
-
Description: Retrieves the profile of a user.
user_id
: The ID of the user.
-
Description: Removes a product from the user's cart.
user_id
: The ID of the user.product_id
: The ID of the product.
-
Description: Removes a product from the user's wishlist.
user_id
: The ID of the user.product_id
: The ID of the product.
-
Description: Signs up a new user.
The JSON object represents the user's signup details.
first_name
: The first name of the user.last_name
: The last name of the user.email
: The email of the user.password
: The password of the user.phone_number
: The phone number of the user.address
: The address of the user.city
: The city of the user.state
: The state of the user.country
: The country of the user.pin_code
: The zip code of the user.date_of_birth
: The date of birth of the user.
Request Payload:
{ "first_name": "First Name", "last_name": "Last Name", "email": "user_email", "password": "user_password", "phone_number": 0123456789, "address": "user_address", "city": "user_city", "state": "user_state", "country": "user_country", "pin_code": 10001, "date_of_birth": "1990-05-15" }
-
- Description: Updates a user's profile. All the keys are optional. If a key is not provided, it is not used in the update. The ID of the user to be updated must be provided.
The JSON object represents the user's updated profile details.
id
: The ID of the user.first_name
: The first name of the user.last_name
: The last name of the user.email
: The email of the user.phone_number
: The phone number of the user.address
: The address of the user.city
: The city of the user.state
: The state of the user.country
: The country of the user.pin_code
: The zip code of the user.date_of_birth
: The date of birth of the user.password
: The password of the user.
Request Payload:
{ "id": 1, "first_name": "First Name", "last_name": "Last Name", "email": "user_email", "phone_number": 0123456789, "address": "user_address", "city": "user_city", "state": "user_state", "country": "user_country", "pin_code": 10001, "date_of_birth": "1990-05-15", "password": "user_password" }
-
Description: Updates the user's cart.
user_id
: The ID of the user.
The JSON object represents the updated cart.
cart
: The updated cart. The keys are product IDs and the values are the quantities of the products.
Request Payload:
{ "cart": {"5": 4, "4": 5} }