You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Unit tests
docker compose run --rm test pytest plugins/ecommerce/tests/unit/ -v
# Integration tests
docker compose run --rm test pytest plugins/ecommerce/tests/integration/ -v
# Single test file
docker compose run --rm test pytest plugins/ecommerce/tests/unit/test_stock_service.py -v
API Routes
Public -- Product Catalog
Method
Path
Description
GET
/api/v1/shop/products
Product list (search, category filter, pagination)
GET
/api/v1/shop/products/<slug>
Product detail (images, variants, stock status)
GET
/api/v1/shop/categories
Category tree
GET
/api/v1/shop/categories/<slug>
Category detail
Public -- Orders (authenticated)
Method
Path
Description
GET
/api/v1/shop/orders
User's order history
GET
/api/v1/shop/orders/<order_id>
Order detail (owner only)
Public -- Coupons
Method
Path
Description
POST
/api/v1/shop/coupons/validate
Validate coupon code against cart total
Admin -- Products
Method
Path
Description
GET
/api/v1/admin/shop/products
All products (including inactive)
POST
/api/v1/admin/shop/products
Create product
GET
/api/v1/admin/shop/products/<id>
Product detail
PUT
/api/v1/admin/shop/products/<id>
Update product
DELETE
/api/v1/admin/shop/products/<id>
Delete product
Admin -- Orders
Method
Path
Description
GET
/api/v1/admin/shop/orders
All orders (status filter)
GET
/api/v1/admin/shop/orders/<id>
Order detail
POST
/api/v1/admin/shop/orders/<id>/ship
Mark as shipped (tracking info)
POST
/api/v1/admin/shop/orders/<id>/complete
Mark as completed
Admin -- Warehouses and Stock
Method
Path
Description
GET
/api/v1/admin/shop/warehouses
List warehouses
GET
/api/v1/admin/shop/warehouses/<id>
Warehouse detail with stock levels
Configuration
Default values in __init__.py:
Key
Default
Description
currency
"EUR"
Default currency
stock_block_ttl_minutes
5
Minutes before stock reservation expires
low_stock_threshold_default
10
Low-stock alert threshold
enable_warehouses
true
Multi-warehouse support
enable_digital_products
true
Allow digital product type
order_number_prefix
"ORD"
Prefix for order numbers
tax_included_in_price
true
Prices include tax
max_cart_items
50
Maximum items per cart
guest_checkout_enabled
true
Allow guest checkout
Line Item Integration
The plugin uses CUSTOM line items with metadata.plugin = "ecommerce". When core processes an invoice payment:
EcommerceLineItemHandler.can_handle_line_item() checks item_type == CUSTOM and extra_data.plugin == "ecommerce"