판매자 센터 서비스 약관 동의 관리

판매자 센터와 그 기능을 사용하려면 비즈니스 위치에 대한 판매자 센터 서비스 약관 (ToS)에 동의해야 합니다. 이 계약에는 판매자 센터 서비스를 사용하는 데 필요한 법적 약관이 명시되어 있습니다.

이 가이드에서는 판매자 API를 사용하여 자체 계정 또는 서드 파티 제공업체 (3P)로서 관리하는 계정의 이러한 계약을 관리하는 방법을 설명합니다.

다음과 같은 작업을 할 수 있습니다.

  • 계정의 현재 서비스 약관 동의 상태를 확인합니다.
  • 판매자가 필요한 서비스 약관에 동의하도록 안내합니다.
  • 고객 계정 또는 독립형 계정의 서드 파티 제공업체로서 서비스 약관을 관리합니다.

기본 요건

Merchant API를 사용하려면 판매자 센터 계정이 필요합니다. 판매자 센터 사용자 인터페이스 (UI)를 사용하여 계정을 만든 후에는 UI 또는 API를 사용하여 계정을 변경할 수 있습니다 (예: 비즈니스 정보 업데이트, 사용자 관리 등).

여러 계정을 관리해야 하는 경우 Merchant API를 사용하여 고객 계정을 만들 수 있습니다. 하위 계정 만들기 및 관리를 참고하세요.

계정의 서비스 약관 동의 상태 확인

판매자가 판매자 센터를 완전히 활용하기 전에 또는 현재 계약 상태를 확인해야 하는 경우 서비스 약관 계약의 상태를 가져올 수 있습니다.

termsOfServiceAgreementStates.retrieveForApplication 메서드를 사용하여 핵심 판매자 센터 애플리케이션의 서비스 약관 동의 상태를 가져옵니다. 이 메서드는 현재 서비스 약관(있는 경우)을 반환하고, 마지막 수락 이후 서비스 약관이 업데이트된 경우 수락해야 하는 최신 버전을 반환합니다.

다음은 샘플 요청입니다.

GET https://merchantapi.googleapis.com/accounts/v1beta/accounts/{ACCOUNT_ID}/termsOfServiceAgreementStates:retrieveForApplication

호출에 성공하면 TermsOfServiceAgreementState 리소스가 반환됩니다. 이 리소스에는 다음이 포함됩니다.

  • name: 이 동의 상태의 식별자입니다.
  • regionCode: 이 계약 상태가 적용되는 국가입니다(일반적으로 계정의 비즈니스 국가).
  • termsOfServiceKind: MERCHANT_CENTER이 됩니다.
  • accepted: 계정에서 이미 수락한 서비스 약관 버전에 관한 세부정보입니다. 여기에는 termsOfService 리소스 이름 (예: termsOfService/132)과 acceptedBy가 포함됩니다. 최신 서비스 약관 버전이 required인 경우 validUntil 날짜도 포함될 수 있습니다.
  • required: 계정에서 수락해야 하는 서비스 약관 버전에 관한 세부정보입니다. 여기에는 termsOfService 리소스 이름과 사람이 읽을 수 있는 서비스 약관 문서를 가리키는 tosFileUri이 포함됩니다.

응답 예시:

{
  "name": "accounts/{ACCOUNT_ID}/termsOfServiceAgreementStates/MERCHANT_CENTER-{REGION_CODE}",
  "regionCode": "{REGION_CODE}",
  "termsOfServiceKind": "MERCHANT_CENTER",
  "accepted": {
    "termsOfService": "termsOfService/132",
    "acceptedBy": "accounts/{ACCOUNT_ID}"
  },
  "required": {
    "termsOfService": "termsOfService/132",
    "tosFileUri": "https://www.google.com/intl/{REGION_CODE}/policies/merchants/terms/"
  }
}

새 서비스 약관이 required인 경우 판매자가 이를 수락하도록 안내해야 합니다.

다음은 특정 계정 및 국가의 서비스 약관 동의 상태를 가져오는 데 사용할 수 있는 샘플입니다.

