Skip to main content

List Orders

GET/orders
Returns a paginated list of orders for the authenticated store. Includes customer and transaction data.

Authentication

Headers

HeaderValueRequired
AuthorizationBearer YOUR_API_TOKENYes
Acceptapplication/jsonRecommended

Query Parameters

ParameterTypeRequiredDescription
pageintegerNoPage number (default: 1)
created_fromdateNoFilter orders created on or after this date (e.g., 2024-01-01)
created_todateNoFilter orders created on or before this date
orderBystringNoSort field: id, created_at, updated_at, total (default: id)
orderDirectionstringNoSort direction: asc or desc (default: desc)

Example Request

curl -X GET "https://merchant-api.rmz.gg/shawarma/orders?page=1&orderBy=created_at&orderDirection=desc" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Success Response

{
  "message": null,
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": 78901,
        "store_id": 1,
        "customer_id": 123,
        "coupon_id": null,
        "total": 299.99,
        "checkout_id": 55001,
        "current_status": 4,
        "seen_at": null,
        "order_review_notification_sent_at": null,
        "tax_rate": null,
        "tax_amount": null,
        "prices_include_tax": false,
        "tax_country_code": null,
        "tax_registration_number": null,
        "created_at": "2024-01-15T14:30:00.000000Z",
        "updated_at": "2024-01-15T15:00:00.000000Z",
        "human_format": {
          "date_human": "منذ شهرين",
          "date_normal": "Mon, Jan 15, 2024 2:30 PM"
        },
        "transaction": {
          "id": 5001,
          "total": 299.99,
          "deserved": 280.00,
          "payment_method": "dokanpay",
          "is_refunded": false,
          "order_id": 78901,
          "human_format": {
            "payment.method": "البطائق الإئتمانية",
            "created_at": null,
            "created_at_text": null,
            "store_balance_scheduled_at_text": null,
            "store_balance_scheduled_at": null
          }
        },
        "customer": {
          "id": 123,
          "firstName": "Ahmed",
          "lastName": "Ali",
          "email": "ahmed@example.com",
          "country_code": "966",
          "phone": "501234567"
        }
      }
    ],
    "first_page_url": "https://merchant-api.rmz.gg/shawarma/orders?page=1",
    "from": 1,
    "next_page_url": "https://merchant-api.rmz.gg/shawarma/orders?page=2",
    "path": "https://merchant-api.rmz.gg/shawarma/orders",
    "per_page": 15,
    "prev_page_url": null,
    "to": 15
  },
  "api": "rmz.shawarma",
  "timestamp": 1699999999
}
The transaction.human_format values for created_at and store_balance_scheduled_at appear as null in the list endpoint because only specific transaction columns are selected. The payment.method field returns the Arabic translation of the payment method.

Filtering by Date Range

curl -X GET "https://merchant-api.rmz.gg/shawarma/orders?created_from=2024-01-01&created_to=2024-01-31" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Error Responses

CodeDescription
401Unauthorized — invalid or missing token
422Validation error — invalid filter parameters