Accounts API를 사용하여 판매자 센터 계정과 다른 서비스 제공업체 간의 관계를 관리할 수 있습니다. 관계는 제공업체가 비즈니스에 특정 서비스를 제공할 수 있도록 하는 공식적인 연결입니다. 서비스는 제품 관리 또는 캠페인 관리와 같이 제공업체에 부여된 권한과 기능을 정의합니다. 예를 들어 판매자 센터 계정을 Google Ads 계정에 연결하면 Ads 계정에서 제품 데이터를 사용하여 광고 캠페인을 실행할 수 있습니다.
관계는 다음 속성으로 구성됩니다.
- 서비스를 받는 판매자 센터 계정
- 서비스 제공업체
- 판매자 센터 계정에 제공되는 서비스 또는 서비스 집합
별칭
서비스 제공업체는 별칭을 서비스하는 계정과 연결할 수 있습니다 (이는 Content API for Shopping의 계정 리소스에 있던 seller_id 필드와 동일함). 별칭은 AccountRelationship 리소스 내의 선택적 account_id_alias 필드를 사용하여 할당할 수 있으며 커스텀 식별자 역할을 합니다. 별칭은 ASCII 문자, 십진수, 하이픈, 밑줄, 마침표, 물결표 ([A-Za-z0-9_~.-]{1,50}) 중에서 선택한 1~50자로 구성되어야 합니다.
별칭을 사용하여 계정에 액세스하기 위한 URL 구조는 GET /accounts/v1/accounts/{provider}~{account_id_alias}입니다.
서비스
Accounts API에서 계정은 다음 서비스를 받을 수 있습니다. 계정 생성 중에 이러한 서비스를 많이 추가할 수 있습니다.
계정 집계: 이 서비스 (
accountAggregation)는 멀티 클라이언트 고급 계정을 하위 계정에 연결하여 고급 계정에 제한 없는 전체 액세스 권한을 부여하고 판매자 센터 UI에 하위 계정을 표시합니다. 판매자 센터 UI는 새 하위 계정을 만들 때 온라인 상점 제작 도구 (이커머스 플랫폼), 채널 파트너, 마켓, 멀티 브랜드 소매업체, 해외 소매업체의 계정을accountAggregation를 사용하는 고급 계정으로 자동 전환합니다. 대행사인 경우accountManagement을 대신 사용하세요. 계정 집계를 사용하여 계정을 만들 때는externalAccountId를 생략해야 합니다.캠페인 관리: 이 서비스는 판매자 센터 계정과 Google Ads 계정 간의 연결을 모델링하여 광고 계정에 광고 캠페인을 실행하는 데 필요한 제품 및 계정 데이터에 대한 액세스 권한을 부여합니다. 이 경우 서비스 제공업체는
GOOGLE_ADS이고externalAccountId는 Google Ads 계정의 ID입니다. 이 서비스는 기존 계정에도 제안할 수 있습니다.
- 이 서비스를 사용하면 커머스 미디어 네트워크 캠페인을 실행할 때 파트너별 특정 제품 필터를 만들 수 있습니다.
- 현재는 Accounts 하위 API의 알파 버전을 사용해야 합니다.
- 이 기능을 사용하려면 특정 GMC 허용 목록이 필요합니다.
자세한 내용은 Google Ads 계정 관리팀에 문의하세요.
비교 쇼핑: 판매자 센터 계정을 운영하는 비교 쇼핑 서비스 (CSS)와의 관계를 나타냅니다.
오프라인 비즈니스 정보 관리: Google 비즈니스 프로필을 사용하여 오프라인 판매점 인벤토리 및 비즈니스 정보를 관리하는 매장 관리자와의 관계를 나타냅니다.
계정 관리: 이 서비스 (
accountManagement)를 사용하면 제공업체가 계정 설정 구성, 사용자 관리, 비즈니스 정보 업데이트와 같은 독립형 외부 판매자 센터 계정에 대한 관리 작업을 수행할 수 있습니다. 비즈니스는 부여된 액세스 권한을 제한할 수도 있습니다. 계정 생성 중에 사용되는 경우 이 서비스는 제공업체에 연결된 단독 계정을 만듭니다. 기존 계정에 제안할 수도 있습니다. 이 서비스 유형을 사용하는 대행사는 대행사용 판매자 센터에서 관리하는 계정을 확인할 수 있습니다. 스토어 빌더와 채널 파트너는 Merchant API를 사용하여accountManagement를 통해 관리하는 판매자에 관한 정보를 가져올 수 있습니다.제품 관리: 이 서비스를 통해 제공업체는 제품 및 관련 기능(예: 데이터 소스, 규칙)을 관리할 수 있습니다. 계정 생성 중에 추가되는 경우 일반적으로
accountManagement또는accountAggregation와 함께 추가됩니다. 이 서비스는 기존 계정에도 제안할 수 있습니다.UCP 결제 관리 (
v1alpha, 제한된 액세스):ucpCheckoutManagement서비스를 사용하면 승인된 서비스 제공업체가 판매자를 대신하여 UCP 결제 통합, 설정, 프로그램 참여를 관리할 수 있습니다. 이 서비스는 기존 판매자 센터 계정에만 제안하거나 승인할 수 있습니다.참고: UCP 결제는 액세스가 제한된 알파 기능입니다. 서비스 제공업체를 위한 판매자 센터에서 서비스 제공업체 및 UCP 결제에 대해 자세히 알아보세요.
악수
서비스를 설정하려면 서비스를 제공하는 계정과 서비스를 받는 계정 모두 연결을 승인해야 합니다. 이 승인 프로세스를 핸드셰이크라고 합니다.
핸드셰이크는 2단계 프로세스입니다.
- 한 당사자가 서비스 링크를 제안합니다.
- 상대방이 제안서를 승인하거나 거부합니다.
제안서가 수락되면 서비스가 승인되고 완전히 설정된 것으로 간주됩니다. 서비스 제공업체에 부여된 모든 액세스 권한이 이제 자격 요건을 충족하는 사용자에게 부여됩니다 (아래 액세스 권한 참고).
제안서를 만들거나 거부하거나 승인하는 사용자에게는 프로세스를 시작하는 계정에 대한 ADMIN 액세스 권한이 있어야 합니다. 따라서 서비스 제공업체가 서비스를 제안하는 경우 제안하는 사용자는 서비스 제공업체 계정의 ADMIN여야 하고 제안을 수락하거나 거부하는 사용자는 수신 계정의 ADMIN여야 합니다.
다음 샘플은 계정 서비스를 제안하는 방법을 보여줍니다.
자바
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.accounts.v1.AccountName;
import com.google.shopping.merchant.accounts.v1.AccountService;
import com.google.shopping.merchant.accounts.v1.AccountServicesServiceClient;
import com.google.shopping.merchant.accounts.v1.AccountServicesServiceSettings;
import com.google.shopping.merchant.accounts.v1.ProductsManagement;
import com.google.shopping.merchant.accounts.v1.ProposeAccountServiceRequest;
import shopping.merchant.samples.utils.Authenticator;
/** This class demonstrates how to propose a service to an existing Merchant Center account. */
public class ProposeServiceSample {
public static void proposeService(long accountId, long providerId, String externalAccountId)
throws Exception {
// Obtains OAuth token based on the user's configuration.
// The user that authenticates should have access to the account.
GoogleCredentials credential = new Authenticator().authenticate();
// Creates service settings using the credentials retrieved above.
AccountServicesServiceSettings accountServicesServiceSettings =
AccountServicesServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
// Calls the API and catches and prints any network failures/errors.
try (AccountServicesServiceClient accountServicesServiceClient =
AccountServicesServiceClient.create(accountServicesServiceSettings)) {
// The service to be proposed.
// This sample shows how to propose product management.
// For more information about the different services, see:
// https://developers.google.com/merchant/api/guides/accounts/services
AccountService accountService =
AccountService.newBuilder()
.setProductsManagement(ProductsManagement.newBuilder().build())
.setExternalAccountId(externalAccountId)
.build();
String accountName =
AccountName.newBuilder().setAccount(String.valueOf(accountId)).build().toString();
ProposeAccountServiceRequest request =
ProposeAccountServiceRequest.newBuilder()
.setParent(accountName)
.setProvider("accounts/" + providerId)
.setAccountService(accountService)
.build();
System.out.println("Sending Propose Service request:");
AccountService response = accountServicesServiceClient.proposeAccountService(request);
System.out.println("Proposed Service below");
System.out.println(response);
} catch (Exception e) {
System.out.println(e);
}
}
public static void main(String[] args) throws Exception {
// The ID of the account to propose the service to.
long accountId = 123L;
// This is the provider ID of the e-commerce platform.
long providerId = 456L;
// An external ID that uniquely identifies the account service.
String externalAccountId = "ext-acc-id-123";
proposeService(accountId, providerId, externalAccountId);
}
}
PHP
require_once __DIR__ . '/../../../../vendor/autoload.php';
require_once __DIR__ . '/../../../Authentication/Authentication.php';
require_once __DIR__ . '/../../../Authentication/Config.php';
use Google\ApiCore\ApiException;
use Google\Shopping\Merchant\Accounts\V1\AccountAggregation;
use Google\Shopping\Merchant\Accounts\V1\AccountService;
use Google\Shopping\Merchant\Accounts\V1\Client\AccountServicesServiceClient;
use Google\Shopping\Merchant\Accounts\V1\ProposeAccountServiceRequest;
/**
* This class demonstrates how to propose an account service.
*/
class ProposeAccountServiceSample
{
/**
* A helper function to create the account name string.
*
* @param string $accountId The ID of the account.
*
* @return string The account name has the format: `accounts/{account_id}`
*/
private static function toAccountName(string $accountId): string
{
return sprintf('accounts/%s', $accountId);
}
/**
* Proposes a new account service.
*
* @param array $config The configuration data used for authentication and
* getting the account ID.
* @param string $providerId The ID of the provider account.
*/
public static function proposeAccountService(
array $config,
string $providerId
): void {
// Gets the OAuth credentials to make the request.
$credentials = Authentication::useServiceAccountOrTokenFile();
// Creates options containing credentials for the client to use.
$options = ['credentials' => $credentials];
// Creates a client.
$accountServicesServiceClient = new AccountServicesServiceClient($options);
// Calls the API and catches and prints any network failures/errors.
try {
$accountAggregation = new AccountAggregation();
$accountService = (new AccountService())
->setAccountAggregation($accountAggregation);
$request = (new ProposeAccountServiceRequest())
->setParent(self::toAccountName($config['accountId']))
->setProvider(self::toAccountName($providerId))
->setAccountService($accountService);
print "Sending Propose AccountService request\n";
$response = $accountServicesServiceClient->proposeAccountService($request);
print "Proposed AccountService below\n";
print $response->serializeToJsonString(true) . PHP_EOL;
} catch (ApiException $e) {
printf("An error has occurred: %s%s", $e->getMessage(), PHP_EOL);
}
}
/**
* Helper to execute the sample.
*/
public function callSample(): void
{
$config = Config::generateConfig();
// Update this with the Merchant Center provider ID you want to get the
// relationship for.
$providerId = 111;
self::proposeAccountService($config, $providerId);
}
}
// Run the script
$sample = new ProposeAccountServiceSample();
$sample->callSample();
Python
"""This class demonstrates how to propose an account service."""
from examples.authentication import configuration
from examples.authentication import generate_user_credentials
from google.shopping.merchant_accounts_v1 import AccountAggregation
from google.shopping.merchant_accounts_v1 import AccountService
from google.shopping.merchant_accounts_v1 import AccountServicesServiceClient
from google.shopping.merchant_accounts_v1 import ProposeAccountServiceRequest
_ACCOUNT = configuration.Configuration().read_merchant_info()
_PARENT = f"accounts/{_ACCOUNT}"
def propose_account_service(provider_id: int) -> None:
"""Proposes an account service.
Args:
provider_id: The Merchant Center ID of the provider.
"""
# Gets OAuth Credentials.
credentials = generate_user_credentials.main()
# Creates a client.
client = AccountServicesServiceClient(credentials=credentials)
# Creates the provider resource name from the provider ID.
provider = f"accounts/{provider_id}"
# Creates an AccountService object.
# For this request, only `account_aggregation` is needed.
account_service = AccountService()
account_service.account_aggregation = AccountAggregation()
# Creates the request.
request = ProposeAccountServiceRequest(
parent=_PARENT,
provider=provider,
account_service=account_service,
)
# Makes the request and catches and prints any error messages.
try:
print("Sending Propose AccountService request")
response = client.propose_account_service(request=request)
print("Proposed AccountService below")
print(response)
except RuntimeError as e:
print(e)
if __name__ == "__main__":
# Update this with the Merchant Center provider ID you want to get the
# relationship for.
provider_id_ = 111
propose_account_service(provider_id_)
서비스별 핸드셰이크 동작
다음은 각 개별 서비스의 특정 핸드셰이크 요구사항에 대한 설명입니다.
계정 집계: 이 서비스는 계정 생성의 일부로만 설정할 수 있습니다. 서비스 제공업체는 고급 계정이어야 하며, 고급 계정 사용자는 생성되는 계정에 대한 전체
ADMIN액세스 권한을 가지므로 서비스가 자동으로 승인됩니다.비교 쇼핑: 이 서비스는
createAndConfigure를 사용하여 계정을 만드는 동안 추가되면 자동으로 승인됩니다.캠페인 관리: 일반적인 핸드셰이크 프로세스를 따르지만 제안은 한 시스템 (예: Google Ads)에서 이루어지고 승인은 다른 시스템 (예: 판매자 센터 또는 Merchant API)에서 이루어집니다.
지역 비즈니스 정보 관리: 이 서비스의 경우 핸드셰이크는 전용 메서드로 제안되고 승인은 다른 시스템 (예: Google 비즈니스 프로필)에서 수행됩니다. 자세한 단계는 Google 비즈니스 프로필 연결 가이드를 참고하세요.
계정 관리: 이 서비스의 경우
propose를 사용할 때 일반적인 핸드셰이크 프로세스가 적용됩니다.createAndConfigure를 사용하여 계정을 만드는 동안 서비스가 추가되면 자동으로 승인됩니다.제품 관리: 이 서비스에는 일반적인 핸드셰이크 프로세스가 적용됩니다 (한 당사자가 제안한 후 다른 당사자가 수락).
UCP 결제 관리 (
v1alpha, 제한된 액세스): 이 서비스의 경우 판매자는 서비스 제공업체의 포털에서 Google 호스팅 계정 연결 대화상자를 통해 또는 표준 핸드셰이크 프로세스 (propose다음에approve)를 사용하여 핸드셰이크를 완료할 수 있습니다. 통합에 관한 자세한 내용은 판매자 센터 서비스 제공업체 문서를 참고하세요.
액세스 권한
각 서비스 유형은 서비스 제공업체의 사용자에게 서비스가 제공되는 계정에 대한 특정 수준의 액세스 권한을 제공합니다.
계정 집계: 이 서비스는 전체
ADMIN권한을 제공합니다.캠페인 관리: 이 서비스는 제한된 액세스 권한을 제공하여 연결된 Google Ads 계정이 제품 및 기본 계정 정보에 액세스할 수 있도록 합니다.
비교 쇼핑: 이 서비스는 기본적으로 전체
ADMIN권한을 제공합니다. 하지만 비즈니스는 판매자 센터에서 부여된 액세스 권한을 제한할 수 있습니다.지역 비즈니스 정보 관리: 이 서비스는 직접 액세스 권한을 제공하지 않습니다. 대신 등록정보가 제품을 판매자 센터 계정과 동기화할 수 있습니다.
중요: 다음 서비스 유형에 설명된 액세스 권한은 승인된 서비스 제공업체에만 적용됩니다. 서비스 제공업체이고 이 기능을 사용하려면 지원팀에 문의하세요. Content API for Shopping에서 제품 관리를 위한 accounts.link 메서드를 이미 승인받은 경우 추가 승인 없이 Merchant API에서 이 서비스를 사용할 수 있습니다.
계정 관리: 이 서비스는 기본적으로 전체
ADMIN권한을 제공합니다.제품 관리: 이 서비스는 전체
ADMIN권한을 제공합니다. 향후에는 제품 관련 액세스 권한으로만 제한됩니다.UCP 결제 관리 (
v1alpha, 제한된 액세스): 이 서비스는 전체ADMIN권한을 제공합니다. 향후에는 UCP 결제 관련 액세스 권한으로만 제한됩니다.
서드 파티 플랫폼에 관계가 적용되는 방식
다른 비즈니스를 대신하여 계정을 관리하는 서드 파티 플랫폼인 경우 다음은 다양한 개념이 계정 구조에 매핑되는 방식을 보여줍니다.
- 서비스 제공업체: 고급 계정입니다.
- 서비스를 받는 계정: 관리하는 비즈니스를 나타내는 판매자 센터 계정입니다.
- 서비스:
accountAggregation: 판매자를 대신하여 새 하위 계정을 만드는 매장 빌더 (이커머스 플랫폼), 채널 파트너, 마켓, 멀티브랜드 소매업체에서 사용합니다. 판매자 센터 UI는 온라인 상점 제작 도구 및 채널 파트너를accountAggregation가 있는 고급 계정으로 자동 구성하여 판매자 센터 UI에서 하위 계정을 보고 관리할 수 있도록 합니다.accountManagement: 판매자가 소유한 독립형 클라이언트 계정을 만들거나 연결하는 대행사에서 사용하며, 대행사용 판매자 센터에서 확인할 수 있습니다. 다른 유형의 서비스 제공업체는 Merchant API의accounts.list메서드를 사용하여 연결된 계정 정보를 확인합니다.