자바

import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest;
import com.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState;
import com.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateName;
import com.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateServiceClient;
import com.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateServiceSettings;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;

/**
 * This class demonstrates how to get a TermsOfServiceAgreementState for a specific
 * TermsOfServiceKind and country.
 */
public class GetTermsOfServiceAgreementStateSample {

  public static void getTermsOfServiceAgreementState(Config config) throws Exception {

    // Obtains OAuth token based on the user's configuration.
    GoogleCredentials credential = new Authenticator().authenticate();

    // Creates service settings using the credentials retrieved above.
    TermsOfServiceAgreementStateServiceSettings termsOfServiceAgreementStateServiceSettings =
        TermsOfServiceAgreementStateServiceSettings.newBuilder()
            .setCredentialsProvider(FixedCredentialsProvider.create(credential))
            .build();

    // Creates TermsOfServiceAgreementState name to identify TermsOfServiceAgreementState.
    String name =
        TermsOfServiceAgreementStateName.newBuilder()
            .setAccount(config.getAccountId().toString())
            // The Identifier is: "{TermsOfServiceKind}-{country}"
            .setIdentifier("MERCHANT_CENTER-US")
            .build()
            .toString();

    System.out.println(name);

    // Calls the API and catches and prints any network failures/errors.
    try (TermsOfServiceAgreementStateServiceClient termsOfServiceAgreementStateServiceClient =
        TermsOfServiceAgreementStateServiceClient.create(
            termsOfServiceAgreementStateServiceSettings)) {

      // The name has the format:
      // accounts/{account}/termsOfServiceAgreementStates/{TermsOfServiceKind}-{country}
      GetTermsOfServiceAgreementStateRequest request =
          GetTermsOfServiceAgreementStateRequest.newBuilder().setName(name).build();

      System.out.println("Sending Get TermsOfServiceAgreementState request:");
      TermsOfServiceAgreementState response =
          termsOfServiceAgreementStateServiceClient.getTermsOfServiceAgreementState(request);

      System.out.println("Retrieved TermsOfServiceAgreementState below");
      // If the terms of service needs to be accepted, the "required" field will include the
      // specific version of the terms of service which needs to be accepted, alongside a link to
      // the terms of service itself.
      System.out.println(response);
    } catch (Exception e) {
      System.out.println(e);
    }
  }


  public static void main(String[] args) throws Exception {
    Config config = Config.load();

    getTermsOfServiceAgreementState(config);
  }
}

PHP

use Google\ApiCore\ApiException;
use Google\Shopping\Merchant\Accounts\V1beta\Client\TermsOfServiceAgreementStateServiceClient;
use Google\Shopping\Merchant\Accounts\V1beta\GetTermsOfServiceAgreementStateRequest;

/**
 * Demonstrates how to get a TermsOfServiceAgreementState.
 */
class GetTermsOfServiceAgreementState
{

    /**
     * Gets a TermsOfServiceAgreementState.
     *
     * @param array $config The configuration data.
     * @return void
     */
    public static function getTermsOfServiceAgreementState($config): void
    {
        // Get OAuth credentials.
        $credentials = Authentication::useServiceAccountOrTokenFile();

        // Create client options.
        $options = ['credentials' => $credentials];

        // Create a TermsOfServiceAgreementStateServiceClient.
        $termsOfServiceAgreementStateServiceClient = new TermsOfServiceAgreementStateServiceClient($options);

        // Service agreeement identifier
        $identifier = "MERCHANT_CENTER-US";

        // Create TermsOfServiceAgreementState name.
        $name = "accounts/" . $config['accountId'] . "/termsOfServiceAgreementStates/" . $identifier;

        print $name . PHP_EOL;

        try {
            // Prepare the request.
            $request = new GetTermsOfServiceAgreementStateRequest([
                'name' => $name,
            ]);

            print "Sending Get TermsOfServiceAgreementState request:" . PHP_EOL;
            $response = $termsOfServiceAgreementStateServiceClient->getTermsOfServiceAgreementState($request);

            print "Retrieved TermsOfServiceAgreementState below\n";
            print $response->serializeToJsonString() . PHP_EOL;
        } catch (ApiException $e) {
            print $e->getMessage();
        }
    }

