แก้ปัญหาเกี่ยวกับ API ย่อยของโปรโมชัน

หน้านี้จะอธิบายวิธีแก้ปัญหาที่เกี่ยวข้องกับ Promotions sub-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 ของแหล่งข้อมูลโปรโมชัน ที่คุณใช้

คุณจะเห็นข้อผิดพลาดนี้ด้วยหากค่าของ targetCountry ไม่ตรงกับค่าของฟิลด์ targetCountry ของแหล่งข้อมูลโปรโมชันที่คุณใช้

ดูข้อมูลเพิ่มเติม