ย้ายข้อมูลการจัดการโปรโมชัน

คุณสามารถใช้ Merchant Promotions API เพื่อสร้างและจัดการโปรโมชันใน Google ได้ แหล่งข้อมูลนี้ช่วยให้คุณแสดงข้อเสนอพิเศษสำหรับผลิตภัณฑ์ที่ขายบน Google ได้accounts.promotions ดูข้อมูลเพิ่มเติมได้ที่ภาพรวมของ Merchant Promotions API

ภาพรวมของการเปลี่ยนแปลงจาก Content API for Shopping เป็น Merchant API

ความแตกต่างที่สำคัญคือ Content API for Shopping จะสร้างแหล่งข้อมูลโดยอัตโนมัติเมื่อมีการแทรกโปรโมชันครั้งแรก ซึ่ง Merchant API จะไม่ทำเช่นนั้น หากต้องการแทรกโปรโมชันโดยใช้ Merchant API ก่อนอื่นคุณต้องสร้างแหล่งข้อมูลโปรโมชัน ดูข้อมูลเกี่ยวกับฟิลด์ในออบเจ็กต์ promotionDataSource ในแหล่งข้อมูล accounts.dataSources ได้ที่ PromotionDataSource

คำขอ

หากต้องการส่งคำขอ ให้ใช้ URL ต่อไปนี้

POST https://merchantapi.googleapis.com/promotions/v1beta/{ACCOUNT_NAME}/promotions

ย้ายข้อมูลจาก Content API for Shopping

ข้อมูลต่อไปนี้เปรียบเทียบ Content API for Shopping กับ Merchant Promotions API สำหรับคำขอที่เกี่ยวข้องกับโปรโมชัน

URL

ใน Content API for Shopping

https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/promotions

ใน Merchant API จะเปลี่ยนเป็น

https://merchantapi.googleapis.com/promotions/v1beta/{parent=accounts/*}/promotions

รหัสระบุ

ใน Content API for Shopping

{MERCHANT_ID}/promotions/{PROMOTION_ID}

ใน Merchant API จะเปลี่ยนเป็น

{NAME}

เมธอด

Merchant API รองรับวิธีการต่อไปนี้สำหรับโปรโมชัน

  • แทรกโปรโมชัน
  • รับโปรโมชัน
  • แสดงโปรโมชัน

การเปรียบเทียบความพร้อมใช้งานของวิธีการโปรโมตใน Content API for Shopping และ Merchant API มีดังนี้

ฟีเจอร์ Content API for Shopping Merchant API
URL https://shoppingcontent.googleapis.com/content/v2.1/{MERCHANT_ID}/promotions https://merchantapi.googleapis.com/promotions/v1beta/{parent=accounts/*}/promotions
ตัวระบุ {MERCHANT_ID}/promotions/{PROMOTION_ID} {NAME}
เมธอด
  • insert
  • get
  • list
  • customBatch
  • delete
  • insert
  • get
  • list
  • delete

การเปลี่ยนแปลงในช่อง

ตารางแสดงการเปลี่ยนแปลงสำหรับโปรโมชันใน Merchant Promotions API

ดูตัวอย่างเพื่อใช้เป็นข้อมูลอ้างอิงได้ที่สินค้าคงคลังในร้าน

Content API for Shopping Merchant API คำอธิบาย
(ไม่สนับสนุน) custom_attributes รายการแอตทริบิวต์ที่กำหนดเอง (ที่ผู้ใช้ระบุ) คุณยังใช้รูปแบบนี้เพื่อส่งแอตทริบิวต์ของข้อกําหนดฟีด
ในรูปแบบทั่วไปได้ด้วย

เช่น
{
  "name": "size type", "value": "regular"
}
ซึ่งมีประโยชน์สำหรับการส่งแอตทริบิวต์ที่ API ไม่ได้แสดงอย่างชัดเจน
ไม่รองรับ data_source การสร้างโปรโมชันต้องใช้แหล่งข้อมูลที่มีอยู่
ไม่รองรับ attributes แอตทริบิวต์ที่เฉพาะเจาะจงสำหรับโปรโมชัน เช่น
long_tile, promotion_effective_timeperiod,
และอื่นๆ จะเป็นส่วนหนึ่งของข้อความแอตทริบิวต์
item_id item_id_inclusion เปลี่ยนชื่อรายการรหัสสินค้าที่โปรโมชันมีผล
store_id store_id_inclusion เปลี่ยนชื่อรายการรหัสร้านค้าที่โปรโมชันมีผลใช้กับ
product_type product_type_inclusion เปลี่ยนชื่อรายการประเภทผลิตภัณฑ์ที่โปรโมชันมีผลใช้
item_group_id item_group_id_inclusion เปลี่ยนชื่อรายการรหัสกลุ่มสินค้าที่มีโปรโมชันใช้
brand brand_inclusion เปลี่ยนชื่อรายการแบรนด์ที่ใช้โปรโมชัน
store_code store_codes_inclusion เปลี่ยนชื่อรายการรหัสร้านค้าที่ใช้กับโปรโมชัน
price:
  {
    object (Price)
  }
price:
  {
    object (Price)
  }
คำจำกัดความของราคามีการเปลี่ยนแปลง

ใน Content API for Shopping Price
คือตัวเลขทศนิยมในรูปแบบสตริง

ตอนนี้ระบบจะบันทึกจำนวนราคาเป็นหน่วยไมโคร โดยที่
1 ล้านหน่วยไมโครมีค่าเท่ากับหน่วยมาตรฐาน
ของสกุลเงิน

ชื่อช่อง amount เปลี่ยนจาก value เป็น
amountMicros

ชื่อช่อง currency เปลี่ยนเป็น
currencyCode รูปแบบจะยังคงเป็น
ISO 4217 (วิกิพีเดีย)

order_limit (ไม่สนับสนุน) ระบบไม่รองรับแอตทริบิวต์ order_limit
shippingServiceNames[] (ไม่สนับสนุน) ระบบไม่รองรับ shippingServiceNames[]
money_budget (ไม่สนับสนุน) ระบบไม่รองรับ money_budget
promotion_destination_ids promotion_destinations เปลี่ยนชื่อ promotionDestinationIds
สถานะโปรโมชัน
{
  "destinationStatuses": [
    {
      "destination": string,
      "status": enum (State)
    }
  ],
  "promotionIssue": [
    {
    "code": string,
    "detail": string
    }
  ],
  "creationDate": string,
  "lastUpdateDate": string
}
สถานะโปรโมชันมีการเปลี่ยนแปลง
ดูรายละเอียดระดับละเอียดเพิ่มเติมได้ในปัญหา
promotionStatus = {
  destinationStatuses = [
     {
     reportingContext = Enum
     status = Enum
     },
  ],
  itemLevelIssues = [
    {
    code = String
    severity = Enum
    resolution = String
    reportingContext = Enum
    description = String
    detail = String
    documentation = String applicableCountries = [
      String,
    ]
    }
  ]
}