    /**
     * Helper to execute the sample.
     *
     * @return void
     */
    public function callSample(): void
    {
        $config = Config::generateConfig();

        self::getTermsOfServiceAgreementState($config);
    }

}

// Run the script
$sample = new GetTermsOfServiceAgreementState();
$sample->callSample();

Python

from examples.authentication import configuration
from examples.authentication import generate_user_credentials
from google.shopping.merchant_accounts_v1beta import GetTermsOfServiceAgreementStateRequest
from google.shopping.merchant_accounts_v1beta import TermsOfServiceAgreementStateServiceClient

# Replace with your actual value.
_ACCOUNT_ID = configuration.Configuration().read_merchant_info()
_IDENTIFIER = "MERCHANT_CENTER-US"  # Replace with your identifier


def get_terms_of_service_agreement_state():
  """Gets a TermsOfServiceAgreementState for a specific TermsOfServiceKind and country."""

  credentials = generate_user_credentials.main()
  client = TermsOfServiceAgreementStateServiceClient(credentials=credentials)

  name = (
      "accounts/"
      + _ACCOUNT_ID
      + "/termsOfServiceAgreementStates/"
      + _IDENTIFIER
  )

  print(name)

  request = GetTermsOfServiceAgreementStateRequest(name=name)

  try:
    print("Sending Get TermsOfServiceAgreementState request:")
    response = client.get_terms_of_service_agreement_state(request=request)
    print("Retrieved TermsOfServiceAgreementState below")
    print(response)
  except RuntimeError as e:
    print(e)


if __name__ == "__main__":
  get_terms_of_service_agreement_state()

서비스 약관 동의

판매자는 판매자 센터 기능에 대한 액세스 권한을 유지하려면 최신 서비스 약관에 동의해야 합니다.

내 계정의 서비스 약관 수락

판매자 센터 계정을 직접 관리하는 경우 다음 단계를 따르세요.

  1. termsOfServiceAgreementStates.retrieveForApplication를 호출하여 서비스 약관이 required인지 확인합니다.
  2. 서비스 약관이 필요한 경우 required 필드에서 termsOfService 이름을 기록합니다 (예: termsOfService/132).
  3. termsOfService.accept을 호출하여 서비스 약관에 동의합니다. retrieveForApplication에서 반환된 ToS 이름, ACCOUNT_ID, regionCode이 필요합니다.

    다음은 샘플 요청입니다.

    POST https://merchantapi.googleapis.com/accounts/v1beta/{name={termsOfService/VERSION}}:accept
    {
      "account": "accounts/{ACCOUNT_ID}",
      "regionCode": "{REGION_CODE}"
    }
    

    호출이 성공하면 빈 응답 본문이 반환되고 계정의 서비스 약관 동의 상태가 업데이트됩니다.

판매자가 서비스 약관에 동의하도록 안내 (서드 파티 제공업체용)

다른 비즈니스의 독립형 판매자 센터 계정을 관리하는 서드 파티 제공업체 (3P)는 해당 비즈니스를 대신하여 서비스 약관에 동의해서는 안 됩니다. 대신 다음을 수행해야 합니다.

  1. 최신 서비스 약관 가져오기: 판매자의 regionCodeMERCHANT_CENTER 종류에 대해 termsOfService.retrieveLatest를 호출하여 수락해야 할 수 있는 최신 서비스 약관 버전의 세부정보를 가져옵니다.

    샘플 요청:

    GET https://merchantapi.googleapis.com/accounts/v1beta/termsOfService:retrieveLatest?regionCode={REGION_CODE}&kind=MERCHANT_CENTER
    

    샘플 응답:

    {
        "name": "{termsOfService/VERSION}",
        "regionCode": "{REGION_CODE}",
        "kind": "MERCHANT_CENTER",
        "fileUri": "https://www.google.com/intl/{REGION_CODE}/policies/merchants/terms/"
    }
    
  2. 서비스 약관 표시: 대답의 fileUri를 사용하여 애플리케이션 UI 내에서 판매자에게 서비스 약관의 전체 텍스트를 표시합니다.

  3. 판매자 동의 획득: 판매자가 UI 내에서 약관에 명시적으로 동의해야 합니다.

  4. API를 사용하여 수락 기록: 판매자가 수락한 후 1단계에서 획득한 서비스 약관의 name, 판매자의 ACCOUNT_ID, 판매자의 regionCode를 사용하여 termsOfService.accept를 호출합니다.

    샘플 요청:

    POST https://merchantapi.googleapis.com/accounts/v1beta/{name={termsOfService/VERSION}}:accept
    {
      "account": "accounts/{MERCHANT_ACCOUNT_ID}",
      "regionCode": "{REGION_CODE}"
    }
    

