المتاجر · توثيق الـ API
الطلبات

غيّر حالة الطلب

بيغيّر حالة الطلب زي ما التاجر بيعمل من اللوحة بالظبط — المخزون والسجل وإشعارات العميل.

PATCHhttps://elmatajer.com/api/v1/vendor/orders/{id}/status
الصلاحية: orders.write

متغيرات الرابط

الاسمالنوعإلزاميالوصف
idintegerنعمرقم الطلب الداخلي.

محتوى الطلب

الاسمالنوعإلزاميالوصف
statusstringنعمpending أو processing أو shipped أو delivered أو cancelled أو returned.

الطلب

curl -X PATCH "https://elmatajer.com/api/v1/vendor/orders/4904/status" \
  -H "Api-Key: YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"status":"shipped"}'

الرد 200

{
    "status": "ok",
    "data": {
        "id": 4904,
        "order_number": "IOY539",
        "status": 3,
        "status_type": 3,
        "status_label": "Shipped",
        "payment_status": 1,
        "payment_type": 1,
        "order_type": 1,
        "customer": {
            "name": "Mona Adel",
            "email": "mona@example.com",
            "mobile": "+201012345678"
        },
        "address": {
            "line": "12 Tahrir St, Dokki",
            "building": "Building 4, flat 2",
            "landmark": "Next to the pharmacy"
        },
        "totals": {
            "sub_total": 120,
            "delivery_charge": 30,
            "discount_amount": 0,
            "tips": 0,
            "grand_total": 150,
            "currency": "EGP",
            "currency_code": "EGP"
        },
        "items_count": 1,
        "items": [
            {
                "id": 3038,
                "item_id": 22511,
                "name": "Building blocks set",
                "image": "https://cdn.elmatajer.com/…/blocks.webp",
                "sku": "BLK-01",
                "qty": 1,
                "price": 120,
                "variant": null,
                "extras": null,
                "line_total": 120
            }
        ],
        "notes": null,
        "created_at": "2026-11-03T18:00:16+02:00"
    }
}

بيتقبل الخطوة الجاية المسموحة بس — غير كده بيرجع 422 status_not_changed ومعاه السبب (next_steps في الطلب بتقولك المسموح):

من يقدر يروح لـ
pending processing أو cancelled
processing shipped أو cancelled أو يرجع pending
shipped delivered أو returned
delivered returned
cancelled pending (إعادة فتح)
returned — (آخر خطوة)

الدفع عند الاستلام بيتسجّل مدفوع عند delivered. وشركة الشحن المربوطة بتحرّك الطلب لوحدها (استلم ← shipped، سلّم ← delivered، رجّع ← returned).