คุณสามารถใช้ Merchant Promotions API เพื่อสร้างและจัดการโปรโมชันจากผู้ขายใน Google ได้ ทรัพยากร accounts.promotions ช่วยให้คุณแสดงข้อเสนอพิเศษสำหรับผลิตภัณฑ์ที่ขายใน Google ได้
ดูข้อมูลเพิ่มเติมได้ที่ภาพรวมของโปรโมชันจากผู้ขาย API
ภาพรวมการเปลี่ยนแปลงจาก Content API for Shopping เป็น Merchant API
ความแตกต่างที่สำคัญคือ Content API for Shopping จะสร้างแหล่งข้อมูลโดยอัตโนมัติเมื่อแทรกโปรโมชันครั้งแรก ซึ่งจะไม่เกิดขึ้นกับ Merchant API หากต้องการแทรกโปรโมชันโดยใช้ Merchant API คุณต้องสร้างแหล่งข้อมูลโปรโมชันก่อน
ดูข้อมูลเกี่ยวกับฟิลด์ในออบเจ็กต์ promotionDataSource ในทรัพยากร accounts.dataSources ได้ที่ PromotionDataSource
แหล่งข้อมูลที่มีอยู่
สำหรับแหล่งข้อมูลที่มีอยู่ หากคุณไม่ทราบ accounts.dataSources.name ให้ใช้ dataSources.list เพื่อดึงข้อมูล
หรือจะระบุแหล่งข้อมูลสำหรับโปรโมชันแต่ละรายการโดยใช้เมธอด accounts.promotions.get และตรวจสอบช่อง dataSource ในการตอบกลับของโปรโมชันที่มีอยู่ในบัญชีก็ได้
หากต้องการอ้างอิงโดยตรงในการเรียก API ในอนาคต เราขอแนะนำอย่างยิ่งให้จัดเก็บ accounts.dataSources.name ไว้ในฐานข้อมูลในเครื่องสำหรับโปรโมชันแต่ละรายการ
คำขอ
หากต้องการส่งคำขอ ให้ใช้ URL ต่อไปนี้
POST https://merchantapi.googleapis.com/promotions/v1/{ACCOUNT_NAME}/promotions
ย้ายข้อมูลจาก Content API for Shopping
ตารางต่อไปนี้เปรียบเทียบ Content API for Shopping กับโปรโมชันจากผู้ขายสำหรับคำขอที่เกี่ยวข้องกับโปรโมชัน
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
ดูตัวอย่างเพื่อใช้อ้างอิงได้ที่ accounts.promotions
| 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
ตอนนี้ระบบจะบันทึกจำนวนราคาเป็นไมโคร
ชื่อช่อง amount เปลี่ยนจาก value เป็น
ชื่อช่อง 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,
]
}
]
}
|
|