This guide explains how to use the
EmailPreferences
resource to manage your Merchant Center email
notifications, and see which
types of emails your account's
users
receive.
For the full list of email notification types, see the EmailPreferences
reference.
You can only use the Merchant API to manage email notifications for accounts where you're added as a user.
To view or update email notifications, you need the following values:
- The email address of the user that receives the emails. You can find their
email address in the
name
field of theUser
resource. - The merchant ID of the account to start or stop receiving emails about. If the merchant account is an advanced account, and the user has access to the advanced account, use the merchant ID of the advanced account.
Opt in or out of notifications
To update the email notification settings for a specific merchant account, call
accounts.v1beta.accounts.users.updateEmailPreference
with the merchantId
of the account and the email address of the user.
Use the following values to control the email notifications the user receives:
OPTED_IN
: Receive email notifications for the account.OPTED_OUT
: Don't receive email notifications for the account.
Here's a sample request to opt a user out of email notifications for a specific merchant account:
PATCH https://merchantapi.googleapis.com/accounts/v1beta/accounts/merchantId/users/emailAddress/emailPreferences
{
"newsAndTips": "OPTED_OUT"
}
View existing notifications
To see the current email notification settings for a specific user, call
accounts.v1beta.accounts.users.getEmailPreferences
.
Here's a sample request, where the merchantId
is the merchant ID of the
account the email notifications are about, and the emailAddress
is the email
address of the user that receives the emails.
GET https://merchantapi.googleapis.com/accounts/v1beta/accounts/merchantId/users/emailAddress/emailPreferences
Here's a sample response from a successful call:
{
"name": "accounts/merchantId/users/emailAddress/emailPreferences",
"newsAndTips": "OPTED_IN"
}
For more information about email notifications, see Change your Merchant Center email preferences.