Orders
Visibility
POST /orders— PublicGET /orders— Authenticated (customer context)GET /orders/track/{order_number}— Public tracking
Authentication
- Storefront key is required for all endpoints in this page.
- Customer-specific order listing may depend on customer auth/session context.
POST /orders
Converts a cart into an order.
Request Body (CreateOrderRequest)
| Field | Type | Required |
|---|---|---|
cart_id | string | Yes |
customer_name | string | Yes |
customer_phone | string | Yes |
customer_email | string? | No |
customer_wilaya | string? | No |
customer_commune | string? | No |
shipping_address | object? | No |
payment_method | string? | No |
customer_notes | string? | No |
coupon_code | string? | No |
Response Fields
| Field | Type |
|---|---|
id | string |
order_number | string? |
status | string |
total | number |
subtotal | number? |
shipping_cost | number? |
discount | number? |
payment_status | string? |
GET /orders
Returns paginated customer order history.
GET /orders/track/{order_number}
Returns one order by tracking/order number.
cURL
curl -X POST "https://api.ecommaps.com/api/v1/storefront/orders" \
-H "x-api-key: sk_eco_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"cart_id":"<cart_uuid>","customer_name":"Customer","customer_phone":"0555000000"}'
curl -X GET "https://api.ecommaps.com/api/v1/storefront/orders/track/ORD-2026-ABC123" \
-H "x-api-key: sk_eco_YOUR_KEY"SDK Example
const order = await ecommapsClient.orders.create({
cart_id: "<cart_uuid>",
customer_name: "Customer",
customer_phone: "0555000000",
});Error Matrix
| Status | Scenario |
|---|---|
400 | Invalid order payload |
401 | Missing/invalid auth |
404 | Cart/order not found |
422 | Validation failure |
500 | Order pipeline failure |