توضّح هذه الصفحة كيفية تحديد المشاكل المتعلّقة بواجهة برمجة التطبيقات الفرعية Promotions وحلّها.
إنشاء حملة ترويجية
عند استخدام طلب accounts.promotions.insert لإدراج عرض ترويجي، تأكَّد من تضمين جميع الحقول المطلوبة في نص الطلب. يجب ملء الحقول التالية:
promotion.promotionIdpromotion.contentLanguagepromotion.redemptionChannelpromotion.targetCountrypromotion.attributes.longTitlepromotion.attributes.promotionEffectiveTimePeriod.startTimepromotion.attributes.promotionEffectiveTimePeriod.endTimepromotion.attributes.promotionDestinationspromotion.attributes.couponValueTypepromotion.attributes.offerTypepromotion.attributes.productApplicabilitypromotion.attributes.promotionUrl
الفترة الزمنية السارية للعرض الترويجي غير صالحة
إذا قدّمت تواريخ سريان غير صالحة للعروض الترويجية في طلب accounts.promotions.insert، ستظهر لك رسالة الخطأ التالية:
Invalid value at 'promotion.attributes.promotion_effective_time_period.start_time'
لحلّ هذا الخطأ، تأكَّد من أنّ القيمة المقدَّمة للحقل promotionDisplayTimePeriod.startTime هي نفسها أو قبل القيمة المقدَّمة للحقل promotionEffectiveTimePeriod.startTime. تأكَّد أيضًا من أنّ القيمة المقدَّمة للحقل promotionDisplayTimePeriod.endTime هي نفسها أو قبل القيمة المقدَّمة للحقل promotionEffectiveTimePeriod.endTime.
يجب أن تكون قيم الحقلَين startTime وendTime بالتنسيق RFC3339 UTC، أي yyyy-mm-ddThh:mm:ssZ. على سبيل المثال، 2024-08-15T18:20:20Z.
لم يتم تحديد الحدّ الأدنى لكمية السلع المطلوب شرائها
إذا كانت قيمة attributes.couponValueType هي BUY_M_GET_N_PERCENT_OFF أو BUY_M_GET_N_MONEY_OFF، يجب تقديم قيمة للحقل attributes.minimumPurchaseQuantity في طلب accounts.promotions.insert.
إذا لم تقدّم قيمة للحقل attributes.minimumPurchaseQuantity في طلب accounts.promotions.insert، ستظهر لك رسالة الخطأ التالية:
[minimumPurchaseQuantity] Missing benefit or restriction attributes for its type
لحلّ هذا الخطأ، تأكَّد من تقديم قيمة للحقل minimumPurchaseQuantity في طلبك.
لم يتم تحديد مبلغ الخصم النقدي
إذا كانت قيمة الحقل attributes.couponValueType هي MONEY_OFF، عليك تقديم قيمة للحقل attributes.moneyOffAmount في طلب accounts.promotions.insert.
إذا لم تقدّم قيمة للحقل attributes.moneyOffAmount في طلبك accounts.promotions.insert، ستظهر لك رسالة الخطأ التالية:
[moneyOffAmount] Missing benefit or restriction attributes for its type
لحلّ هذا الخطأ، تأكَّد من تقديم قيمة للحقل attributes.moneyOffAmount في طلبك. يجب أن يكون المبلغ بالميكرو.
لم يتم تحديد وصف الهدية المجانية
إذا كانت قيمة الحقل attributes.couponValueType هي FREE_GIFT، عليك تقديم قيمة للحقل attributes.freeGiftDescription في طلب accounts.promotions.insert.
إذا لم تقدّم قيمة للحقل attributes.freeGiftDescription في طلب accounts.promotions.insert، ستظهر لك رسالة الخطأ التالية:
[freeGiftDescription] Missing benefit or restriction attributes for its type
لحلّ هذا الخطأ، تأكَّد من تقديم قيمة للحقل attributes.freeGiftDescription في طلبك.
لا تتوفّر خدمة الشحن المجاني للعروض الترويجية المحلية
إذا كانت قيمة الحقل redemptionChannel هي IN_STORE وقيمة الحقل attributes.couponValueType هي FREE_SHIPPING_STANDARD أو FREE_SHIPPING_OVERNIGHT أو FREE_SHIPPING_TWO_DAY، ستظهر لك رسالة الخطأ التالية:
[shippingServiceNames] Free shipping types are not supported for local promotions
لحلّ هذا الخطأ، تأكَّد من أنّ قيمة الحقل redemptionChannel هي ONLINE.
لم يتم تحديد كيفية تحصيل القيمة
إذا لم يتم تحديد قيمة الحقل redemptionChannel في طلب accounts.promotions.insert، ستظهر لك رسالة الخطأ التالية:
[redemptionChannel] Required parameter: redemptionChannel
لحلّ هذا الخطأ، تأكَّد من تقديم قيمة للحقل redemptionChannel في طلبك.
لا يتطابق الحقل contentLanguage الخاص بالعرض الترويجي ومصدر البيانات
إذا كانت قيمة الحقل contentLanguage لا تتطابق مع قيمة الحقل contentLanguage في مصدر بيانات العروض الترويجية الذي تستخدمه في طلب accounts.promotions.insert، سيظهر لك رسالة الخطأ التالية:
[promotion] Could not find the proper data target for the provided feedLabel and contentLanguage
لحلّ هذا الخطأ، تأكَّد من أنّ قيمة الحقل contentLanguage هي نفسها قيمة الحقل contentLanguage في مصدر بيانات العروض الترويجية الذي تستخدمه.
سيظهر لك هذا الخطأ أيضًا إذا كانت قيمة targetCountry لا تتطابق مع قيمة حقل targetCountry في مصدر بيانات العروض الترويجية الذي تستخدمه.