الانتقال إلى المحتوى الرئيسي
GET
/
v3
/
internet
/
check-id
/
{id}
التحقق من الحالة بالمعرف
curl --request GET \
  --url https://api.oneclickdz.com/v3/internet/check-id/{id} \
  --header 'X-Access-Token: <api-key>'

Documentation Index

Fetch the complete documentation index at: https://docs.oneclickdz.com/llms.txt

Use this file to discover all available pages before exploring further.

نظرة عامة

تتبع حالة شحن الإنترنت واسترجع تفاصيل البطاقة عند اكتمال التسليم.

معاملات المسار

id
string
مطلوب
معرف الشحن الداخلي من استجابة /internet/send

حقول الاستجابة

status
string
  • HANDLING: قيد المعالجة (3 إلى 45 ثانية) - FULFILLED: مكتمل مع كود البطاقة ✅
  • REFUNDED: فشل واسترداد ❌ - QUEUED: مجدول (12 إلى 48 ساعة) ⏰
card_code
string
كود البطاقة المُفعَّلة (متاح عند FULFILLED)
num_trans
string
رقم معاملة اتصالات الجزائر
date_traitement
string
تاريخ المعالجة

أمثلة

curl https://api.oneclickdz.com/v3/internet/check-id/6901616fe9e88196b4eb64b2 \
  -H "X-Access-Token: YOUR_API_KEY"

استجابة عند الاكتمال

{
  "success": true,
  "data": {
    "_id": "6901616fe9e88196b4eb64b2",
    "ref": "internet-order-001",
    "status": "FULFILLED",
    "type": "ADSL",
    "number": "036362608",
    "topup_amount": 1000,
    "card_code": "123456789012",
    "num_trans": "AT-2025-12345",
    "date_traitement": "2025-10-29T01:05:30.000Z",
    "created_at": "2025-10-29T01:00:00.000Z"
  }
}

مثال الاستعلام الدوري

async function pollInternetStatus(topupId) {
  const maxAttempts = 60;

  for (let i = 0; i < maxAttempts; i++) {
    const response = await fetch(
      `https://api.oneclickdz.com/v3/internet/check-id/${topupId}`,
      { headers: { "X-Access-Token": process.env.API_KEY } }
    );

    const { data } = await response.json();

    if (["FULFILLED", "REFUNDED", "QUEUED"].includes(data.status)) {
      return data;
    }

    await new Promise((resolve) => setTimeout(resolve, 5000));
  }

  throw new Error("Timeout");
}

معالجة حالة QUEUED

تعني QUEUED أن الشحن مجدول لوقت لاحق (12 إلى 48 ساعة). لا تعاملها كفشل.
if (status === "QUEUED") {
  // Save for later verification
  await db.orders.update({
    id: orderId,
    status: "SCHEDULED",
    message: "Card will be delivered within 48 hours",
  });

  // Check again after 24h
  scheduleRecheck(orderId, 24 * 60 * 60 * 1000);
}

روابط ذات صلة

التحقق بالمرجع

التتبع بمرجع مخصص

إرسال الشحن

إنشاء طلب جديد