Часто задаваемые вопросы

В этом разделе рассматриваются часто задаваемые вопросы, касающиеся регистрации разработчиков для использования API для продавцов.

Общая регистрация

Часто задаваемые вопросы о процессе регистрации:

Обязательна ли регистрация разработчика для использования Merchant API?

Да. Вам необходимо зарегистрировать свои контактные данные разработчика, чтобы Google мог отправлять важные обновления, касающиеся API, такие как объявления о сервисе и информация о новых функциях.

Если вы просто хотите изучить и протестировать Merchant API, вы можете использовать такие инструменты, как Google OAuth Playground и API Explorer, которые не требуют регистрации.

Как часто мне нужно регистрироваться?

Регистрация — это одноразовая процедура для каждого проекта Google Cloud. Независимо от того, работаете ли вы с несколькими торговыми учетными записями или нет, операция регистрации выполняется только один раз, и она применяется ко всем пользователям и сервисным учетным записям в рамках связанного проекта Google Cloud.

После успешной регистрации проекта Google Cloud ссылка остается активной, если ее явно не удалить, вызвав метод unregisterGcp . Вы не можете регистрировать общие проекты, принадлежащие Google, такие как API Explorer или OAuth Playground.

Какой адрес электронной почты мне следует указать в качестве контактного лица разработчика?

Мы рекомендуем использовать корпоративный адрес электронной почты отдельного пользователя. В качестве альтернативы можно использовать общие групповые псевдонимы. Использовать адреса электронной почты служебных учетных записей нельзя, поскольку сообщения предназначены для получателей-людей. Google рассылает важные обновления, касающиеся API, такие как объявления о сервисах и информация о новых функциях.

Если адрес электронной почты принадлежит существующему пользователю в учетной записи Merchant Center, ему автоматически предоставляется роль API developer . В противном случае на этот адрес отправляется приглашение.

Поле «Адрес электронной почты разработчика» в методе registerGcp является необязательным. Если при регистрации вы не указываете значение в этом поле, вам необходимо создать пользователя с ролью API developer либо в пользовательском интерфейсе Merchant Center, либо вызвав метод accounts.users.create .

Обязательно ли указывать адрес электронной почты разработчика в учетной записи Google?

Да. Чтобы использовать существующий адрес электронной почты, не принадлежащий Google, вы можете связать его с учетной записью Google, выбрав опцию «Использовать существующий адрес электронной почты» в процессе регистрации учетной записи Google . Вы не можете использовать адреса электронной почты служебных учетных записей, поскольку служебные учетные записи не могут получать электронные письма.

Как выполнить аутентификацию и авторизацию при регистрации?

В зависимости от конкретного случая, для аутентификации и авторизации при регистрации доступны два различных сценария аутентификации:

  • OAuth 2.0 : для сторонних поставщиков или агентств, управляющих несколькими торговыми счетами.
  • Сервисные аккаунты : для доступа к вашему собственному аккаунту в Merchant Center.

Alt text for accessibility

На приведенной выше диаграмме показаны два потока аутентификации и авторизации для вызова регистрации. Вы можете выбрать один из следующих вариантов:

  • Использование OAuth с адресом электронной почты, например account@email.com , связанным с учетной записью Google.
  • Используя служебный аккаунт, например, sa@project.iam.gserviceaccount.com

Если вы решите использовать OAuth :

  • Создайте учетные данные OAuth в своем проекте Google Cloud для вашей электронной почты.
  • Убедитесь, что авторизующий адрес электронной почты существует в вашем Merchant Center и имеет тип доступа ADMIN

Если вы решите использовать сервисный аккаунт :

  • Убедитесь, что учетная запись службы существует в вашем проекте Google Cloud.
  • Убедитесь, что адрес электронной почты, связанный с учетной записью службы, существует в вашем Merchant Center и имеет тип доступа ADMIN

Выполните запрос на регистрацию в контексте безопасности аутентифицирующего пользователя, используя прямые вызовы API или клиентские библиотеки. Укажите адрес электронной почты для связи с разработчиком, например, developer@email.com .

Если запрос на регистрацию пройден успешно, в вашем Merchant Center появится пользователь с указанным адресом электронной почты разработчика и ролью API developer . В ответ вы получите ресурс DeveloperRegistration .

В чём разница между адресом электронной почты для аутентификации и адресом электронной почты для связи с разработчиком?

Эти два адреса электронной почты выполняют разные функции в экосистеме Merchant API:

  • Аутентификация по электронной почте : Обычно для авторизации запросов к API продавца используется адрес электронной почты, связанный с вашей учетной записью Google или учетной записью сервиса, при условии, что:
    • Она находится в вашем Торговом центре и имеет роль ADMIN .
    • В проекте Google Cloud, где включен Merchant API, размещается клиент OAuth или учетная запись службы, связанная с адресом электронной почты, который авторизует вызовы API.
  • Адрес электронной почты разработчика : Адрес электронной почты разработчика также должен быть связан с учетной записью Google, но он служит основным контактным лицом для важных уведомлений о сервисах и обновлениях API от Google. Он может принадлежать пользователю или группе пользователей. По умолчанию ему присваивается роль API developer в Merchant Center.

Обязательно ли мне принимать приглашение, полученное по электронной почте от разработчика?

Да. У указанного вами адреса электронной почты разработчика есть 14 дней, чтобы принять приглашение. Регистрация считается завершенной только после того, как он примет приглашение. Однако в течение этого времени вы можете выполнять вызовы API.

Если приглашение не будет принято в указанный срок, ссылка-приглашение утрачивает силу. Вы больше не сможете выполнять вызовы API продавца и вам придется перезапустить процесс регистрации.

Почему моя регистрация разработчика завершается ошибкой "тестовый аккаунт"?

Регистрация разработчиков ограничена рабочими (действующими) аккаунтами для обеспечения стабильности интеграции. Если вы используете аккаунт, созданный специально для тестирования и помеченный как «тестовый аккаунт» в Merchant Center, регистрация будет отклонена.

Могу ли я зарегистрировать дополнительный аккаунт, которым буду управлять для клиента?

Мы настоятельно рекомендуем зарегистрировать учетную запись, которая отражает идентичность вашей компании. Регистрация суб-аккаунта клиента не допускается и чревата ошибками; если этот клиент покинет ваш сервис или удалит учетную запись, вся ваша интеграция API может быть отключена.

Нужно ли подтверждать регистрацию моего сайта или достаточно просто верифицировать его?

Для регистрации разработчика веб-сайт должен быть верифицирован . Это подтверждает наличие у вас административного контроля над сайтом, связанным с учетной записью. Хотя подтверждение права доступа требуется для других функций, таких как товарная реклама, верификация является основным требованием для регистрации API.

Управление проектами и клиентскими отношениями

Часто задаваемые вопросы об управлении аккаунтами и проектами:

Я работаю с несколькими аккаунтами Merchant Center. Нужно ли мне регистрировать каждый аккаунт Merchant Center, который я хочу использовать, в Merchant API?

Нет. Если вы являетесь сторонним разработчиком или агентством, управляющим несколькими учетными записями продавцов, вы регистрируете свой проект Google Cloud в своей основной учетной записи Merchant Center, а не в учетных записях каждого из ваших продавцов. Таким образом, вы представляете разработчика во всей работе с API, которую вы выполняете для ваших продавцов.

Я работаю с несколькими учетными записями Merchant Center. Как мне выбрать основную учетную запись Merchant Center?

