Skip to content

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:

FieldTypeRequiredDescription
ordersarrayYesArray of order objects (max 1,000)
orders.*.full_namestringYesCustomer full name (1–100 chars)
orders.*.phonestringYesCustomer phone (1–100 chars)
orders.*.emailstringNoCustomer email
orders.*.citystringYesDestination city
orders.*.areastringNoDestination area/district
orders.*.addressstringYesDelivery address (1–1,000 chars)
orders.*.shipment_waynumberNoShipment method (enum value)
orders.*.is_fees_paid_by_customerbooleanYesWhether shipping fees are paid by customer
orders.*.totalnumberYesOrder total (1–999,999)
orders.*.productsarrayYesProducts array (max 10 per order)
orders.*.products.*.skustringYesProduct SKU — must exist in your account
orders.*.products.*.quantitynumberYesQuantity (1–999,999)
orders.*.products.*.pricenumberYesPrice 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 sku in 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:

ParameterTypeRequiredDescription
search_bystringNoField to search: reference, phone, full_name, city
keyWordstringNoSearch keyword
per_pagenumberNoResults 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:

ParameterTypeDescription
referencestringThe 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:

FieldTypeRequiredDescription
ordersarrayYesArray of order updates (max 1,000)
orders.*.referencestringYesOrder reference
orders.*.statusstringYesNew status
orders.*.action_datestringNoDate 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:

ParameterTypeDescription
referencestringThe 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.

FieldTypeRequiredDescription
full_namestringYesCustomer name (max 100)
phonestringYesPhone (max 100)
second_phonestringNoAlternate phone (max 100)
city_to_idstringYesDestination city ID
area_textstringNoArea text
addressstringYesDelivery address
notesstringNoOrder notes
productsarrayYesUpdated products list
products.*.idstringYesProduct ID
products.*.quantitynumberYesQuantity
products.*.totalnumberYesLine total

Delete Orders (Bulk)

DELETE/orders/delete🔒 Session — can delete

Bulk delete orders by IDs.

FieldTypeRequiredDescription
idsarrayYesArray 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.

FieldTypeRequiredDescription
idsarrayYesOrder IDs
datestringYesDate (Y-m-d format)

Mark as Shipped

POST/orders/mark-orders-as-shipped🔒 Session

Move orders to SHIPPED status. Purges stock quantities.

FieldTypeRequiredDescription
idsarrayYesOrder IDs
datestringYesDate (Y-m-d format)
warehouseIdstringYesSource warehouse ID

Mark as Delivered

POST/orders/mark-orders-as-delivered🔒 Session

Mark orders as delivered.

FieldTypeRequiredDescription
idsarrayYesOrder IDs
datestringYesDate (Y-m-d format)

Mark as Returned

POST/orders/mark-orders-as-returned🔒 Session

Mark orders as returned.

FieldTypeRequiredDescription
idsarrayYesOrder IDs
datestringYesDate (Y-m-d format)

Mark as Canceled

POST/orders/mark-orders-as-canceled🔒 Session — can markAsCanceledByScanner

Cancel orders with a reason.

FieldTypeRequiredDescription
idsarrayYesOrder IDs
descriptionstringYesCancellation reason (max 1,000 chars)

Renew Orders

POST/orders/renew-orders🔒 Session — can ReNewOrder

Renew previously canceled or returned orders.

FieldTypeRequiredDescription
idsarrayYesOrder 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.

FieldTypeRequiredDescription
idsarrayYesOrder IDs
shippent_company_idstringYesShipping company ID
from_stockbooleanYesWhether to ship from stock

Assign to Delivery

POST/orders/assign-to-delivery-boy🔒 Session — can assignOrderToDeliveryBoys

Assign packed orders to a delivery person.

FieldTypeRequiredDescription
idsarrayYesOrder IDs
delivery_boy_idstringYesDelivery user ID
warehouseIdstringYesSource warehouse ID

Generate Tracking Labels

POST/orders/generate-tracking-lebel🔒 Session

Generate tracking labels for orders and move them to PACKED status.

FieldTypeRequiredDescription
idsarrayYesOrder 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.

FieldTypeRequired
referencestringYes
datestringYes
warehouseIdstringYes
POST/orders/mark-orders-as-returned-by-scanner🔒 Session — can markAsReturnedByScanner

Mark a single order as returned via barcode scanner.

FieldTypeRequired
referencestringYes
datestringYes
POST/orders/mark-orders-as-delivered-by-scanner🔒 Session — can markAsDeliveredByScanner

Mark a single order as delivered via barcode scanner.

FieldTypeRequired
referencestringYes
datestringYes

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.

FieldTypeRequiredDescription
filefileYes.xlsx or .csv file
POST/orders/export🔒 Session — can export

Export filtered orders to a file. Processed asynchronously.

FieldTypeRequiredDescription
file_extensionstringYesExport format
POST/orders/mark-orders-as-returned-by-import🔒 Session

Mark orders as returned by importing a file of references.

FieldTypeRequiredDescription
filefileYes.xlsx or .csv with reference column
datestringNoReturn date
POST/orders/mark-orders-as-delivered-by-import🔒 Session

Mark orders as delivered by importing a file of references.

FieldTypeRequiredDescription
filefileYes.xlsx or .csv with reference column

Order Statuses

StatusDescription
NEWFreshly created order
PACKEDPacked and ready for shipping
WAITING_FOR_SHIPPING_COMPANYPushed to shipping company, waiting for pickup
SHIPPEDIn transit
DELIVEREDSuccessfully delivered to customer
RETURNEDReturned by customer or courier
CANCELEDOrder canceled
OUT_OF_STOCKProduct was out of stock
ROLLBACKOrder rolled back to previous state

WedoCOD Documentation