Accounts API를 사용하여 판매자 센터 계정과 다른 서비스 제공업체 간의 관계를 관리할 수 있습니다. 관계는 제공업체가 비즈니스에 특정 서비스를 제공할 수 있도록 하는 공식적인 연결입니다. 서비스는 제품 관리 또는 캠페인 관리와 같이 제공업체에 부여되는 권한과 기능을 정의합니다. 예를 들어 판매자 센터 계정을 Google Ads 계정에 연결하면 Ads 계정에서 제품 데이터를 사용하여 광고 캠페인을 실행할 수 있습니다.
관계는 다음 속성으로 구성됩니다.
- 서비스를 받는 판매자 센터 계정
- 서비스 제공업체
- 판매자 센터 계정에 제공되는 서비스 또는 서비스 집합
별칭
서비스 제공업체는 서비스를 제공하는 계정과 별칭을 연결할 수 있습니다. 이는 Content API for Shopping의
계정
리소스에 있던 seller_id 필드와
동일합니다. 별칭은 AccountRelationship 리소스 내의 선택적 account_id_alias 필드를 사용하여 할당할 수 있으며 맞춤 식별자 역할을 합니다. 별칭은 ASCII 문자, 10진수, 하이픈, 밑줄, 마침표 또는 물결표 ([A-Za-z0-9_~.-]{1,50}) 중에서 선택한 1~50자로 구성되어야 합니다.
별칭을 사용하여 계정에 액세스하기 위한 URL 구조는 GET /accounts/v1/accounts/{provider}~{account_id_alias}입니다.
서비스
Accounts API에서 계정은 다음 서비스를 받을 수 있습니다. 계정을 만드는 동안 이러한 서비스를 많이 추가할 수 있습니다.
계정 집계: 이 서비스는 고급 계정을 다른 계정에 연결하여 고급 계정에 전체 무제한 액세스 권한을 부여합니다. 일반적으로 중첩된 계정을 중앙에서 제어해야 하는 마켓플레이스, 멀티 브랜드 소매업체 또는 국제 소매업체에서 사용합니다. 전자상거래 플랫폼 또는 채널 파트너인 경우
accountManagement를 대신 사용하는 것이 좋습니다. 계정 집계를 사용하여 계정을 만들 때는externalAccountId를 생략해야 합니다.캠페인 관리: 이 서비스는 판매자 센터 계정과 Google Ads 계정 간의 연결을 모델링하여 Ads 계정에 광고 캠페인을 실행하는 데 필요한 제품 및 계정 데이터에 대한 액세스 권한을 부여합니다. 이 경우 서비스 제공업체는
GOOGLE_ADS이고externalAccountId는 Google Ads 계정의 ID입니다. 이 서비스는 기존 계정에 제안할 수도 있습니다.
비교 쇼핑: 판매자 센터 계정을 운영하는 비교 쇼핑 서비스 (CSS)와의 관계를 나타냅니다.
지역 비즈니스 정보 관리: Google 비즈니스 프로필을 사용하여 오프라인 판매점 인벤토리 및 지역 비즈니스 정보를 관리하는 매장 관리자와의 관계를 나타냅니다.
계정 관리: 이 서비스를 사용하면 제공업체가 판매자 센터 계정에 대한 관리 작업을 실행할 수 있습니다. 예를 들어 계정 설정 구성, 사용자 관리 또는 비즈니스 정보 업데이트 등이 있습니다. 비즈니스에서 부여된 액세스 권한을 제한할 수도 있습니다. 계정을 만드는 동안 이 서비스를 사용하면 제공업체에 연결된 계정이 생성됩니다. 이는 전자상거래 플랫폼 및 채널 파트너에게 권장되는 접근 방식입니다. 이 서비스는 기존 계정에 제안할 수도 있습니다.
제품 관리: 이 서비스를 사용하면 제공업체가 제품 및 데이터 소스, 규칙과 같은 관련 기능을 관리할 수 있습니다. 계정을 만드는 동안 추가되는 경우 일반적으로
accountManagement또는accountAggregation과 함께 사용됩니다. 이 서비스는 기존 계정에 제안할 수도 있습니다.
악수
서비스를 설정하려면 서비스를 제공하는 계정과 서비스를 받는 계정 모두 연결을 승인해야 합니다. 이 승인 프로세스를 악수라고 합니다.
악수는 두 단계로 이루어집니다.
- 한 당사자가 서비스 링크를 제안합니다.
- 다른 당사자가 제안을 승인하거나 거부합니다.
제안이 수락되면 서비스가 승인되고 완전히 설정된 것으로 간주됩니다. 이제 서비스 제공업체에 부여된 모든 액세스 권한 이 자격요건을 충족하는 사용자에게 부여됩니다 (아래 액세스 권한 참고).
제안을 만들거나 거부하거나 승인하는 사용자는 프로세스를 시작하는 계정에 대한
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를 사용하여 계정을 만드는 동안 서비스가 추가되면 자동으로 승인됩니다.제품 관리: 이 서비스의 경우 일반적인 악수 프로세스가 적용됩니다 (한 당사자가 제안하고 다른 당사자가 수락).
액세스 권한
각 서비스 유형은 서비스 제공업체의 사용자에게 서비스되는 계정에 대한 특정 수준의 액세스 권한을 제공합니다.
계정 집계: 이 서비스는 전체
ADMIN권한을 제공합니다.캠페인 관리: 이 서비스는 연결된 Ads 계정에서 제품 및 기본 계정 정보에 액세스할 수 있도록 제한된 액세스 권한을 제공합니다.
비교 쇼핑: 이 서비스는 기본적으로 전체
ADMIN권한을 제공합니다. 하지만 비즈니스에서 판매자 센터에 부여된 액세스 권한을 제한할 수 있습니다.지역 비즈니스 정보 관리: 이 서비스는 직접 액세스 권한을 제공하지 않습니다. 대신 정보가 제품을 판매자 센터 계정과 동기화할 수 있도록 합니다.
중요: 다음 서비스 유형에 설명된 액세스 권한은 승인된 서비스 제공업체에만 적용됩니다. 서비스 제공업체이며 이 기능을 사용하려는 경우 지원
팀에 문의하세요. 이전에 Content API for Shopping의 제품 관리를 위한 accounts.link 메서드가 이미 승인된 경우 추가 승인 없이 Merchant API에서 이 서비스를 사용할 수 있습니다.
계정 관리: 이 서비스는 기본적으로 전체
ADMIN권한을 제공합니다.제품 관리: 이 서비스는 전체
ADMIN권한을 제공합니다. 향후에는 제품 관련 액세스 권한으로만 제한됩니다.
서드 파티 플랫폼에 관계가 적용되는 방식
다른 비즈니스를 대신하여 계정을 관리하는 서드 파티 플랫폼인 경우 다음은 다양한 개념이 계정 구조에 매핑되는 방식을 보여줍니다.
- 서비스 제공업체: 고급 계정입니다.
- 서비스를 받는 계정: 관리하는 비즈니스를 나타내는 판매자 센터 계정입니다.
- 서비스:
accountManagement: 판매자를 대신하여 새 계정을 만드는 이커머스 플랫폼 및 채널 파트너에게 권장되는 서비스입니다. 판매자가 소유하고 관리를 위해 연결된 계정을 만듭니다. 이는 이 사용 사례에 권장되는 판매자 센터 구조와 일치합니다.accountAggregation: 이 서비스는 고급 계정을 다른 계정에 연결합니다. 지원되지만 전자상거래 플랫폼 및 채널 파트너에게는 권장되지 않습니다.