Выбор основного аккаунта зависит от типа вашего бизнеса:

  • Торговые площадки с уже существующим расширенным аккаунтом: Если ваша компания работает как торговая площадка и уже имеет расширенный аккаунт , представляющий всю платформу, используйте этот существующий идентификатор аккаунта в качестве основного аккаунта Merchant Center.
  • Сервисы сравнения цен (CSS): Если вы являетесь сервисом сравнения цен, используйте свой уникальный идентификатор учетной записи CSS или идентификатор групповой учетной записи CSS.
  • Агентства, разработчики и другие сторонние поставщики услуг: Если вы являетесь сторонним поставщиком услуг, например, агентством или сторонним разработчиком, управляющим несколькими торговыми счетами, и у вас нет единого идентификатора Merchant Center, представляющего вашу компанию, вам следует создать новый основной аккаунт Merchant Center и запросить его преобразование в расширенный аккаунт .

После регистрации вашего проекта Google Cloud в вашей основной учетной записи Merchant Center вы сможете использовать этот же проект для управления любой другой учетной записью Merchant Center, к которой у вас есть доступ, без необходимости регистрировать эти учетные записи по отдельности.

Я использую несколько проектов Google Cloud. Нужно ли регистрировать каждый из них?

Да. Поскольку процесс регистрации связывает вызывающий проект Google Cloud, вам необходимо выполнить вызов registerGcp из каждого проекта Google Cloud, который вы используете для выполнения вызовов API.

Один проект Google Cloud может быть зарегистрирован только в одном аккаунте Merchant Center одновременно. Однако к одному аккаунту Merchant Center может быть зарегистрировано несколько проектов Google Cloud. Аналогично, вы можете использовать один и тот же адрес электронной почты разработчика для выполнения нескольких регистраций в нескольких проектах Google Cloud или нескольких аккаунтах Merchant Center.

Что произойдет, если я зарегистрирую проект Google Cloud с несколькими учетными записями Merchant Center?

Попытка зарегистрировать проект Google Cloud, который уже зарегистрирован в другом аккаунте Merchant Center, приведет к ошибке ALREADY_REGISTERED .

Как мне аутентифицировать вызов API для регистрации разработчиков?

Для аутентификации вызова API регистрации разработчиков для API продавцов используются учетные данные, управляемые через проект Google Cloud. Для аутентификации доступны два основных варианта:

  • Использование учетной записи Google, например Gmail, с OAuth 2.0 : Этот метод использует учетные данные клиента OAuth 2.0, сгенерированные в вашем проекте Google Cloud. Вызов API авторизуется от имени конкретной учетной записи Google, в которую входит пользователь.
  • Сервисный аккаунт : Этот метод использует сервисный аккаунт Google Cloud, который представляет собой особый тип аккаунта Google, предназначенный для приложений. Учетные данные для сервисного аккаунта также управляются в рамках вашего проекта Google Cloud.

Для успешной регистрации разработчика, подтверждающая личность (учетная запись Google или сервисная учетная запись), должна соответствовать следующим критериям в Merchant Center:

  • Наличие учетной записи пользователя в Merchant Center : Адрес электронной почты, связанный с аутентифицирующей учетной записью Google или учетной записью службы, должен быть добавлен в качестве пользователя в регистрируемую вами учетную запись Merchant Center.
  • Требуется роль администратора : этому пользователю должна быть назначена роль ADMIN в рамках конкретной учетной записи Merchant Center.

При выполнении вызовов API:

  • Если вы используете прямые вызовы API , вам необходимо получить и предоставить действительный токен доступа в заголовке Authorization . Этот токен генерируется в процессе аутентификации OAuth 2.0 для учетной записи Google или в процессе аутентификации между серверами для учетной записи службы.
  • Клиентские библиотеки, предоставляемые Google, обычно берут на себя сложные задачи получения и обновления токенов доступа в рамках своей конфигурации.

Пользователь, выполняющий аутентификацию, может отличаться от пользователя, контактирующего с разработчиком . Для получения дополнительной информации см. раздел «В чем разница между адресом электронной почты, используемым для аутентификации, и адресом электронной почты, контактирующим с разработчиком?».

Как часто мне нужно обновлять токены доступа?

Токены доступа как для служебных учетных записей, так и для OAuth 2.0 обычно истекают через 1 час. Однако механизм получения нового токена зависит от используемого метода аутентификации:

  • Для создания нового токена доступа при необходимости учетные записи служб используют закрытый ключ или учетные данные среды .
  • В потоках OAuth 2.0 используется refresh_token для вызова конечной точки токена Google OAuth2, чтобы получить новый токен доступа со сроком действия 1 час.

Мы настоятельно рекомендуем использовать официальные библиотеки аутентификации Google, которые автоматически выполняют эту ротацию, благодаря чему ваше приложение никогда не будет простаивать.

Пользователи и роли

Часто задаваемые вопросы о пользователях и ролях:

Обязательно ли наличие учетной записи электронной почты разработчика в Merchant Center?

Нет. Если адрес электронной почты, указанный при регистрации, еще не существует в Merchant Center, Merchant API создаст учетную запись в Merchant Center с указанным адресом электронной почты в статусе «Ожидание». Если адрес электронной почты разработчика принадлежит существующему пользователю в учетной записи Merchant Center, ему автоматически предоставляется роль API developer .

Требуется ли для отправки контактного адреса разработчика права администратора в Merchant Center?

Нет. Пользователь Merchant Center, связанный с адресом электронной почты разработчика, по умолчанию получает роль API developer , необходимую для получения важных уведомлений. Однако у него минимальные права доступа в Merchant Center. Чтобы разрешить этому пользователю выполнять другие вызовы API или управлять настройками в пользовательском интерфейсе Merchant Center, необходимо предоставить ему дополнительные роли, такие как STANDARD или ADMIN . Дополнительную информацию о ролях Merchant Center см. в разделе «Типы доступа».

Какие права доступа имеет роль " API developer "?

Роль API developer — это роль с минимальными правами в Merchant Center. Если вы планируете использовать адрес электронной почты разработчика для авторизации вызовов к Merchant API, мы рекомендуем добавить права ADMIN или STANDARD права, чтобы разрешить пользователю выполнять вызовы API.

Нужно ли регистрировать каждого пользователя-разработчика или учетную запись службы, обращающиеся к API?

Нет. Регистрация разработчика привязана к проекту Google Cloud, используемому для выполнения вызовов API, а не к отдельным пользователям или учетным записям служб. После успешной регистрации проекта Google Cloud в вашей основной учетной записи Merchant Center вы можете использовать любую учетную запись, управляемую через связанный проект Google Cloud с помощью учетных данных OAuth или учетных записей служб, для авторизации вызовов API Merchant, при условии, что они существуют в вашем Merchant Center и им назначена роль ADMIN .

Как изменить адрес электронной почты для связи с разработчиками после первоначальной регистрации?

Для управления или изменения контактов используйте стандартную службу accounts.users или страницу «Доступ и услуги» в пользовательском интерфейсе Merchant Center, чтобы добавлять или удалять пользователей с ролью API developer .

Что произойдет, если последний пользователь с именем « API developer » будет удален из учетной записи Merchant Center?

Для предотвращения немедленных перебоев в предоставлении услуг предоставляется 30-дневный льготный период. В течение этого времени:

  • Администраторы получат три обязательных уведомления о начале работы сервиса по электронной почте (обычно за 30, 17 и 4 дня до начала блокировки).
  • Вызовы API будут по-прежнему функционировать в обычном режиме.
  • Если новый API developer не будет добавлен до истечения льготного периода, вызовы API из связанных проектов Google Cloud будут заблокированы с ошибкой AUTH_GCP_NOT_REGISTERED .

