אפשר להשתמש ב-Merchant API כדי להעלות ולנהל את המוצרים באופן פרוגרמטי. המשאב accounts.products
מאפשר ליצור קטלוג של חנות וירטואלית, כלומר רשימה של מוצרים ומבצעים. מידע נוסף על העלאה וניהול של מוצרים באמצעות Merchant API זמין במאמר סקירה כללית על Merchant Products API.
שינויים במשאבים
המשאבים products
ו-productstatuses
של Content API מוחלפים במשאבים productInputs
ו-products
.
אפשר להשתמש במשאב productInputs
של Merchant API כדי להעלות את פרטי המוצרים. אפשר להשתמש במשאב product
של Merchant API כדי לאחזר את המוצרים שעברו עיבוד, כולל הסטטוסים שלהם.
דרישות לגבי מקור הנתונים
ב-Merchant API, צריך לציין את מקור הנתונים של היעד כשאתם מעלים מוצרים. זה יכול להיות מקור נתונים ראשי או מקור נתונים משלים. אפשר לאחזר את מקורות הנתונים הקיימים באמצעות dataSources.list או ליצור מקור נתונים חדש באמצעות dataSources.create.
לחלופין, אפשר להשתמש בממשק המשתמש של Merchant Center כדי לנהל את מקורות הנתונים.
מידע נוסף על מקורות נתונים ועל האופן שבו יוצרים אותם ומנהלים אותם זמין במאמר סקירה כללית על Merchant Data sources API.
שינויים במזהים
ב-Merchant API נעשה שימוש ב-name כדי לזהות את המוצר. שם המוצר יהיה בפורמט accounts/{account}/products/{product}
, כאשר {product}
יהיה בפורמט channel~language~feedLabel~offerId
.
משאבי Content API השתמשו ב-:
במקום ב-~
בין כל ערך במזהה:
channel:language:feedLabel:offerId
.
כל הקריאות ל-Merchant API מחזירות את הפורמט החדש עם ~
בין הערכים של המזהה. מומלץ לשמור את השדה החדש name
מהתגובה ולהשתמש בו בקריאות עתידיות.
Methods
בהמשך מופיעה השוואה בין השיטות של המוצרים ב-Content API for Shopping לבין Merchant Products API:
Content API for Shopping | Merchant Products API |
---|---|
products.custombatch | לא זמין |
products.insert | productInputs.insert |
products.update | הנתונים עדיין אינם זמינים |
products.delete | productInputs.delete |
products.get | products.get |
products.list | products.list |
productstatuses.custombatch | לא זמין |
productstatuses.get | products.get |
productstatuses.list | products.list |
בקשות
שיטת Content API | כתובת URL ב-Content API for Shopping | כתובת URL ב-Merchant Products API | מזהה ב-Content API | מזהה ב-Merchant Products API |
---|---|---|---|---|
products.insert |
POST https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/products |
POST https://merchantapi.googleapis.com/products/v1beta/ {PARENT}/productsInputs:insert?dataSource=accounts/ {MERCHANT_ID}/dataSources/ {DATASOURCE_ID} |
MERCHANT_ID | PARENT=accounts/{MERCHANT_ID} |
products.update |
PATCH https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/products/ {PRODUCT_ID} |
לא זמין | ||
products.delete |
DELETE https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/products/ {PRODUCT_ID} |
DELETE https://merchantapi.googleapis.com/products/v1beta/ {NAME}?dataSource=accounts/ {MERCHANT_ID}/dataSources/ {DATASOURCE_ID} |
MERCHANT_ID, PRODUCT_ID | NAME=accounts/{MERCHANT_ID}/productInputs/{PRODUCT_ID_WITH_TILDES} |
products.get |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/products/ {PRODUCT_ID} |
GET https://merchantapi.googleapis.com/products/v1beta/ {NAME} |
MERCHANT_ID, PRODUCT_ID | NAME=accounts/{MERCHANT_ID}/products/{PRODUCT_ID_WITH_TILDES} |
products.list |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/products |
GET https://merchantapi.googleapis.com/products/v1beta/ {PARENT}/products |
MERCHANT_ID | PARENT=accounts/{MERCHANT_ID} |
productstatuses.get |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/productstatuses/ {PRODUCT_ID} |
GET https://merchantapi.googleapis.com/products/v1beta/ {NAME} |
MERCHANT_ID, PRODUCT_ID | NAME=accounts/{MERCHANT_ID}/products/{PRODUCT_ID_WITH_TILDES} |
productstatuses.list |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/productstatuses |
GET https://merchantapi.googleapis.com/products/v1beta/ {PARENT}/products |
MERCHANT_ID | PARENT=accounts/{MERCHANT_ID} |