توضّح هذه الصفحة كيفية تحديد المشاكل وحلّها في ما يتعلّق بواجهة برمجة التطبيقات Merchant Promotions API.
إنشاء حملة ترويجية
عند استخدام طلب accounts.promotions.insert
لإدراج عرض ترويجي، تأكَّد من تضمين جميع الحقول المطلوبة في محتوى طلبك. يجب ملء الحقول التالية:
promotion.promotionId
promotion.contentLanguage
promotion.redemptionChannel
promotion.targetCountry
promotion.attributes.longTitle
promotion.attributes.promotionEffectiveTimePeriod.startTime
promotion.attributes.promotionEffectiveTimePeriod.endTime
promotion.attributes.promotionDestinations
promotion.attributes.couponValueType
promotion.attributes.offerType
promotion.attributes.productApplicability
promotion.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
بتنسيق UTC بالتنسيق
RFC3339، أي
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
في مصدر data
العروض الترويجية الذي تستخدمه.
سيظهر لك هذا الخطأ أيضًا إذا لم تكن قيمة targetCountry
نفسها قيمة حقل targetCountry
في مصدر بيانات العروض الترويجية
الذي تستخدمه.