По истечении 30-дневного льготного периода вызовы API из связанных проектов Google Cloud блокируются и выдают ошибку AUTH_GCP_NOT_REGISTERED до тех пор, пока не будет восстановлен действительный контакт разработчика.

Что произойдет, если идентификатор Merchant Center, для которого была произведена регистрация разработчика, будет удален?

Не удаляйте учетную запись Merchant Center, используемую для регистрации разработчиков, пока ваша интеграция активна. Удаление этой учетной записи немедленно нарушит интеграцию, и вы больше не сможете выполнять вызовы API из связанного проекта Google Cloud.

Если вам необходимо удалить учетную запись Merchant Center, сначала следует вызвать метод unregisterGcp для безопасного удаления связи, и только после этого приступать к удалению идентификатора Merchant Center. Если вы хотите продолжать использовать Merchant API, вам необходимо зарегистрироваться с другим идентификатором Merchant Center сразу после отмены регистрации текущего. Только после этого приступайте к удалению идентификатора Merchant Center.

Почему я не вижу роль « API developer » в Merchant Center?

Роль API developer отображается в пользовательском интерфейсе Merchant Center только после регистрации разработчика для соответствующей учетной записи Merchant Center. Учетные записи Merchant Center без регистрации не видят роль API developer .

Особые варианты использования

Часто задаваемые вопросы о специальных вариантах использования:

Я представляю агентство или стороннего разработчика и управляю несколькими торговыми счетами. Как лучше всего это настроить?

Сторонним разработчикам и агентствам следует поддерживать собственную основную учетную запись в Merchant Center и регистрировать все свои проекты Google Cloud в этой единой централизованной учетной записи. Не регистрируйте свой проект Google Cloud в учетной записи каждого отдельного продавца.

Как работает регистрация в Google App Scripts?

Скрипты приложений обычно запускаются в проекте Google Cloud по умолчанию. Вам необходимо зарегистрировать этот идентификатор Google Cloud по умолчанию в своей учетной записи Merchant Center. Идентификатор Google Cloud получается автоматически API, поэтому вам не нужно указывать его в качестве параметра.

Могу ли я проверить, зарегистрирован ли идентификатор Merchant Center для конкретного идентификатора проекта Google Cloud?

Да. Вы можете проверить, какой идентификатор Merchant Center зарегистрирован для конкретного проекта Google Cloud, используя метод getAccountForGcpRegistration . Чтобы удалить связь проекта Google Cloud с вашей учетной записью Merchant Center, используйте метод unregisterGcp .

Миграция Content API в Merchant API для пользователей приложений Google и YouTube на Shopify

Часто задаваемые вопросы о миграции Content API в Merchant API для сторонних платформ и приложений:

Нужно ли мне что-либо делать для миграции с Content API на Merchant API?

Никаких действий не требуется. Если вы используете приложения Google и YouTube на Shopify для управления фидами Merchant Center, миграция Content API в Merchant API будет выполнена Google.

Изменит ли миграция идентификаторы моих продуктов?

Нет, миграция не изменяет идентификаторы товаров в ваших фидах Merchant Center.

Нужно ли мне переустанавливать приложения Google и YouTube на Shopify, чтобы завершить переход?

Для завершения перехода от вас не требуется никаких действий. Вам не нужно переустанавливать приложения Google и YouTube.

Почему в Merchant Center я по-прежнему нахожу источники данных Content API?

В процессе перехода на Merchant API источники данных Content API могут по-прежнему отображаться в Merchant Center. Это ожидаемое явление, не требующее от вас никаких действий.

,

В этом разделе рассматриваются часто задаваемые вопросы, касающиеся регистрации разработчиков для использования API для продавцов.

Общая регистрация

Часто задаваемые вопросы о процессе регистрации:

Обязательна ли регистрация разработчика для использования Merchant API?

Да. Вам необходимо зарегистрировать свои контактные данные разработчика, чтобы Google мог отправлять важные обновления, касающиеся API, такие как объявления о сервисе и информация о новых функциях.

Если вы просто хотите изучить и протестировать Merchant API, вы можете использовать такие инструменты, как Google OAuth Playground и API Explorer, которые не требуют регистрации.

Как часто мне нужно регистрироваться?

Регистрация — это одноразовая процедура для каждого проекта Google Cloud. Независимо от того, работаете ли вы с несколькими торговыми учетными записями или нет, операция регистрации выполняется только один раз, и она применяется ко всем пользователям и сервисным учетным записям в рамках связанного проекта Google Cloud.

После успешной регистрации проекта Google Cloud ссылка остается активной, если ее явно не удалить, вызвав метод unregisterGcp . Вы не можете регистрировать общие проекты, принадлежащие Google, такие как API Explorer или OAuth Playground.

Какой адрес электронной почты мне следует указать в качестве контактного лица разработчика?

Мы рекомендуем использовать корпоративный адрес электронной почты отдельного пользователя. В качестве альтернативы можно использовать общие групповые псевдонимы. Использовать адреса электронной почты служебных учетных записей нельзя, поскольку сообщения предназначены для получателей-людей. Google рассылает важные обновления, касающиеся API, такие как объявления о сервисах и информация о новых функциях.

Если адрес электронной почты принадлежит существующему пользователю в учетной записи Merchant Center, ему автоматически предоставляется роль API developer . В противном случае на этот адрес отправляется приглашение.

Поле «Адрес электронной почты разработчика» в методе registerGcp является необязательным. Если при регистрации вы не указываете значение в этом поле, вам необходимо создать пользователя с ролью API developer либо в пользовательском интерфейсе Merchant Center, либо вызвав метод accounts.users.create .

Обязательно ли указывать адрес электронной почты разработчика в учетной записи Google?

Да. Чтобы использовать существующий адрес электронной почты, не принадлежащий Google, вы можете связать его с учетной записью Google, выбрав опцию «Использовать существующий адрес электронной почты» в процессе регистрации учетной записи Google . Вы не можете использовать адреса электронной почты служебных учетных записей, поскольку служебные учетные записи не могут получать электронные письма.

Как выполнить аутентификацию и авторизацию при регистрации?

В зависимости от конкретного случая, для аутентификации и авторизации при регистрации доступны два различных сценария аутентификации:

  • OAuth 2.0 : для сторонних поставщиков или агентств, управляющих несколькими торговыми счетами.
  • Сервисные аккаунты : для доступа к вашему собственному аккаунту в Merchant Center.

Alt text for accessibility

На приведенной выше диаграмме показаны два потока аутентификации и авторизации для вызова регистрации. Вы можете выбрать один из следующих вариантов:

  • Использование OAuth с адресом электронной почты, например account@email.com , связанным с учетной записью Google.
  • Используя служебный аккаунт, например, sa@project.iam.gserviceaccount.com

Если вы решите использовать OAuth :

  • Создайте учетные данные OAuth в своем проекте Google Cloud для вашей электронной почты.
  • Убедитесь, что авторизующий адрес электронной почты существует в вашем Merchant Center и имеет тип доступа ADMIN

Если вы решите использовать сервисный аккаунт :

  • Убедитесь, что учетная запись службы существует в вашем проекте Google Cloud.
  • Убедитесь, что адрес электронной почты, связанный с учетной записью службы, существует в вашем Merchant Center и имеет тип доступа ADMIN

Выполните запрос на регистрацию в контексте безопасности аутентифицирующего пользователя, используя прямые вызовы API или клиентские библиотеки. Укажите адрес электронной почты для связи с разработчиком, например, developer@email.com .

Если запрос на регистрацию пройден успешно, в вашем Merchant Center появится пользователь с указанным адресом электронной почты разработчика и ролью API developer . В ответ вы получите ресурс DeveloperRegistration .

