Skip to content

RESTful API for E-commerce built with FastAPI. Manage products, categories, cart, orders, payments, reviews, and inventory with Excel export support.

License

Notifications You must be signed in to change notification settings

Jefrey13/ecommerce-api-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-commerce Backend API with FastAPI

Overview

This is a RESTful API for managing an E-commerce platform, built with FastAPI. The backend includes functionalities to handle products, categories, cart, orders, payments, reviews, and inventory. It also supports Excel export for products.


Features

  • CRUD operations for:
    • Products
    • Categories
    • Cart
    • Orders
    • Payments
    • Reviews
    • Inventory
  • Export product data to Excel.
  • Organized and modular architecture.

Technologies

  • Python
  • FastAPI
  • Pydantic
  • OpenPyXL (for Excel export)

API documentation - Swagger UI

FastAPI


Endpoints

Products

  • GET /api/products - Get all products
  • GET /api/products/{id} - Get a product by ID
  • POST /api/products - Create a new product
  • PUT /api/products/{id} - Update a product
  • DELETE /api/products/{id} - Delete a product
  • GET /api/products/export - Export product data to Excel

Categories

  • GET /api/categories - Get all categories
  • GET /api/categories/{id} - Get a category by ID
  • POST /api/categories - Create a new category
  • PUT /api/categories/{id} - Update a category
  • DELETE /api/categories/{id} - Delete a category

Cart

  • POST /api/cart - Add a product to the cart
  • GET /api/cart/{user_id} - Get the cart for a specific user
  • DELETE /api/cart/{user_id}/{product_id} - Remove a product from the cart

Orders

  • POST /api/orders - Create a new order
  • GET /api/orders/{user_id} - Get orders for a user
  • PUT /api/orders/{id}/{status} - Update the status of an order

Payments

  • POST /api/payments - Register a payment
  • GET /api/payments/{order_id} - Get payments for an order

Reviews

  • POST /api/reviews - Add a review for a product
  • GET /api/reviews/{product_id} - Get reviews for a product

Inventory

  • PUT /api/inventory/{product_id} - Update inventory for a product
  • GET /api/inventory - Get inventory data

About

RESTful API for E-commerce built with FastAPI. Manage products, categories, cart, orders, payments, reviews, and inventory with Excel export support.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages