DocsOrders

Orders API

Access order data, line items, and order status through the Orders API.

Endpoints Overview

MethodEndpointDescription
GET/api/ordersList all orders (paginated)
GET/api/orders/:idGet order by ID

List Orders

Retrieve a paginated list of orders for a store.

Request
GET /api/orders?store_id={storeId}&page=1&limit=25
Authorization: Bearer {token}

Query Parameters

ParameterTypeRequiredDescription
store_idstringYesStore UUID
pagenumberNoPage number (default: 1)
limitnumberNoItems per page (default: 25, max: 100)
statusstringNoFilter by order status
customer_idstringNoFilter by customer UUID
from_datestringNoFilter orders from date (ISO 8601)
to_datestringNoFilter orders until date (ISO 8601)
Response
{
  "data": [
    {
      "id": "uuid",
      "salla_id": 987654321,
      "reference_id": "ORD-12345",
      "status": "completed",
      "total": 599.99,
      "subtotal": 549.99,
      "shipping": 50.00,
      "discount": 0,
      "currency": "SAR",
      "items_count": 3,
      "payment_method": "credit_card",
      "shipping_method": "express",
      "order_date": "2024-01-15T10:30:00Z",
      "customer": {
        "id": "uuid",
        "first_name": "Ahmed",
        "last_name": "Mohammed"
      }
    }
  ],
  "meta": {
    "total": 2500,
    "page": 1,
    "limit": 25,
    "total_pages": 100
  }
}

Get Order

Retrieve a single order with full details including line items.

Request
GET /api/orders/{orderId}?store_id={storeId}
Authorization: Bearer {token}
Response
{
  "id": "uuid",
  "salla_id": 987654321,
  "reference_id": "ORD-12345",
  "status": "completed",
  "total": 599.99,
  "subtotal": 549.99,
  "shipping": 50.00,
  "discount": 0,
  "tax": 0,
  "currency": "SAR",
  "items_count": 3,
  "payment_method": "credit_card",
  "shipping_method": "express",
  "order_date": "2024-01-15T10:30:00Z",
  "completed_at": "2024-01-18T14:00:00Z",
  "customer": {
    "id": "uuid",
    "salla_id": 123456,
    "first_name": "Ahmed",
    "last_name": "Mohammed",
    "email": "ahmed@example.com",
    "mobile": "+966501234567"
  },
  "items": [
    {
      "id": "uuid",
      "product_id": "uuid",
      "salla_product_id": 111222,
      "name": "Premium Widget",
      "sku": "PWG-001",
      "quantity": 2,
      "price": 199.99,
      "total": 399.98,
      "thumbnail": "https://..."
    },
    {
      "id": "uuid",
      "product_id": "uuid",
      "salla_product_id": 111223,
      "name": "Basic Accessory",
      "sku": "BA-002",
      "quantity": 1,
      "price": 150.01,
      "total": 150.01,
      "thumbnail": "https://..."
    }
  ],
  "shipping_address": {
    "city": "Riyadh",
    "country": "SA",
    "address": "123 Main Street"
  },
  "notes": "Please gift wrap",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-18T14:00:00Z"
}

Order Statuses

StatusDescription
pendingOrder placed, awaiting processing
processingOrder is being prepared
shippedOrder has been shipped
deliveredOrder has been delivered
completedOrder completed successfully
cancelledOrder was cancelled
refundedOrder was refunded

Order Object

Full order object field reference:

FieldTypeDescription
idstringSyncaty UUID
salla_idnumberSalla order ID
reference_idstringHuman-readable order reference
statusstringCurrent order status
totalnumberTotal order amount
currencystringCurrency code (e.g., SAR)
itemsarrayOrder line items
customerobjectAssociated customer
order_datestringOrder creation date (ISO 8601)