В чём разница между адресом электронной почты для аутентификации и адресом электронной почты для связи с разработчиком?

Эти два адреса электронной почты выполняют разные функции в экосистеме Merchant API:

  • Аутентификация по электронной почте : Обычно для авторизации запросов к API продавца используется адрес электронной почты, связанный с вашей учетной записью Google или учетной записью сервиса, при условии, что:
    • Она находится в вашем Торговом центре и имеет роль ADMIN .
    • В проекте Google Cloud, где включен Merchant API, размещается клиент OAuth или учетная запись службы, связанная с адресом электронной почты, который авторизует вызовы API.
  • Адрес электронной почты разработчика : Адрес электронной почты разработчика также должен быть связан с учетной записью Google, но он служит основным контактным лицом для важных уведомлений о сервисах и обновлениях API от Google. Он может принадлежать пользователю или группе пользователей. По умолчанию ему присваивается роль API developer в Merchant Center.

Обязательно ли мне принимать приглашение, полученное по электронной почте от разработчика?

Да. У указанного вами адреса электронной почты разработчика есть 14 дней, чтобы принять приглашение. Регистрация считается завершенной только после того, как он примет приглашение. Однако в течение этого времени вы можете выполнять вызовы API.

Если приглашение не будет принято в указанный срок, ссылка-приглашение утрачивает силу. Вы больше не сможете выполнять вызовы API продавца и вам придется перезапустить процесс регистрации.

Почему моя регистрация разработчика завершается ошибкой "тестовый аккаунт"?

Регистрация разработчиков ограничена рабочими (действующими) аккаунтами для обеспечения стабильности интеграции. Если вы используете аккаунт, созданный специально для тестирования и помеченный как «тестовый аккаунт» в Merchant Center, регистрация будет отклонена.

Могу ли я зарегистрировать дополнительный аккаунт, которым буду управлять для клиента?

Мы настоятельно рекомендуем зарегистрировать учетную запись, которая отражает идентичность вашей компании. Регистрация суб-аккаунта клиента не допускается и чревата ошибками; если этот клиент покинет ваш сервис или удалит учетную запись, вся ваша интеграция API может быть отключена.

Нужно ли подтверждать регистрацию моего сайта или достаточно просто верифицировать его?

Для регистрации разработчика веб-сайт должен быть верифицирован . Это подтверждает наличие у вас административного контроля над сайтом, связанным с учетной записью. Хотя подтверждение права доступа требуется для других функций, таких как товарная реклама, верификация является основным требованием для регистрации API.

Управление проектами и клиентскими отношениями

Часто задаваемые вопросы об управлении аккаунтами и проектами:

Я работаю с несколькими аккаунтами Merchant Center. Нужно ли мне регистрировать каждый аккаунт Merchant Center, который я хочу использовать, в Merchant API?

Нет. Если вы являетесь сторонним разработчиком или агентством, управляющим несколькими учетными записями продавцов, вы регистрируете свой проект Google Cloud в своей основной учетной записи Merchant Center, а не в учетных записях каждого из ваших продавцов. Таким образом, вы представляете разработчика во всей работе с API, которую вы выполняете для ваших продавцов.

Я работаю с несколькими учетными записями Merchant Center. Как мне выбрать основную учетную запись Merchant Center?

Выбор основного аккаунта зависит от типа вашего бизнеса:

  • Торговые площадки с уже существующим расширенным аккаунтом: Если ваша компания работает как торговая площадка и уже имеет расширенный аккаунт , представляющий всю платформу, используйте этот существующий идентификатор аккаунта в качестве основного аккаунта Merchant Center.
  • Сервисы сравнения цен (CSS): Если вы являетесь сервисом сравнения цен, используйте свой уникальный идентификатор учетной записи CSS или идентификатор групповой учетной записи CSS.
  • Агентства, разработчики и другие сторонние поставщики услуг: Если вы являетесь сторонним поставщиком услуг, например, агентством или сторонним разработчиком, управляющим несколькими торговыми счетами, и у вас нет единого идентификатора Merchant Center, представляющего вашу компанию, вам следует создать новый основной аккаунт Merchant Center и запросить его преобразование в расширенный аккаунт .

После регистрации вашего проекта Google Cloud в вашей основной учетной записи Merchant Center вы сможете использовать этот же проект для управления любой другой учетной записью Merchant Center, к которой у вас есть доступ, без необходимости регистрировать эти учетные записи по отдельности.

Я использую несколько проектов Google Cloud. Нужно ли регистрировать каждый из них?

Да. Поскольку процесс регистрации связывает вызывающий проект Google Cloud, вам необходимо выполнить вызов registerGcp из каждого проекта Google Cloud, который вы используете для выполнения вызовов API.

Один проект Google Cloud может быть зарегистрирован только в одном аккаунте Merchant Center одновременно. Однако к одному аккаунту Merchant Center может быть зарегистрировано несколько проектов Google Cloud. Аналогично, вы можете использовать один и тот же адрес электронной почты разработчика для выполнения нескольких регистраций в нескольких проектах Google Cloud или нескольких аккаунтах Merchant Center.

Что произойдет, если я зарегистрирую проект Google Cloud с несколькими учетными записями Merchant Center?

Попытка зарегистрировать проект Google Cloud, который уже зарегистрирован в другом аккаунте Merchant Center, приведет к ошибке ALREADY_REGISTERED .

Как мне аутентифицировать вызов API для регистрации разработчиков?

Для аутентификации вызова API регистрации разработчиков для API продавцов используются учетные данные, управляемые через проект Google Cloud. Для аутентификации доступны два основных варианта:

  • Использование учетной записи Google, например Gmail, с OAuth 2.0 : Этот метод использует учетные данные клиента OAuth 2.0, сгенерированные в вашем проекте Google Cloud. Вызов API авторизуется от имени конкретной учетной записи Google, в которую входит пользователь.
  • Сервисный аккаунт : Этот метод использует сервисный аккаунт Google Cloud, который представляет собой особый тип аккаунта Google, предназначенный для приложений. Учетные данные для сервисного аккаунта также управляются в рамках вашего проекта Google Cloud.

Для успешной регистрации разработчика, подтверждающая личность (учетная запись Google или сервисная учетная запись), должна соответствовать следующим критериям в Merchant Center:

  • Наличие учетной записи пользователя в Merchant Center : Адрес электронной почты, связанный с аутентифицирующей учетной записью Google или учетной записью службы, должен быть добавлен в качестве пользователя в регистрируемую вами учетную запись Merchant Center.
  • Требуется роль администратора : этому пользователю должна быть назначена роль ADMIN в рамках конкретной учетной записи Merchant Center.

При выполнении вызовов API:

  • Если вы используете прямые вызовы API , вам необходимо получить и предоставить действительный токен доступа в заголовке Authorization . Этот токен генерируется в процессе аутентификации OAuth 2.0 для учетной записи Google или в процессе аутентификации между серверами для учетной записи службы.
  • Клиентские библиотеки, предоставляемые Google, обычно берут на себя сложные задачи получения и обновления токенов доступа в рамках своей конфигурации.

Пользователь, выполняющий аутентификацию, может отличаться от пользователя, контактирующего с разработчиком . Для получения дополнительной информации см. раздел «В чем разница между адресом электронной почты, используемым для аутентификации, и адресом электронной почты, контактирующим с разработчиком?».

Как часто мне нужно обновлять токены доступа?

Токены доступа как для служебных учетных записей, так и для OAuth 2.0 обычно истекают через 1 час. Однако механизм получения нового токена зависит от используемого метода аутентификации:

  • Для создания нового токена доступа при необходимости учетные записи служб используют закрытый ключ или учетные данные среды .
  • В потоках OAuth 2.0 используется refresh_token для вызова конечной точки токена Google OAuth2, чтобы получить новый токен доступа со сроком действия 1 час.

