الطلبات
غيّر حالة الطلب
بيغيّر حالة الطلب زي ما التاجر بيعمل من اللوحة بالظبط — المخزون والسجل وإشعارات العميل.
PATCH
https://elmatajer.com/api/v1/vendor/orders/{id}/statusالصلاحية:
orders.writeمتغيرات الرابط
| الاسم | النوع | إلزامي | الوصف |
|---|---|---|---|
id | integer | نعم | رقم الطلب الداخلي. |
محتوى الطلب
| الاسم | النوع | إلزامي | الوصف |
|---|---|---|---|
status | string | نعم | 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"}'
const res = await fetch("https://elmatajer.com/api/v1/vendor/orders/4904/status", {
method: "PATCH",
headers: {
"Api-Key": process.env.ELMATAJER_API_KEY,
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
"status": "shipped"
})
});
const data = await res.json();
$ch = curl_init("https://elmatajer.com/api/v1/vendor/orders/4904/status");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Api-Key: " . getenv('ELMATAJER_API_KEY'), "Accept: application/json", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
'status' => 'shipped'
]),
]);
$data = json_decode(curl_exec($ch), true);
الرد 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).