الطلبات
إنشاء طلب
POST/api/v1/orders
ابعت كل طلب أول ما يتعمل. يودوو بيحفظه ويشغّل أتوميشن الطلبات بتاعة المتجر: رسالة التأكيد المناسبة لطريقة الدفع الأول. لو بعت نفس الـ id تاني الطلب بيتحدّث بدل ما يتعمل طلب تاني، فإعادة الإرسال دايماً آمنة.
curl -X POST https://app.yudoo.io/api/v1/orders \
-H "Authorization: Bearer wp_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"id": "1042",
"number": "1042",
"status": "pending",
"customer": { "name": "Mohamed Ali", "phone": "201001234567", "email": "mohamed@example.com" },
"currency": "EGP",
"total": 540,
"shipping_total": 40,
"payment_method": "cod",
"shipping_address": { "address1": "12 Tahrir St", "city": "Cairo", "province": "Cairo", "country": "EG" },
"items": [
{ "name": "Cotton T-shirt", "variant": "White / L", "quantity": 1, "price": 250, "sku": "TS-WH-L" },
{ "name": "Sport socks", "quantity": 2, "price": 125 }
],
"note": "Please deliver after 5 pm"
}'const res = await fetch("https://app.yudoo.io/api/v1/orders", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.YUDOO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
id: order.id, // your platform's order id
number: order.number,
customer: { name: order.customerName, phone: order.phone }, // 201001234567
currency: "EGP",
total: order.total,
payment_method: "cod",
items: order.lines.map((l) => ({ name: l.title, quantity: l.qty, price: l.price })),
}),
});
const { order: saved, error } = await res.json();$ch = curl_init("https://app.yudoo.io/api/v1/orders");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("YUDOO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"id" => (string) $order->id,
"number" => $order->number,
"customer" => ["name" => $order->name, "phone" => $order->phone],
"currency" => "EGP",
"total" => $order->total,
"payment_method" => "cod",
"items" => array_map(fn($l) => ["name" => $l->title, "quantity" => $l->qty, "price" => $l->price], $order->lines),
]),
]);
$response = json_decode(curl_exec($ch), true);import os, requests
res = requests.post(
"https://app.yudoo.io/api/v1/orders",
headers={"Authorization": f"Bearer {os.environ['YUDOO_API_KEY']}"},
json={
"id": str(order.id),
"number": order.number,
"customer": {"name": order.name, "phone": order.phone},
"currency": "EGP",
"total": order.total,
"payment_method": "cod",
"items": [{"name": l.title, "quantity": l.qty, "price": l.price} for l in order.lines],
},
timeout=10,
)
saved = res.json()["order"] | الحقل | النوع | الوصف |
|---|---|---|
id | string | مطلوب. رقم الطلب عندك في منصتك. لو بعت نفس الـ id تاني، الطلب ده بيتحدّث. |
customer.phone | string | مطلوب. بالصيغة الدولية بكود الدولة، أرقام بس (201001234567). رسايل واتساب بتروح للرقم ده. |
customer.name | string | اسم العميل ({{customer_first_name}} في الرسايل). |
customer.email | string | اختياري. |
number | string | الرقم اللي العميل عارفه ("1042" ← #1042). لو مابعتوش بيبقى #id. |
status | string | pending (الافتراضي)، processing، shipped، delivered، cancelled… شوف حالات الطلب. |
payment_method | string | cod، bank_transfer، instapay، vodafone_cash، card… بيحدد رسالة التأكيد اللي الطلب ياخدها. شوف طرق الدفع. |
currency | string | كود ISO من 3 حروف: EGP، SAR، AED، USD… |
total | number | إجمالي الطلب شامل الشحن. |
shipping_total | number | مصاريف الشحن. |
items[] | array | لحد 200 سطر: name (مطلوب)، quantity، price، variant، sku، product_id، image_url (https). |
shipping_address | object | address1، address2، city، province، postal_code، country (كود من حرفين أو الاسم). |
note | string | ملاحظة العميل على الطلب. |
tracking | object | number، url، carrier — لو الطلب اتشحن خلاص. |
placed_at | string | تاريخ ISO 8601. لو مابعتوش بيبقى وقت وصول الطلب ليودوو. |
الرد بيبقى 201 Created ومعاه الطلب (200 لو الـ id اتبعت قبل كده):
{
"order": {
"id": "1042",
"number": "#1042",
"status": "pending",
"confirmation": { "status": "pending", "at": null, "cancel_reason": null },
"customer": { "name": "Mohamed Ali", "phone": "201001234567", "email": "mohamed@example.com" },
"currency": "EGP",
"total": 540,
"payment_method": "cod",
"items": [
{ "name": "Cotton T-shirt", "variant": "White / L", "quantity": 1, "price": 250, "sku": "TS-WH-L", "product_id": null },
{ "name": "Sport socks", "variant": null, "quantity": 2, "price": 125, "sku": null, "product_id": null }
],
"tracking": null,
"created_at": "2026-11-04T10:00:00.000Z",
"updated_at": "2026-11-04T10:00:00.000Z"
}
} واقف في حاجة، أو محتاج حقل مش موجود؟ فريقنا بيرد على واتساب.