Мы настоятельно рекомендуем использовать официальные библиотеки аутентификации Google, которые автоматически выполняют эту ротацию, благодаря чему ваше приложение никогда не будет простаивать.

Пользователи и роли

Часто задаваемые вопросы о пользователях и ролях:

Обязательно ли наличие учетной записи электронной почты разработчика в Merchant Center?

Нет. Если адрес электронной почты, указанный при регистрации, еще не существует в Merchant Center, Merchant API создаст учетную запись в Merchant Center с указанным адресом электронной почты в статусе «Ожидание». Если адрес электронной почты разработчика принадлежит существующему пользователю в учетной записи Merchant Center, ему автоматически предоставляется роль API developer .

Требуется ли для отправки контактного адреса разработчика права администратора в Merchant Center?

Нет. Пользователь Merchant Center, связанный с адресом электронной почты разработчика, по умолчанию получает роль API developer , необходимую для получения важных уведомлений. Однако у него минимальные права доступа в Merchant Center. Чтобы разрешить этому пользователю выполнять другие вызовы API или управлять настройками в пользовательском интерфейсе Merchant Center, необходимо предоставить ему дополнительные роли, такие как STANDARD или ADMIN . Дополнительную информацию о ролях Merchant Center см. в разделе «Типы доступа».

Какие права доступа имеет роль " API developer "?

Роль API developer — это роль с минимальными правами в Merchant Center. Если вы планируете использовать адрес электронной почты разработчика для авторизации вызовов к Merchant API, мы рекомендуем добавить права ADMIN или STANDARD права, чтобы разрешить пользователю выполнять вызовы API.

Нужно ли регистрировать каждого пользователя-разработчика или учетную запись службы, обращающиеся к API?

Нет. Регистрация разработчика привязана к проекту Google Cloud, используемому для выполнения вызовов API, а не к отдельным пользователям или учетным записям служб. После успешной регистрации проекта Google Cloud в вашей основной учетной записи Merchant Center вы можете использовать любую учетную запись, управляемую через связанный проект Google Cloud с помощью учетных данных OAuth или учетных записей служб, для авторизации вызовов API Merchant, при условии, что они существуют в вашем Merchant Center и им назначена роль ADMIN .

Как изменить адрес электронной почты для связи с разработчиками после первоначальной регистрации?

Для управления или изменения контактов используйте стандартную службу accounts.users или страницу «Доступ и услуги» в пользовательском интерфейсе Merchant Center, чтобы добавлять или удалять пользователей с ролью API developer .

Что произойдет, если последний пользователь с именем « API developer » будет удален из учетной записи Merchant Center?

Для предотвращения немедленных перебоев в предоставлении услуг предоставляется 30-дневный льготный период. В течение этого времени:

  • Администраторы получат три обязательных уведомления о начале работы сервиса по электронной почте (обычно за 30, 17 и 4 дня до начала блокировки).
  • Вызовы API будут по-прежнему функционировать в обычном режиме.
  • Если новый API developer не будет добавлен до истечения льготного периода, вызовы API из связанных проектов Google Cloud будут заблокированы с ошибкой AUTH_GCP_NOT_REGISTERED .

When the 30-days grace period ends, API calls from the associated Google Cloud projects are blocked, and they get an AUTH_GCP_NOT_REGISTERED error until a valid developer contact is restored.

What happens if the Merchant Center ID to which developer registration is done is deleted?

Don't delete the Merchant Center account used for developer registration while your integration is active. Deleting this account immediately breaks your integration, and you will no longer be able to perform API calls from the associated Google Cloud project.

If you must delete that Merchant Center account, you should first call the unregisterGcp method to safely remove the link, and only then proceed with deleting the Merchant Center ID. If you want to keep using Merchant API, you need to register with another Merchant Center ID right after you unregister the current one. Only then proceed with deleting the Merchant Center ID.

Why can't I see the " API developer " role in Merchant Center?

The API developer role is only visible in the Merchant Center UI after the developer registration is performed for the given Merchant Center account. Merchant Center accounts without registrations don't see the API developer role.

Special Use Cases

Common questions about special use cases:

I am an agency or a third-party developer managing multiple merchant accounts. What is the best way to set this up?

Third party developers and agencies should maintain their own primary Merchant Center account and register all of their Google Cloud projects to that single, centralized account. Don't register your Google Cloud project with each individual merchant's account.

How does registration work for Google App Scripts?

App Scripts usually run on a default Google Cloud project. You must register this default Google Cloud ID with your Merchant Center account. The Google Cloud ID is obtained automatically by the API, so you don't need to provide it as a parameter.

Can I check if a Merchant Center ID is registered to a specific Google Cloud project ID?

Yes. You can check which Merchant Center ID is registered to a specific Google Cloud project by using the getAccountForGcpRegistration method. To remove a Google Cloud project link to your Merchant Center account, use the unregisterGcp method.

Content API to Merchant API migration for Google & YouTube app on Shopify users

Common questions about Content API to Merchant API migration for third-party platforms and apps:

Do I need to do anything to migrate from Content API to Merchant API?

No action needed. If you use the Google & YouTube app on Shopify to manage your Merchant Center feeds, the Content API to Merchant API migration will be handled by Google.

Will the migration change my product IDs?

No, the migration doesn't change the product IDs in your Merchant Center feeds.

Do I need to reinstall the Google & YouTube app on Shopify to complete the transition?

No action is required from you to complete the transition. You don't need to reinstall the Google & YouTube app.

Why do I still find Content API data sources in Merchant Center?

Content API data sources may still appear in Merchant Center during the transition to Merchant API. These instances are expected and require no action from you.

,

This section addresses common questions regarding Developer Registration for the Merchant API.

Общая регистрация

Common questions about the registration process:

Is developer registration mandatory in order to use Merchant API?

Yes. You must register your developer contact information so that Google can send important API-specific updates, such as service announcements and new features information.

If you just want to explore and test Merchant API, you can use tools such as Google OAuth Playground and API Explorer which don't require registration.

How often do I need to register?

Registration is a one-time setup for each Google Cloud project. Whether you are working with multiple merchant accounts or not, you perform the registration operation only once, and it applies to all users and service accounts within the linked Google Cloud project.

Once a Google Cloud project is successfully registered, the link remains active unless it is explicitly removed by calling the unregisterGcp method. You can't register shared, Google-owned projects such as the APIs Explorer or OAuth Playground.

What email address should I provide as developer contact?

We recommend using an individual's corporate email address. Alternatively you could use general group aliases. You can't use service account emails, as communications are intended for human recipients. Google sends important API-specific updates, such as service announcements and new features information.

If the email address belongs to an existing user in the Merchant Center account, they are automatically granted the API developer role. If not, an invitation is sent to that address.

The developer contact email address field is optional in the registerGcp method. If when you register you don't provide a value for this field, you must create a user that has the API developer role either in Merchant Center UI, or by calling the accounts.users.create method.

Does the developer contact email need to be a Google Account?

Yes. To use an existing non-Google email, you can associate it with a Google Account by choosing the Use your existing email option in Create a Google Account signup process. You can't use service account emails as service accounts can't receive emails.

How do I perform authentication and authorization for the registration call?

Two distinct authentication scenarios are available for the authentication and authorization of the registration call, depending on your use case:

  • OAuth 2.0 : for third-party providers or agencies managing multiple merchant accounts
  • Service Accounts : for access to your own Merchant Center account

Alt text for accessibility

