الانتقال إلى المحتوى الرئيسي
GET
/
v3
/
gift-cards
/
checkProduct
/
{productId}
التحقق من تفاصيل المنتج
curl --request GET \
  --url https://api.oneclickdz.com/v3/gift-cards/checkProduct/{productId} \
  --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.

نظرة عامة

يعيد أنواع/فئات المنتج مع الأسعار في الوقت الفعلي وتوافر المخزون.
الأسعار مخصصة لحسابك. احذف cost قبل عرضه للمستخدمين.

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

productId
string
مطلوب
معرف المنتج من endpoint الـ /catalog

الاستجابة

data
object

أمثلة

curl https://api.oneclickdz.com/v3/gift-cards/checkProduct/507f1f77bcf86cd799439011 \
  -H "X-Access-Token: YOUR_API_KEY"

مثال الاستجابة

{
  "success": true,
  "data": {
    "productId": "507f1f77bcf86cd799439011",
    "productTitle": "PlayStation Network",
    "types": [
      {
        "id": "type_001",
        "name": "PSN 500 DA",
        "price": 490,
        "quantity": 150
      },
      {
        "id": "type_002",
        "name": "PSN 1000 DA",
        "price": 980,
        "quantity": 87
      },
      {
        "id": "type_003",
        "name": "PSN 2000 DA",
        "price": 1960,
        "quantity": 0
      }
    ]
  },
  "meta": {
    "timestamp": "2025-10-29T01:00:00.000Z"
  }
}

تطبيق هامش الربح

function applyMarkup(types, markupPercent = 5) {
  return types
    .filter((t) => t.quantity > 0)
    .map((t) => ({
      id: t.id,
      name: t.name,
      price: Math.ceil(t.price * (1 + markupPercent / 100)),
      available: true,
    }));
}

// Usage
const customerPrices = applyMarkup(data.types, 5); // 5% markup

أفضل الممارسات

التحقق من المخزون

تأكد من quantity > 0 قبل العرض

تطبيق الهامش

أضف هامش ربحك إلى price

إخفاء السعر

لا تُظهر أبداً price الجملة للعملاء

التحديث المنتظم

قم بتحديث المخزون بشكل دوري

روابط ذات صلة

الحصول على الكتالوج

تصفح جميع المنتجات

تقديم طلب

شراء منتج