Google Shopping Component
The Google Content API for Shopping can be used to manage and automate Google Merchant Center account management.
Component key: google-content-shoppingDescription
The Google Content API for Shopping can be used to manage and automate Google Merchant Center account management. Use the Google Content API to Upload Products, Manage Inventory, and Manage Orders and Returns.
Connections
OAuth2
All requests to the Google Content API for Shopping must be authorized by an authenticated user.
The details of the authorization process, or "flow," for OAuth 2.0 vary somewhat depending on what kind of application you're writing. The following general process applies to all application types:
- When you create your application, you register it using the Google API Console. Google then provides information you'll need later, such as a client ID and a client secret.
- From APIs & Services > Library, activate the Google Content API for Shopping
- To create API Credentials navigate to Enabled APIs & Services and select Content API for Shopping
- Select Create Credentials
- Ensure Content API for Shopping is set for Select an API*
- Choose User Data and select Next
- Fill out the OAuth consent screen with an app name (your company or product's name), support email, app logo, domain, etc.
- Select Add Or Remove scopes, search Content API for Shopping, and check the boxes for the following scopes
- For OAuth Client ID, under Application type select Web application.Under Authorized redirect URIs enter Prismatic's OAuth 2.0 callback URL:
https://oauth2.prismatic.io/callback
Click CREATE.- Take note of the Client ID and Client Secret that are generated, as you will enter them into Prismatic for Authentication.
- Client Id and Secret can also be obtained in the Credentials Page under the OAuth 2.0 Client IDs section by selecting the name of the OAuth client created.
Triggers
PubSub Notification
PubSub Notification Trigger Settings | key: myTrigger
The Push Notifications service lets you to receive notifications that an order has been created. This is called "push" since Google will push notifications to you about events, such as orders, that happen on the Google side.
The Content API's
pubsubnotificationsettings.update
receives the request and sends you back acloudTopicName
.To configure additional Topics
- In the Google Cloud console, select the navigation menu scroll to the Pub/Sub page (Navigation Menu > More Products > Analytics > Pub/Sub)
- In the Topics page, click Create Topic
- In the window that opens, enter
MyTopic
in the Topic ID field.- Leave the default values for the remaining options, and then click Create.
- You see the success message:
A new topic and a new subscription have been successfully created.
- You have just created a topic called
MyTopic
and an associated default subscriptionMyTopic-sub
.
- In the window that opens, enter
You create a subscription for the topic and register the URL push endpoint with Cloud Pub/Sub.
To Configure Subscription go to Pub/Sub > Subscriptions
In the Subscriptions page, click Create subscription.
Enter
MySub
in the Subscription ID field.For Select a Cloud Pub/Sub topic, select the
MyTopic
topic from the drop-down menuLeave the default values for the remaining options.
Click Create
- You see the success message:
Subscription successfully added.
- You see the success message:
Click the Topics page and click
MyTopic
.The
MySub
subscription is now attached to the topicMyTopic
. Pub/Sub delivers all messages sent toMyTopic
to theMySub
andMyTopic-sub
subscriptions.
Cloud Pub/Sub accepts your subscription and associates that
cloudTopicName
with your URL. When messages are published to thatcloudTopicName
(for example, your order notifications), they will be sent to your URL push endpoint.
Request
PUT https://shoppingcontent.googleapis.com/content/v2.1/merchantId/pubsubnotificationsettings
Actions
Batch Local Inventory
Updates local inventory for multiple products or regions in a single request. | key: batchLocalInventory
Batch Product
Retrieves, inserts, and deletes multiple products in a single request. | key: batchProduct
Batch Regional Inventory
Updates regional inventory for multiple products or regions in a single request. | key: batchRegionalInventory
Cancel Order
Cancels all line items in an order, making a full refund. | key: cancelOrder
Create Account
Creates a Merchant Center sub-account. | key: createAccount
Create Order Return
Create return in your Merchant Center account. | key: createOrderReturn
Create Product
Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry. | key: createProduct
Delete Account
Deletes a Merchant Center sub-account. | key: deleteAccount
Delete Product
Deletes a product from your Merchant Center account. | key: deleteProduct
Get Account
Retrieves a Merchant Center account. | key: getAccount
Get Order
Retrieves an order from your Merchant Center account. | key: getOrder
Get Order Return
Retrieves an order return from your Merchant Center account. | key: getOrderReturn
Get Product
Retrieves a product from your Merchant Center account. | key: getProduct
Get PubSub Notification Settings
Retrieves a Merchant Center account's pubsub notification settings. | key: getPubSubNotification
List Accounts
Lists the sub-accounts in your Merchant Center account. | key: listAccounts
List Orders
Lists the orders in your Merchant Center account. | key: listOrders
List Orders Returns
Lists order returns in your Merchant Center account. | key: listReturnsOrders
List Products
Lists the products in your Merchant Center account. | key: listProducts
Process Order Return
Processes return in your Merchant Center account | key: processOrderReturn
Raw Request
Send raw HTTP request to Google Content Shopping | key: rawRequest
Update Account
Updates a Merchant Center account. Any fields that are not provided are deleted from the resource. | key: updateAccount
Update Product
Updates an existing product in your Merchant Center account. Only updates attributes provided in the request. | key: updateProduct
Update Product Local Inventory
Updates the local inventory of a product in your Merchant Center account. | key: updateProductLocalInventory
Update Product Regional Inventory
Updates the regional inventory of a product in your Merchant Center account. If a regional inventory with the same region ID already exists, this method updates that entry. | key: updateProductRegionalInventory
Update PubSub Notification
Register a Merchant Center account for pubsub notifications. Note that cloud topic name shouldn't be provided as part of the request. | key: updatePubSubNotification