The preceding diagram shows the two authentication and authorization flows for the registration call. You can choose between:

  • Using OAuth with an email address such as account@email.com associated with a Google Account
  • Using a service account such as sa@project.iam.gserviceaccount.com

If you decide to go with OAuth :

  • Create OAuth credentials in your Google Cloud project for your email
  • Make sure that the authorizing email address exists in your Merchant Center and that it has the ADMIN access type

If you decide to go with a service account :

  • Make sure that the service account exists in your Google Cloud project
  • Make sure that the email address associated with the service account exists in your Merchant Center and that it has the ADMIN access type

Perform the registration call under the authenticating identity's security context, using direct API calls or client libraries. Provide an email address for the developer contact, for example developer@email.com .

If the registration call is successful, a user exists in your Merchant Center with the provided developer email address and the API developer role. You get as a response a DeveloperRegistration resource.

What is the difference between the authenticating email and the one developer contact email?

The two email addresses serve distinct purposes within the Merchant API ecosystem:

  • Authenticating email : You typically use an email associated with your Google account or with a service account as an identity to authorize requests to Merchant API provided that:
    • It exists in your Merchant Center, and has the ADMIN role.
    • A Google Cloud Project that has Merchant API enabled hosts the OAuth client or the service account associated with the email that authorizes the API calls.
  • Developer contact email : The developer contact email must also be associated with a Google Account, but it serves as the primary contact for critical service announcements and API updates from Google. It can belong to a user or to a group of users. By default, it gets the API developer role in Merchant Center.

Must I accept the invitation received by the developer contact email?

Yes. The developer contact email recipient you provide has 14 days to accept the invitation. Registration is complete only after they have accepted the invitation. You can however, perform API calls during this time.

If the invitation is not accepted in the specified time, the invitation link expires. You can't perform Merchant API calls anymore and you have to restart the registration process.

Why is my developer registration failing with a "test account" error?

Developer registration is restricted to production (live) accounts to ensure integration stability. If you are using an account created specifically for testing that is marked as a "test account" in Merchant Center, the registration will be rejected.

Can I register a sub-account that I manage for a client?

We strongly recommend registering the account that represents your business identity. Registering a client's sub-account is not allowed and is error-prone; if that client leaves your service or deletes the account, your entire API integration might be disabled.

Does my website need to be claimed or just verified?

For developer registration, the website must be verified . This proves you have administrative control over the site associated with the account. While claiming is required for other features like Shopping ads, verification is the primary requirement for API registration.

Account and Project Management

Common questions about the account and project management:

I work with multiple Merchant Center accounts. Do I need to register every Merchant Center Account I want to use with the Merchant API?

No. If you are a third party developer or an agency that manages multiple merchants' accounts, you register your Google Cloud project with your own primary Merchant Center account, not with each of your merchants' accounts. In this way you represent the developer for all the API work you do for your merchants.

I work with multiple Merchant Center accounts. How do I choose my primary Merchant Center Account?

Choosing the primary account to use depends on your business type:

  • Marketplaces with an existing advanced account: If your business operates as a marketplace and already has an advanced account representing the entire platform, use this existing account ID as the primary Merchant Center Account.
  • Comparison Shopping Services (CSS): If you are a CSS, use your unique CSS account ID or CSS group account ID.
  • Agencies, Developers, and other 3Ps: If you are a 3P business such as an agency or third-party developer that manages multiple merchant accounts and lack a single Merchant Center ID representing your business, you should create a new, primary Merchant Center Account and request converting it to an advanced account .

Once your Google Cloud project is registered to your primary Merchant Center account, you can use that same project to manage any other Merchant Center account you have access to, without needing to register those accounts individually.

I use multiple Google Cloud projects. Do I need to register each one?

Yes. Since the registration process links the calling Google Cloud project, you must perform the registerGcp call from each Google Cloud project you use to make API calls.

A single Google Cloud project can only be registered to exactly one Merchant Center account at a time. However, a single Merchant Center account can have multiple Google Cloud projects registered to it. Similarly, you can use the same developer email address to perform multiple registrations, across multiple Google Cloud projects or multiple Merchant Centers.

What happens if I register a Google Cloud project with multiple Merchant Center accounts?

Attempting to register a Google Cloud project that is already registered with another Merchant Center account will result in an ALREADY_REGISTERED error.

How do I authenticate the developer registration API call?

To authenticate the developer registration API call for the Merchant API, you use credentials managed through a Google Cloud Project. You have two primary options for the identity that performs the authentication:

  • Google Account such as Gmail using OAuth 2.0 : This method uses OAuth 2.0 client credentials generated within your Google Cloud Project. The API call is authorized on behalf of a specific Google Account that the user signs into.
  • Service Account : This method uses a Google Cloud Service Account, which is a special type of Google Account intended for applications. Credentials for the Service Account are also managed within your Google Cloud project.

For a successful developer registration, the authenticating identity (Google Account or Service Account) must meet the following criteria within Merchant Center:

  • Exists as a User in Merchant Center : The email address associated with the authenticating Google Account or the Service Account must be added as a user in the Merchant Center account you are registering.
  • Admin Role Required : This user must have the ADMIN role assigned to them within that specific Merchant Center account.

When making the API calls:

  • If you are using Direct API calls , you must obtain and provide a valid Access Token in the Authorization header. This token is generated by the OAuth 2.0 flow for a Google Account or the server-to-server authentication flow for a Service Account.
  • Client libraries provided by Google typically handle the complexities of obtaining and refreshing Access Tokens for you as part of their configuration.

The authenticating user might not be the same as the developer contact user . For more information, see What is the difference between the authenticating email and the one developer contact email?

How often do I need to refresh access tokens?

Access tokens for both Service Accounts and OAuth 2.0 typically expire after 1 hour. However, the mechanism for getting a new one depends on which authentication method you are using:

  • Service accounts use a private key or environment credentials to create a new access token whenever needed.
  • OAuth 2.0 flows use a refresh_token to call the Google OAuth2 token endpoint to receive a new 1-hour access token.

We strongly recommend using the official Google Auth Libraries which handle this rotation automatically so your application never experiences downtime.

Пользователи и роли

Common questions about users and roles:

Must the developer email account exist already in Merchant Center?

No. If the registration email account does not exist already in Merchant Center, Merchant API creates the account in Merchant Center with the specified email in Pending status. If the developer email address belongs to an existing user in the Merchant Center account, they are automatically granted the API developer role.

Does the developer contact email need to have Admin rights in Merchant Center?

No. The Merchant Center user associated with the developer contact email gets by default the API developer role that is required to receive important notifications. However, it has minimal permissions within the Merchant Center. To allow this user to make other API calls or manage settings in the Merchant Center UI, you need to grant them additional roles, such as STANDARD or ADMIN . For more information about the Merchant Center roles, see Access types.

What permissions does the " API developer " role have?

The API developer role is a role with minimal rights in the Merchant Center. If you plan on using the developer contact email to authorize calls to Merchant API, we recommend adding ADMIN or STANDARD permissions to enable the user to perform API calls.

Do I need to register each developer user or service account calling the API?

No. Developer registration is tied to the Google Cloud project being used to make the API calls, not to individual users or service accounts. Once a Google Cloud project is successfully registered with your primary Merchant Center account, you can use any identity that is managed through the linked Google Cloud project using OAuth credentials or service accounts to authorize Merchant API calls, provided that they exist in your Merchant Center and they have the ADMIN role assigned.

How do I change the developer contact email after the initial registration?

To manage or change contacts, use the standard accounts.users service or the "Access and services" page in the Merchant Center UI to add or remove users with the API developer role.

