คุณสามารถใช้ 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
คำขอ
หากต้องการส่งคำขอ ให้ใช้ 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"
}
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 ราคา
ตอนนี้ระบบจะบันทึกจำนวนราคา เป็นหน่วยไมโคร
ชื่อช่องจำนวน เปลี่ยนจาก value เป็น
ชื่อช่องสกุลเงิน เปลี่ยนเป็น
|
| 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,
]
}
]
}
|
|