Appearance
Orders
The Orders resource supports bulk creation via the REST API and full lifecycle management in the Dashboard.
REST API Endpoints
Bulk Create Orders
POST/api/web/1.0/orders🔒 Bearer Token — CREATE ORDERS
Create multiple orders in a single request. Maximum 1,000 orders per request.
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
orders | array | Yes | Array of order objects (max 1,000) |
orders.*.full_name | string | Yes | Customer full name (1–100 chars) |
orders.*.phone | string | Yes | Customer phone (1–100 chars) |
orders.*.email | string | No | Customer email |
orders.*.city | string | Yes | Destination city |
orders.*.area | string | No | Destination area/district |
orders.*.address | string | Yes | Delivery address (1–1,000 chars) |
orders.*.shipment_way | number | No | Shipment method (enum value) |
orders.*.is_fees_paid_by_customer | boolean | Yes | Whether shipping fees are paid by customer |
orders.*.total | number | Yes | Order total (1–999,999) |
orders.*.products | array | Yes | Products array (max 10 per order) |
orders.*.products.*.sku | string | Yes | Product SKU — must exist in your account |
orders.*.products.*.quantity | number | Yes | Quantity (1–999,999) |
orders.*.products.*.price | number | Yes | Price per unit (1–999,999) |
Example Request:
bash
curl -X POST "https://your-domain.com/api/web/1.0/orders" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"orders": [
{
"full_name": "Youssef El Idrissi",
"phone": "+212600000001",
"city": "Casablanca",
"address": "Rue 45, Maarif, Casablanca",
"is_fees_paid_by_customer": true,
"total": 399,
"products": [
{ "sku": "PROD-001", "quantity": 1, "price": 399 }
]
},
{
"full_name": "Amina Tazi",
"phone": "+212600000002",
"city": "Fes",
"address": "Avenue Hassan II, Fes",
"is_fees_paid_by_customer": false,
"total": 598,
"products": [
{ "sku": "PROD-002", "quantity": 2, "price": 299 }
]
}
]
}'Example Response (200):
json
{
"message": "Orders created successfully."
}Important
- The
skuin each product must match an active product in your account - Maximum 10 products per order
- If any order in the array fails validation, the entire request is rejected
List Orders
GET/api/web/1.0/orders🔒 Bearer Token — VIEW ORDERS
Retrieve a paginated list of orders.
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
search_by | string | No | Field to search: reference, phone, full_name, city |
keyWord | string | No | Search keyword |
per_page | number | No | Results per page |
Example Request:
bash
curl -X GET "https://your-domain.com/api/web/1.0/orders?per_page=25" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"Example Response (200):
json
{
"data": [
{
"reference": "ORD-00001",
"full_name": "Youssef El Idrissi",
"phone": "+212600000001",
"city": "Casablanca",
"status": "new",
"total": 399,
"created_at": "2025-01-15T10:30:00Z"
}
],
"meta": { "current_page": 1, "per_page": 25, "total": 84 }
}Show Order
GET/api/web/1.0/orders/{reference}/show🔒 Bearer Token — VIEW ORDERS
Retrieve a single order by its reference.
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
reference | string | The order reference (e.g., ORD-00001) |
Update Orders (Bulk)
PUT/api/web/1.0/orders🔒 Bearer Token — UPDATE ORDERS
Update statuses for multiple orders. Maximum 1,000 per request.
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
orders | array | Yes | Array of order updates (max 1,000) |
orders.*.reference | string | Yes | Order reference |
orders.*.status | string | Yes | New status |
orders.*.action_date | string | No | Date in ISO format |
Delete Order
DELETE/api/web/1.0/orders/{reference}🔒 Bearer Token — DELETE ORDERS
Delete a single order by reference. Only orders with a deletable status can be removed.
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
reference | string | The order reference |
Dashboard Endpoints
List Orders
GET/orders🔒 Session
List all orders across all statuses with filtering.
GET/orders/{status}🔒 Session
List orders filtered by a specific status (NEW, SHIPPED, DELIVERED, etc.).
Show Order
GET/orders/{order}/show🔒 Session — can view
View full order details including products.
Update Order
PATCH/orders/{status}/{item}/update🔒 Session — can update
Update order details.
| Field | Type | Required | Description |
|---|---|---|---|
full_name | string | Yes | Customer name (max 100) |
phone | string | Yes | Phone (max 100) |
second_phone | string | No | Alternate phone (max 100) |
city_to_id | string | Yes | Destination city ID |
area_text | string | No | Area text |
address | string | Yes | Delivery address |
notes | string | No | Order notes |
products | array | Yes | Updated products list |
products.*.id | string | Yes | Product ID |
products.*.quantity | number | Yes | Quantity |
products.*.total | number | Yes | Line total |
Delete Orders (Bulk)
DELETE/orders/delete🔒 Session — can delete
Bulk delete orders by IDs.
| Field | Type | Required | Description |
|---|---|---|---|
ids | array | Yes | Array of order IDs |
Order Status Operations
Mark as Packed
POST/orders/mark-orders-as-packed🔒 Session — can markAsPackedByScanner
Move orders from NEW to PACKED status.
| Field | Type | Required | Description |
|---|---|---|---|
ids | array | Yes | Order IDs |
date | string | Yes | Date (Y-m-d format) |
Mark as Shipped
POST/orders/mark-orders-as-shipped🔒 Session
Move orders to SHIPPED status. Purges stock quantities.
| Field | Type | Required | Description |
|---|---|---|---|
ids | array | Yes | Order IDs |
date | string | Yes | Date (Y-m-d format) |
warehouseId | string | Yes | Source warehouse ID |
Mark as Delivered
POST/orders/mark-orders-as-delivered🔒 Session
Mark orders as delivered.
| Field | Type | Required | Description |
|---|---|---|---|
ids | array | Yes | Order IDs |
date | string | Yes | Date (Y-m-d format) |
Mark as Returned
POST/orders/mark-orders-as-returned🔒 Session
Mark orders as returned.
| Field | Type | Required | Description |
|---|---|---|---|
ids | array | Yes | Order IDs |
date | string | Yes | Date (Y-m-d format) |
Mark as Canceled
POST/orders/mark-orders-as-canceled🔒 Session — can markAsCanceledByScanner
Cancel orders with a reason.
| Field | Type | Required | Description |
|---|---|---|---|
ids | array | Yes | Order IDs |
description | string | Yes | Cancellation reason (max 1,000 chars) |
Renew Orders
POST/orders/renew-orders🔒 Session — can ReNewOrder
Renew previously canceled or returned orders.
| Field | Type | Required | Description |
|---|---|---|---|
ids | array | Yes | Order IDs to renew |
Shipping Operations
Push to Shipping Company
POST/orders/push-order-to-shipping-company🔒 Session — can assignOrderToShippingCompany
Queue orders for pickup by a shipping company. Processed asynchronously.
| Field | Type | Required | Description |
|---|---|---|---|
ids | array | Yes | Order IDs |
shippent_company_id | string | Yes | Shipping company ID |
from_stock | boolean | Yes | Whether to ship from stock |
Assign to Delivery
POST/orders/assign-to-delivery-boy🔒 Session — can assignOrderToDeliveryBoys
Assign packed orders to a delivery person.
| Field | Type | Required | Description |
|---|---|---|---|
ids | array | Yes | Order IDs |
delivery_boy_id | string | Yes | Delivery user ID |
warehouseId | string | Yes | Source warehouse ID |
Generate Tracking Labels
POST/orders/generate-tracking-lebel🔒 Session
Generate tracking labels for orders and move them to PACKED status.
| Field | Type | Required | Description |
|---|---|---|---|
ids | array | Yes | Order IDs |
GET/orders/get-trackings🔒 Session
Download generated tracking labels as PDF.
Scanner Operations
These endpoints process a single order by barcode reference:
POST/orders/mark-orders-as-shipped-by-scanner🔒 Session — can markAsShippedByScanner
Mark a single order as shipped via barcode scanner.
| Field | Type | Required |
|---|---|---|
reference | string | Yes |
date | string | Yes |
warehouseId | string | Yes |
POST/orders/mark-orders-as-returned-by-scanner🔒 Session — can markAsReturnedByScanner
Mark a single order as returned via barcode scanner.
| Field | Type | Required |
|---|---|---|
reference | string | Yes |
date | string | Yes |
POST/orders/mark-orders-as-delivered-by-scanner🔒 Session — can markAsDeliveredByScanner
Mark a single order as delivered via barcode scanner.
| Field | Type | Required |
|---|---|---|
reference | string | Yes |
date | string | Yes |
Import / Export
POST/orders/import🔒 Session — can import
Import orders from an Excel/CSV file. Required columns: full_name, phone, second_phone, city, address, skus, quantities, prices, total, notes.
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | .xlsx or .csv file |
POST/orders/export🔒 Session — can export
Export filtered orders to a file. Processed asynchronously.
| Field | Type | Required | Description |
|---|---|---|---|
file_extension | string | Yes | Export format |
POST/orders/mark-orders-as-returned-by-import🔒 Session
Mark orders as returned by importing a file of references.
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | .xlsx or .csv with reference column |
date | string | No | Return date |
POST/orders/mark-orders-as-delivered-by-import🔒 Session
Mark orders as delivered by importing a file of references.
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | .xlsx or .csv with reference column |
Order Statuses
| Status | Description |
|---|---|
NEW | Freshly created order |
PACKED | Packed and ready for shipping |
WAITING_FOR_SHIPPING_COMPANY | Pushed to shipping company, waiting for pickup |
SHIPPED | In transit |
DELIVERED | Successfully delivered to customer |
RETURNED | Returned by customer or courier |
CANCELED | Order canceled |
OUT_OF_STOCK | Product was out of stock |
ROLLBACK | Order rolled back to previous state |