What happens if the last " API developer " user is removed from the Merchant Center account?

A 30-day grace period is triggered to avoid immediate service disruption. During this time:

  • Admins will receive three mandatory service announcements by email (usually around 30, 17, and 4 days before the block).
  • API calls will continue to function normally.
  • If a new API developer is not added before the grace period expires, API calls from the associated Google Cloud projects will be blocked with an AUTH_GCP_NOT_REGISTERED error.

When the 30-days grace period ends, API calls from the associated Google Cloud projects are blocked, and they get an AUTH_GCP_NOT_REGISTERED error until a valid developer contact is restored.

What happens if the Merchant Center ID to which developer registration is done is deleted?

Don't delete the Merchant Center account used for developer registration while your integration is active. Deleting this account immediately breaks your integration, and you will no longer be able to perform API calls from the associated Google Cloud project.

If you must delete that Merchant Center account, you should first call the unregisterGcp method to safely remove the link, and only then proceed with deleting the Merchant Center ID. If you want to keep using Merchant API, you need to register with another Merchant Center ID right after you unregister the current one. Only then proceed with deleting the Merchant Center ID.

Why can't I see the " API developer " role in Merchant Center?

The API developer role is only visible in the Merchant Center UI after the developer registration is performed for the given Merchant Center account. Merchant Center accounts without registrations don't see the API developer role.

Special Use Cases

Common questions about special use cases:

I am an agency or a third-party developer managing multiple merchant accounts. What is the best way to set this up?

Third party developers and agencies should maintain their own primary Merchant Center account and register all of their Google Cloud projects to that single, centralized account. Don't register your Google Cloud project with each individual merchant's account.

How does registration work for Google App Scripts?

App Scripts usually run on a default Google Cloud project. You must register this default Google Cloud ID with your Merchant Center account. The Google Cloud ID is obtained automatically by the API, so you don't need to provide it as a parameter.

Can I check if a Merchant Center ID is registered to a specific Google Cloud project ID?

Yes. You can check which Merchant Center ID is registered to a specific Google Cloud project by using the getAccountForGcpRegistration method. To remove a Google Cloud project link to your Merchant Center account, use the unregisterGcp method.

Content API to Merchant API migration for Google & YouTube app on Shopify users

Common questions about Content API to Merchant API migration for third-party platforms and apps:

Do I need to do anything to migrate from Content API to Merchant API?

No action needed. If you use the Google & YouTube app on Shopify to manage your Merchant Center feeds, the Content API to Merchant API migration will be handled by Google.

Will the migration change my product IDs?

No, the migration doesn't change the product IDs in your Merchant Center feeds.

Do I need to reinstall the Google & YouTube app on Shopify to complete the transition?

No action is required from you to complete the transition. You don't need to reinstall the Google & YouTube app.

Why do I still find Content API data sources in Merchant Center?

Content API data sources may still appear in Merchant Center during the transition to Merchant API. These instances are expected and require no action from you.

,

This section addresses common questions regarding Developer Registration for the Merchant API.

Общая регистрация

Common questions about the registration process:

Is developer registration mandatory in order to use Merchant API?

Yes. You must register your developer contact information so that Google can send important API-specific updates, such as service announcements and new features information.

If you just want to explore and test Merchant API, you can use tools such as Google OAuth Playground and API Explorer which don't require registration.

How often do I need to register?

Registration is a one-time setup for each Google Cloud project. Whether you are working with multiple merchant accounts or not, you perform the registration operation only once, and it applies to all users and service accounts within the linked Google Cloud project.

Once a Google Cloud project is successfully registered, the link remains active unless it is explicitly removed by calling the unregisterGcp method. You can't register shared, Google-owned projects such as the APIs Explorer or OAuth Playground.

What email address should I provide as developer contact?

We recommend using an individual's corporate email address. Alternatively you could use general group aliases. You can't use service account emails, as communications are intended for human recipients. Google sends important API-specific updates, such as service announcements and new features information.

If the email address belongs to an existing user in the Merchant Center account, they are automatically granted the API developer role. If not, an invitation is sent to that address.

The developer contact email address field is optional in the registerGcp method. If when you register you don't provide a value for this field, you must create a user that has the API developer role either in Merchant Center UI, or by calling the accounts.users.create method.

Does the developer contact email need to be a Google Account?

Yes. To use an existing non-Google email, you can associate it with a Google Account by choosing the Use your existing email option in Create a Google Account signup process. You can't use service account emails as service accounts can't receive emails.

How do I perform authentication and authorization for the registration call?

Two distinct authentication scenarios are available for the authentication and authorization of the registration call, depending on your use case:

  • OAuth 2.0 : for third-party providers or agencies managing multiple merchant accounts
  • Service Accounts : for access to your own Merchant Center account

Alt text for accessibility

The preceding diagram shows the two authentication and authorization flows for the registration call. You can choose between:

  • Using OAuth with an email address such as account@email.com associated with a Google Account
  • Using a service account such as sa@project.iam.gserviceaccount.com

If you decide to go with OAuth :

  • Create OAuth credentials in your Google Cloud project for your email
  • Make sure that the authorizing email address exists in your Merchant Center and that it has the ADMIN access type

If you decide to go with a service account :

  • Make sure that the service account exists in your Google Cloud project
  • Make sure that the email address associated with the service account exists in your Merchant Center and that it has the ADMIN access type

Perform the registration call under the authenticating identity's security context, using direct API calls or client libraries. Provide an email address for the developer contact, for example developer@email.com .

If the registration call is successful, a user exists in your Merchant Center with the provided developer email address and the API developer role. You get as a response a DeveloperRegistration resource.

What is the difference between the authenticating email and the one developer contact email?

The two email addresses serve distinct purposes within the Merchant API ecosystem:

  • Authenticating email : You typically use an email associated with your Google account or with a service account as an identity to authorize requests to Merchant API provided that:
    • It exists in your Merchant Center, and has the ADMIN role.
    • A Google Cloud Project that has Merchant API enabled hosts the OAuth client or the service account associated with the email that authorizes the API calls.
  • Developer contact email : The developer contact email must also be associated with a Google Account, but it serves as the primary contact for critical service announcements and API updates from Google. It can belong to a user or to a group of users. By default, it gets the API developer role in Merchant Center.

Must I accept the invitation received by the developer contact email?

Yes. The developer contact email recipient you provide has 14 days to accept the invitation. Registration is complete only after they have accepted the invitation. You can however, perform API calls during this time.

If the invitation is not accepted in the specified time, the invitation link expires. You can't perform Merchant API calls anymore and you have to restart the registration process.

Why is my developer registration failing with a "test account" error?

Developer registration is restricted to production (live) accounts to ensure integration stability. If you are using an account created specifically for testing that is marked as a "test account" in Merchant Center, the registration will be rejected.

Can I register a sub-account that I manage for a client?

We strongly recommend registering the account that represents your business identity. Registering a client's sub-account is not allowed and is error-prone; if that client leaves your service or deletes the account, your entire API integration might be disabled.

Does my website need to be claimed or just verified?

For developer registration, the website must be verified . This proves you have administrative control over the site associated with the account. While claiming is required for other features like Shopping ads, verification is the primary requirement for API registration.

Account and Project Management

Common questions about the account and project management:

I work with multiple Merchant Center accounts. Do I need to register every Merchant Center Account I want to use with the Merchant API?

No. If you are a third party developer or an agency that manages multiple merchants' accounts, you register your Google Cloud project with your own primary Merchant Center account, not with each of your merchants' accounts. In this way you represent the developer for all the API work you do for your merchants.

I work with multiple Merchant Center accounts. How do I choose my primary Merchant Center Account?

