API Documentation
Authentication
All requests must include anAuthorization: Bearer {token}
header.
Available Endpoints
- GET /api/v1/ecommerce/products?asOf={date} – Retrieve products with prices and promotions.
- POST /api/v1/ecommerce/orders – Create an online order (and corresponding sale).
- POST /api/v1/ecommerce/returns – Process returns by sale IDs.
- GET /api/v1/ecommerce/inventory?storeCode={code} – Get current stock levels by store code.
Example Request
POST /api/v1/ecommerce/orders HTTP/1.1
Authorization: Bearer {token}
Content-Type: application/json
{
"customerId": 5,
"items": [
{ "productId": 12, "quantity": 2, "unitPrice": 199.99, "discountPercentage": 0 }
]
}
Example Response
HTTP/1.1 201 Created
Content-Type: application/json
{ "orderId": 27 }
Demo User Credentials
Username: ecom_client
Password: P@ssw0rd!