다음은 판매자가 동의한 후 특정 계정의 서비스 약관에 동의하는 데 사용할 수 있는 샘플입니다.

자바

import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest;
import com.google.shopping.merchant.accounts.v1beta.TermsOfServiceServiceClient;
import com.google.shopping.merchant.accounts.v1beta.TermsOfServiceServiceSettings;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;

/** This class demonstrates how to accept the TermsOfService agreement in a given account. */
public class AcceptTermsOfServiceSample {

  public static void acceptTermsOfService(String accountId, String tosVersion, String regionCode)
      throws Exception {

    // Obtains OAuth token based on the user's configuration.
    GoogleCredentials credential = new Authenticator().authenticate();

    // Creates service settings using the credentials retrieved above.
    TermsOfServiceServiceSettings tosServiceSettings =
        TermsOfServiceServiceSettings.newBuilder()
            .setCredentialsProvider(FixedCredentialsProvider.create(credential))
            .build();

    // Calls the API and catches and prints any network failures/errors.
    try (TermsOfServiceServiceClient tosServiceClient =
        TermsOfServiceServiceClient.create(tosServiceSettings)) {

      // The parent has the format: accounts/{account}
      AcceptTermsOfServiceRequest request =
          AcceptTermsOfServiceRequest.newBuilder()
              .setName(String.format("termsOfService/%s", tosVersion))
              .setAccount(String.format("accounts/%s", accountId))
              .setRegionCode(regionCode)
              .build();

      System.out.println("Sending request to accept terms of service...");
      tosServiceClient.acceptTermsOfService(request);

      System.out.println("Successfully accepted terms of service.");
    } catch (Exception e) {
      System.out.println(e);
    }
  }

  public static void main(String[] args) throws Exception {
    Config config = Config.load();

    // See GetTermsOfServiceAgreementStateSample to understand how to check which version of the
    // terms of service needs to be accepted, if any.
    // Likewise, if you know that the terms of service needs to be accepted, you can also simply
    // call RetrieveLatestTermsOfService to get the latest version of the terms of service.
    // Region code is either a country when the ToS applies specifically to that country or 001 when
    // it applies globally.
    acceptTermsOfService(config.getAccountId().toString(), "VERSION_HERE", "REGION_CODE_HERE");
  }
}

PHP

use Google\ApiCore\ApiException;
use Google\Shopping\Merchant\Accounts\V1beta\AcceptTermsOfServiceRequest;
use Google\Shopping\Merchant\Accounts\V1beta\Client\TermsOfServiceServiceClient;

/**
 * Demonstrates how to accept the TermsOfService agreement in a given account.
 */
class AcceptTermsOfService
{

    /**
     * Accepts the Terms of Service agreement.
     *
     * @param string $accountId The account ID.
     * @param string $tosVersion The Terms of Service version.
     * @param string $regionCode The region code.
     * @return void
     */
    public static function acceptTermsOfService($accountId, $tosVersion, $regionCode): void
    {
        // Get OAuth credentials.
        $credentials = Authentication::useServiceAccountOrTokenFile();

        // Create client options.
        $options = ['credentials' => $credentials];

        // Create a TermsOfServiceServiceClient.
        $tosServiceClient = new TermsOfServiceServiceClient($options);

        try {
            // Prepare the request.
            $request = new AcceptTermsOfServiceRequest([
                'name' => sprintf("termsOfService/%s", $tosVersion),
                'account' => sprintf("accounts/%s", $accountId),
                'region_code' => $regionCode,
            ]);

            print "Sending request to accept terms of service...\n";
            $tosServiceClient->acceptTermsOfService($request);

            print "Successfully accepted terms of service.\n";
        } catch (ApiException $e) {
            print $e->getMessage();
        }
    }