Choosing the primary account to use depends on your business type:

  • Marketplaces with an existing advanced account: If your business operates as a marketplace and already has an advanced account representing the entire platform, use this existing account ID as the primary Merchant Center Account.
  • Comparison Shopping Services (CSS): If you are a CSS, use your unique CSS account ID or CSS group account ID.
  • Agencies, Developers, and other 3Ps: If you are a 3P business such as an agency or third-party developer that manages multiple merchant accounts and lack a single Merchant Center ID representing your business, you should create a new, primary Merchant Center Account and request converting it to an advanced account .

Once your Google Cloud project is registered to your primary Merchant Center account, you can use that same project to manage any other Merchant Center account you have access to, without needing to register those accounts individually.

I use multiple Google Cloud projects. Do I need to register each one?

Yes. Since the registration process links the calling Google Cloud project, you must perform the registerGcp call from each Google Cloud project you use to make API calls.

A single Google Cloud project can only be registered to exactly one Merchant Center account at a time. However, a single Merchant Center account can have multiple Google Cloud projects registered to it. Similarly, you can use the same developer email address to perform multiple registrations, across multiple Google Cloud projects or multiple Merchant Centers.

What happens if I register a Google Cloud project with multiple Merchant Center accounts?

Attempting to register a Google Cloud project that is already registered with another Merchant Center account will result in an ALREADY_REGISTERED error.

How do I authenticate the developer registration API call?

To authenticate the developer registration API call for the Merchant API, you use credentials managed through a Google Cloud Project. You have two primary options for the identity that performs the authentication:

  • Google Account such as Gmail using OAuth 2.0 : This method uses OAuth 2.0 client credentials generated within your Google Cloud Project. The API call is authorized on behalf of a specific Google Account that the user signs into.
  • Service Account : This method uses a Google Cloud Service Account, which is a special type of Google Account intended for applications. Credentials for the Service Account are also managed within your Google Cloud project.

For a successful developer registration, the authenticating identity (Google Account or Service Account) must meet the following criteria within Merchant Center:

  • Exists as a User in Merchant Center : The email address associated with the authenticating Google Account or the Service Account must be added as a user in the Merchant Center account you are registering.
  • Admin Role Required : This user must have the ADMIN role assigned to them within that specific Merchant Center account.

When making the API calls:

  • If you are using Direct API calls , you must obtain and provide a valid Access Token in the Authorization header. This token is generated by the OAuth 2.0 flow for a Google Account or the server-to-server authentication flow for a Service Account.
  • Client libraries provided by Google typically handle the complexities of obtaining and refreshing Access Tokens for you as part of their configuration.

The authenticating user might not be the same as the developer contact user . For more information, see What is the difference between the authenticating email and the one developer contact email?

How often do I need to refresh access tokens?

Access tokens for both Service Accounts and OAuth 2.0 typically expire after 1 hour. However, the mechanism for getting a new one depends on which authentication method you are using:

  • Service accounts use a private key or environment credentials to create a new access token whenever needed.
  • OAuth 2.0 flows use a refresh_token to call the Google OAuth2 token endpoint to receive a new 1-hour access token.

We strongly recommend using the official Google Auth Libraries which handle this rotation automatically so your application never experiences downtime.

Пользователи и роли

Common questions about users and roles:

Must the developer email account exist already in Merchant Center?

No. If the registration email account does not exist already in Merchant Center, Merchant API creates the account in Merchant Center with the specified email in Pending status. If the developer email address belongs to an existing user in the Merchant Center account, they are automatically granted the API developer role.

Does the developer contact email need to have Admin rights in Merchant Center?

No. The Merchant Center user associated with the developer contact email gets by default the API developer role that is required to receive important notifications. However, it has minimal permissions within the Merchant Center. To allow this user to make other API calls or manage settings in the Merchant Center UI, you need to grant them additional roles, such as STANDARD or ADMIN . For more information about the Merchant Center roles, see Access types.

What permissions does the " API developer " role have?

The API developer role is a role with minimal rights in the Merchant Center. If you plan on using the developer contact email to authorize calls to Merchant API, we recommend adding ADMIN or STANDARD permissions to enable the user to perform API calls.

Do I need to register each developer user or service account calling the API?

No. Developer registration is tied to the Google Cloud project being used to make the API calls, not to individual users or service accounts. Once a Google Cloud project is successfully registered with your primary Merchant Center account, you can use any identity that is managed through the linked Google Cloud project using OAuth credentials or service accounts to authorize Merchant API calls, provided that they exist in your Merchant Center and they have the ADMIN role assigned.

How do I change the developer contact email after the initial registration?

To manage or change contacts, use the standard accounts.users service or the "Access and services" page in the Merchant Center UI to add or remove users with the API developer role.

What happens if the last " API developer " user is removed from the Merchant Center account?

A 30-day grace period is triggered to avoid immediate service disruption. During this time:

  • Admins will receive three mandatory service announcements by email (usually around 30, 17, and 4 days before the block).
  • API calls will continue to function normally.
  • If a new API developer is not added before the grace period expires, API calls from the associated Google Cloud projects will be blocked with an AUTH_GCP_NOT_REGISTERED error.

When the 30-days grace period ends, API calls from the associated Google Cloud projects are blocked, and they get an AUTH_GCP_NOT_REGISTERED error until a valid developer contact is restored.

What happens if the Merchant Center ID to which developer registration is done is deleted?

Don't delete the Merchant Center account used for developer registration while your integration is active. Deleting this account immediately breaks your integration, and you will no longer be able to perform API calls from the associated Google Cloud project.

If you must delete that Merchant Center account, you should first call the unregisterGcp method to safely remove the link, and only then proceed with deleting the Merchant Center ID. If you want to keep using Merchant API, you need to register with another Merchant Center ID right after you unregister the current one. Only then proceed with deleting the Merchant Center ID.

Why can't I see the " API developer " role in Merchant Center?

The API developer role is only visible in the Merchant Center UI after the developer registration is performed for the given Merchant Center account. Merchant Center accounts without registrations don't see the API developer role.

Special Use Cases

Common questions about special use cases:

I am an agency or a third-party developer managing multiple merchant accounts. What is the best way to set this up?

Third party developers and agencies should maintain their own primary Merchant Center account and register all of their Google Cloud projects to that single, centralized account. Don't register your Google Cloud project with each individual merchant's account.

How does registration work for Google App Scripts?

App Scripts usually run on a default Google Cloud project. You must register this default Google Cloud ID with your Merchant Center account. The Google Cloud ID is obtained automatically by the API, so you don't need to provide it as a parameter.

Can I check if a Merchant Center ID is registered to a specific Google Cloud project ID?

Yes. You can check which Merchant Center ID is registered to a specific Google Cloud project by using the getAccountForGcpRegistration method. To remove a Google Cloud project link to your Merchant Center account, use the unregisterGcp method.

Content API to Merchant API migration for Google & YouTube app on Shopify users

Common questions about Content API to Merchant API migration for third-party platforms and apps:

Do I need to do anything to migrate from Content API to Merchant API?

No action needed. If you use the Google & YouTube app on Shopify to manage your Merchant Center feeds, the Content API to Merchant API migration will be handled by Google.

Will the migration change my product IDs?

No, the migration doesn't change the product IDs in your Merchant Center feeds.

Do I need to reinstall the Google & YouTube app on Shopify to complete the transition?

No action is required from you to complete the transition. You don't need to reinstall the Google & YouTube app.

Why do I still find Content API data sources in Merchant Center?

Content API data sources may still appear in Merchant Center during the transition to Merchant API. These instances are expected and require no action from you.