AR
ArtyomYefimenko/order-service
Order Service is a microservice responsible for managing orders in the Microshop project.
Order Service
Order Service is a microservice responsible for managing orders in the Microshop project.
Features
- Create orders with multiple items.
- Validate products via Product Service (existence and availability).
- Calculate total order amount including product prices (future: shipping, discounts, taxes).
- Track order status (
new,in_progress,completed,cancelled) and payment status (not_paid,paid). - Store orders and order items in the database with async SQLAlchemy.
- Expose REST API under
/api/v1/orders.
API Endpoints
POST /api/v1/orders– Create a new order.GET /api/v1/orders?limit={int}&offset={int}– List customer orders with pagination.GET /api/v1/orders/{order_id}– Get order details.GET /api/v1/orders/{order_id}/payment-methods– Retrieve payment methods allowed to current order.POST /api/v1/orders/{order_id}/payment– Retrieve url to redirect customer to pay his order.- Future endpoints for updating order status, listing orders, etc.
Tech Stack
- Python 3.13
- FastAPI for REST API
- Async SQLAlchemy for database access
- PostgreSQL as database
- Pydantic for request/response validation
- Kafka / AIOKafka for asynchronous event processing from
payment-service - Docker for containerization
Notes
- Payment is handled via Payment Service; this service only manages order data.
- Business logic validation (product availability, total calculation) is implemented inside the service.
- Designed for easy integration with Gateway Service and other microservices in the Microshop project.
Running Locally
To start the services locally, navigate to the infrastructure directory and run:
make runOn this page
Languages
Python95.8%Makefile2.6%Mako0.8%Dockerfile0.8%
Contributors
MIT License
Created December 19, 2025
Updated February 26, 2026