    /**
     * Helper to execute the sample.
     *
     * @return void
     */
    public function callSample(): void
    {
        $config = Config::generateConfig();

        // Replace with actual values.
        $tosVersion = "132";
        $regionCode = "US";

        self::acceptTermsOfService($config['accountId'], $tosVersion, $regionCode);
    }
}

// Run the script
$sample = new AcceptTermsOfService();
$sample->callSample();

Python

from examples.authentication import configuration
from examples.authentication import generate_user_credentials
from google.shopping.merchant_accounts_v1beta import AcceptTermsOfServiceRequest
from google.shopping.merchant_accounts_v1beta import TermsOfServiceServiceClient

# Replace with your actual values.
_ACCOUNT_ID = configuration.Configuration().read_merchant_info()
_TOS_VERSION = (  # Replace with the Terms of Service version to accept
    "VERSION_HERE"
)
_REGION_CODE = "US"  # Replace with the region code


def accept_terms_of_service():
  """Accepts the Terms of Service agreement for a given account."""

  credentials = generate_user_credentials.main()
  client = TermsOfServiceServiceClient(credentials=credentials)

  # Construct the request
  request = AcceptTermsOfServiceRequest(
      name=f"termsOfService/{_TOS_VERSION}",
      account=f"accounts/{_ACCOUNT_ID}",
      region_code=_REGION_CODE,
  )

  try:
    print("Sending request to accept terms of service...")
    client.accept_terms_of_service(request=request)
    print("Successfully accepted terms of service.")
  except RuntimeError as e:
    print(e)


if __name__ == "__main__":
  accept_terms_of_service()

서드 파티 제공업체를 위한 특별 고려사항

서드 파티 제공업체는 고객 계정 또는 독립형 계정의 서비스 약관을 관리할 수 있습니다.

클라이언트 계정의 서비스 약관 관리

고급 계정 을 운영하고 여러 비즈니스의 클라이언트 계정을 만드는 경우:

  • 고급 계정 수락: 고급 계정이 클라이언트 계정에 계정 집계 서비스를 제공하는 경우 고급 계정에서 수락한 서비스 약관이 해당 서비스가 있는 모든 클라이언트 계정에도 적용됩니다.
  • 표시 및 동의: 고급 계정의 수락이 고객 계정을 포함하는 경우에도 각 고객 계정의 실제 비즈니스 소유자에게 관련 Google 판매자 센터 서비스 약관을 표시하는 것이 권장사항이며 법적 요구사항일 수도 있습니다. 고급 계정 수준에서 수락을 위한 API 호출이 이루어지더라도 이러한 약관을 이해하고 동의한다는 명시적 동의를 받아야 합니다.
  • 클라이언트 계정 상태 확인: 특정 클라이언트 계정에서 termsOfServiceAgreementStates.retrieveForApplication를 사용하여 서비스 약관 상태를 확인하고 고급 계정의 계약이 적용되는지 또는 직접 조치가 필요한지 확인합니다.

독립형 계정의 서비스 약관 관리

판매자가 서비스 약관에 동의하도록 안내에 자세히 설명되어 있듯이, 비즈니스가 독립형 판매자 센터 계정을 만들거나 관리하는 것을 지원하는 경우 해당 비즈니스 (계정 소유자)가 직접 서비스 약관에 동의해야 합니다. 사용자가 인터페이스를 통해 명시적 동의를 제공한 후에 약관을 가져와 표시한 다음 사용자를 대신하여 termsOfService.accept 메서드를 호출하여 이를 지원합니다.