你可以使用 Merchant API 以程式輔助方式上傳及管理產品。accounts.products
資源可讓您建立網路商店目錄,也就是產品和優惠清單。如要進一步瞭解如何使用 Merchant API 上傳及管理產品,請參閱「Merchant Products API 總覽」。
以下是 Content API for Shopping 與 Merchant Products API 的比較範例:
|
Content API for Shopping |
Merchant Products API |
說明 |
網址 |
https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/products/
|
https://merchantapi.googleapis.com/products/v1beta/ {PARENT}/productInputs:insert
|
Merchant API 要求網址中的 {PARENT} 變數代表帳戶的專屬 ID。 |
ID |
{ID} |
{NAME} |
|
方法
以下比較 Content API for Shopping 和 Merchant Products API 中的產品方法:
方法 |
Content API for Shopping |
Merchant Products API |
customBatch |
是 |
否 |
insert |
是 |
是 |
get |
是 |
是 |
update |
是 |
不適用 |
delete |
是 |
是 |
list |
是 |
是 |
以下是 Content API for Shopping 和 Merchant Products API 的 GET
方法比較範例:
Content API for Shopping |
Merchant API |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {ACCOUNT_ID}/products/ {PRODUCT_ID} |
GET https://merchantapi.googleapis.com/products/v1beta/ {name=accounts/*/products/*} |
要求
方法 |
Content API for Shopping 中的網址 |
Merchant Products API 中的網址 |
Content API 中的 ID |
Merchant Products API 中的 ID |
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} |
update |
PATCH https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/products/ {PRODUCT_ID} |
不適用 |
|
|
delete |
DELETE https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/products/ {PRODUCT_ID} |
DELETE https://merchantapi.googleapis.com/products/v1beta/{name=accounts/*/productInputs/*}?dataSource=accounts/ {MERCHANT_ID}/dataSources/ {DATASOURCE_ID} |
{MERCHANT_ID}/datafeeds/ {PRODUCT_ID} |
{name=accounts/*/productInputs/*} |
get |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/products/ {PRODUCT_ID} |
GET https://merchantapi.googleapis.com/products/v1beta/{name=accounts/*/products/*} |
{MERCHANT_ID}/datafeeds/ {PRODUCT_ID} |
{name=accounts/*/products/*} |
list |
GET https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID}/products |
GET https://merchantapi.googleapis.com/products/v1beta/ {parent=accounts/*}/products |
{MERCHANT_ID} |
{parent=accounts/*} |
資源
Content API for Shopping |
Merchant Products API |
說明 |
|
|
在 Content API for Shopping 的 Product 資源中,多個欄位已移至 Merchant Products API 的 ProductInput 資源中 Attribute 欄位。 |