البداية
الفلترة والصفحات
الـ endpoints اللي بترجّع قوايم (الطلبات والمنتجات) بتقبل نفس الطريقة.
فلترة
filter=field||operator||value
كرّر filter= عشان تجمع شروط (و):
curl "https://elmatajer.com/api/v1/vendor/orders?filter=status_type||eq||1&filter=grand_total||gte||500" -H "Api-Key: YOUR_API_KEY"
| العامل | المعنى | مثال |
|---|---|---|
eq |
يساوي | filter=status_type||eq||3 |
ne |
لا يساوي | filter=qty||ne||0 |
gt / lt |
أكبر / أصغر من | filter=price||gt||100 |
gte / lte |
أكبر / أصغر أو يساوي | filter=created_at||gte||2026-11-01 |
$in |
واحد من (مفصولة بفاصلة) | filter=id||$in||12,15,19 |
cont |
يحتوي | filter=name||cont||shirt |
isnull / notnull |
فاضي / مش فاضي | filter=sku||notnull |
الحقول اللي تقدر تفلتر وترتّب بيها:
- الطلبات:
id,order_number,status_type,payment_status,payment_type,grand_total,customer_name,mobile,email,created_at,updated_at - المنتجات:
id,name,sku,price,qty,is_available,category_id,has_variants,created_at,updated_at
حقل أو عامل مش معروف بيرجّع 422 ومعاه القايمة المسموحة.
الترتيب والعدد والصفحة والحقول
| الحقل | مثال | ملاحظات |
|---|---|---|
sort |
sort=price,DESC |
ASC أو DESC |
limit |
limit=50 |
من 1 لـ 100، الافتراضي 20 |
page |
page=2 |
بتبدأ من 1؛ وmeta.last_page بيقولك تقف إمتى |
fields |
fields=order_number,totals |
مفاتيح الرد اللي عايزها (id دايمًا موجود) |
"meta": { "current_page": 1, "last_page": 7, "per_page": 20, "total": 131, "has_more": true }