คุณสามารถใช้ Merchant Promotions API เพื่อสร้างและจัดการโปรโมชันใน Google ได้ แหล่งข้อมูล
accounts.promotions
ช่วยให้คุณแสดงข้อเสนอพิเศษสำหรับผลิตภัณฑ์ที่ขายบน Google ได้
ดูข้อมูลเพิ่มเติมได้ที่ภาพรวมของ 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/v1/{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/v1/{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/v1/{parent=accounts/*}/promotions |
ตัวระบุ | {MERCHANT_ID}/promotions/{PROMOTION_ID} |
{NAME} |
เมธอด |
|
|
การเปลี่ยนแปลงฟิลด์
ตารางแสดงการเปลี่ยนแปลงสำหรับโปรโมชันใน Merchant Promotions API
ดูตัวอย่างเพื่อเป็นข้อมูลอ้างอิงได้ที่สินค้าคงคลังในร้าน
Content API for Shopping | Merchant API | คำอธิบาย |
---|---|---|
(ไม่สนับสนุน) | custom_attributes |
รายการแอตทริบิวต์ที่กำหนดเอง (ผู้ใช้ระบุ) คุณยังใช้เพื่อส่งแอตทริบิวต์ใดก็ได้ของข้อกำหนดฟีดในรูปแบบทั่วไปได้ด้วย
ตัวอย่างเช่น { "name": "size type", "value": "regular" } แสดงอย่างชัดเจน |
ไม่รองรับ | data_source | การสร้างโปรโมชันต้องมีแหล่งข้อมูลอยู่แล้ว |
ไม่รองรับ | แอตทริบิวต์ |
แอตทริบิวต์เฉพาะของโปรโมชัน เช่น
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
ตอนนี้ระบบจะบันทึกจํานวนราคาเป็นหน่วยไมโคร
ชื่อฟิลด์จำนวนเปลี่ยนจากค่าเป็น
ชื่อฟิลด์ currency เปลี่ยนเป็น
|
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, ] } ] } |