계정 하위 API를 사용하여 계정 및 연결된 모든 하위 계정의 모든 제품에 대한 배송 설정을 관리합니다.
배송 설정을 변경하면 모든 제품에 적용됩니다. 개별 제품의 배송을 업데이트하려면 Merchant Products API를 사용하세요.
자세한 내용은 배송 설정을 참고하세요.
배송 설정 개요
accounts.shippingSettings
리소스를 사용하면 고급 계정 및 연결된 모든 하위 계정의 배송 설정을 가져오고 업데이트할 수 있습니다.
고급 계정은 일반적으로 여러 비즈니스의 온라인 상점과 API 서비스를 관리하는 통합업체, 애그리게이터, 채널 파트너가 사용합니다. 여러 온라인 상점이나 별도의 웹사이트에서 판매되는 브랜드가 있는 비즈니스도 단일 고급 계정에서 하위 계정을 사용할 수 있습니다.
Google에서 일부 제품의 예상 배송 기간을 자동으로 업데이트할 수 있습니다.
배송 설정 추가
계정의 배송 설정을 추가하거나 업데이트하려면 accounts.shippingSettings.insert
메서드를 사용하세요.
다음 샘플 요청은 배송비, 이 배송 서비스로 제한되는 포인트 프로그램, 통화 코드를 설정합니다.
HTTP
POST https://merchantapi.googleapis.com/accounts/v1beta/accounts/{ACCOUNT_ID}/shippingSettings:insert
{
"etag": "",
"name": "accounts/ACCOUNT_ID/shippingSetting",
"services": [
{
"deliveryCountries": [
"COUNTRY_CODE"
],
"serviceName": "SERVICE_NAME",
"active": false,
"deliveryTime": {},
"loyaltyPrograms": [
{
"programLabel": "PROGRAM_LABEL"
}
],
"minimumOrderValue": {
"amountMicros": PRICE,
"currencyCode": "CURRENCY_CODE"
},
"currencyCode": "USD",
"rateGroups": [
{
"applicableShippingLabels": [
"SHIPPING_LABEL"
],
"singleValue": {
"flatRate": {
"amountMicros": 10000000,
"currencyCode": "USD"
}
}
}
]
}
]
}
cURL
curl --request POST \
'https://merchantapi.googleapis.com/accounts/v1beta/accounts/ACCOUNT_ID/shippingSettings:insert' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"name":"SHIPPING_SETTING_NAME","services":[{"serviceName":"SERVICE_NAME","currencyCode":"CURRENCY_CODE","rateGroups":[{"applicableShippingLabels":["SHIPPING_LABEL"],"carrierRates":[{"name":"new","carrier":"CARRIER_NAME","carrierService":"CARRIER_SERVICE","originPostalCode":"ZIPCODE"}],"singleValue":{"flatRate":{"amountMicros":10000000,"currencyCode":"USD"}}}],"deliveryCountries":["COUNTRY_CODE"],"deliveryTime":{"maxHandlingDays":2,"minHandlingDays":1},"minimumOrderValue":{"amountMicros":50000000,"currencyCode":"USD"},"active":false}]}' \
--compressed
다음을 바꿉니다.
- ACCOUNT_ID: 판매자 센터 계정의 고유 식별자입니다.
- COUNTRY_CODE: 이 서비스가 적용되는 국가의 CLDR (Common Locale Data Repository) 코드입니다. 요금 그룹의 가격과 일치해야 합니다.
- SERVICE_NAME: 서비스 이름입니다.
- CARRIER_NAME: 운송업체의 이름입니다. 예를 들어 UPS 및 FedEx가 있습니다.
- CARRIER_SERVICE: 운송업체에서 지원하는 서비스입니다. 운송업체 서비스의 전체 목록은 운송업체 요금 (독일, 미국, 영국, 오스트레일리아만 해당)을 참고하세요.
- PROGRAM_LABEL: 판매자 센터의 포인트 멤버십 설정에 설정된 포인트 멤버십 라벨입니다.
- SHIPPING_LABEL: 이 요금 그룹이 적용되는 제품을 정의하는 배송 라벨 목록입니다.
- PRICE: 가격을 마이크로 단위의 숫자로 나타냅니다. 예를 들어 1달러는 1,000,000마이크로입니다.
- CURRENCY_CODE: 가격의 통화입니다(3자리 약어 사용).
지정된 필드에 대한 자세한 내용은 참고 문서를 참고하세요.
하나의 속성만 업데이트하는 경우에도 요청 본문에는 accounts.shippingSettings
리소스의 전체 리소스 본문이 포함되어야 합니다. 요청 본문의 값이 NULL이거나 누락되면 기존 값이 null로 설정되기 때문입니다.
다음은 성공적인 호출의 샘플 응답입니다.
{
"name": "accounts/ACCOUNT_ID/shippingSettings",
"services": [
{
"serviceName": "SERVICE_NAME",
"active": false,
"deliveryCountries": [
"COUNTRY_CODE"
],
"currencyCode": "CURRENCY_CODE",
"rateGroups": [
{
"applicableShippingLabels": [
"SHIPPING_LABEL"
],
"singleValue": {
"flatRate": {
"amountMicros": "PRICE",
"currencyCode": "CURRENCY_CODE"
}
}
}
],
"shipmentType": "LOCAL_DELIVERY",
"storeConfig": {
"storeServiceType": "ALL_STORES",
"cutoffConfig": {
"localCutoffTime": {
"hour": "7",
"minute": "40"
},
"noDeliveryPostCutoff": false
},
"serviceRadius": {
"value": "40",
"unit": "KILOMETERS"
}
}
}
],
"etag": "OAJCTQgBEAAaRwoEdGVzdBIEIgJVUxoDVVNEIggiBggHECgoACoeCAESDwoNCAESCU9WRVJTSVpFRBoJIgcIAhCAwtcvWAWSAQCaAQQIAhAo"
}
다음은 클라이언트 라이브러리를 사용하여 특정 계정의 배송 설정을 업데이트하는 데 사용할 수 있는 샘플입니다.
자바
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.accounts.v1beta.DeliveryTime;
import com.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest;
import com.google.shopping.merchant.accounts.v1beta.RateGroup;
import com.google.shopping.merchant.accounts.v1beta.Service;
import com.google.shopping.merchant.accounts.v1beta.Service.ShipmentType;
import com.google.shopping.merchant.accounts.v1beta.ShippingSettings;
import com.google.shopping.merchant.accounts.v1beta.ShippingSettingsServiceClient;
import com.google.shopping.merchant.accounts.v1beta.ShippingSettingsServiceSettings;
import com.google.shopping.merchant.accounts.v1beta.Value;
import com.google.shopping.type.Price;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;
/** This class demonstrates how to insert a ShippingSettings for a Merchant Center account. */
public class InsertShippingSettingsSample {
private static String getParent(String accountId) {
return String.format("accounts/%s", accountId);
}
public static void insertShippingSettings(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.
ShippingSettingsServiceSettings shippingSettingsServiceSettings =
ShippingSettingsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
// Creates parent to identify where to insert the shippingsettings.
String parent = getParent(config.getAccountId().toString());
// Calls the API and catches and prints any network failures/errors.
try (ShippingSettingsServiceClient shippingSettingsServiceClient =
ShippingSettingsServiceClient.create(shippingSettingsServiceSettings)) {
InsertShippingSettingsRequest request =
InsertShippingSettingsRequest.newBuilder()
.setParent(parent)
.setShippingSetting(
ShippingSettings.newBuilder()
// Etag needs to be an empty string on initial insert
// On future inserts, call GET first to get the Etag
// Then use the retrieved Etag on future inserts.
// NOTE THAT ON THE INITIAL INSERT, YOUR SHIPPING SETTINGS WILL
// NOT BE STORED, YOU HAVE TO CALL INSERT AGAIN WITH YOUR
// RETRIEVED ETAG.
// .setEtag("")
.setEtag("PPa=")
.addServices(
Service.newBuilder()
.setServiceName("Canadian Postal Service")
.setActive(true)
.addDeliveryCountries("CA")
.setCurrencyCode("CAD")
.setDeliveryTime(
DeliveryTime.newBuilder()
.setMinTransitDays(0)
.setMaxTransitDays(3)
.setMinHandlingDays(0)
.setMaxHandlingDays(3)
.build())
.addRateGroups(
RateGroup.newBuilder()
.addApplicableShippingLabels("Oversized")
.addApplicableShippingLabels("Perishable")
.setSingleValue(Value.newBuilder().setPricePercentage("5.4"))
.setName("Oversized and Perishable items")
.build())
.setShipmentType(ShipmentType.DELIVERY)
.setMinimumOrderValue(
Price.newBuilder()
.setAmountMicros(10000000)
.setCurrencyCode("CAD")
.build())
.build())
.build())
.build();
System.out.println("Sending insert ShippingSettings request");
ShippingSettings response = shippingSettingsServiceClient.insertShippingSettings(request);
System.out.println("Inserted ShippingSettings Name below");
System.out.println(response.getName());
// You can apply ShippingSettings to specific products by using the `shippingLabel` field
// on the product.
} catch (Exception e) {
System.out.println(e);
}
}
public static void main(String[] args) throws Exception {
Config config = Config.load();
insertShippingSettings(config);
}
}
PHP
use Google\ApiCore\ApiException;
use Google\Shopping\Merchant\Accounts\V1beta\Client\ShippingSettingsServiceClient;
use Google\Shopping\Merchant\Accounts\V1beta\DeliveryTime;
use Google\Shopping\Merchant\Accounts\V1beta\InsertShippingSettingsRequest;
use Google\Shopping\Merchant\Accounts\V1beta\RateGroup;
use Google\Shopping\Merchant\Accounts\V1beta\Service;
use Google\Shopping\Merchant\Accounts\V1beta\Service\ShipmentType;
use Google\Shopping\Merchant\Accounts\V1beta\ShippingSettings;
use Google\Shopping\Merchant\Accounts\V1beta\Value;
use Google\Shopping\Type\Price;
/**
* This class demonstrates how to insert a ShippingSettings for a Merchant Center account.
*/
class InsertShippingSettings
{
/**
* A helper function to create the parent string.
*
* @param string $accountId The account ID.
* @return string The parent in the format "accounts/{accountId}".
*/
private static function getParent(string $accountId): string
{
return sprintf("accounts/%s", $accountId);
}
/**
* Inserts shipping settings for the specified Merchant Center account.
*
* @param array $config The configuration data containing the account ID.
* @return void
*/
public static function insertShippingSettings($config)
{
// Gets the OAuth credentials to make the request.
$credentials = Authentication::useServiceAccountOrTokenFile();
// Creates options config containing credentials for the client to use.
$options = ['credentials' => $credentials];
// Creates a client.
$shippingSettingsServiceClient = new ShippingSettingsServiceClient($options);
// Creates parent to identify where to insert the shippingsettings.
$parent = self::getParent($config['accountId']);
// Calls the API and catches and prints any network failures/errors.
try {
$request = (new InsertShippingSettingsRequest())
->setParent($parent)
->setShippingSetting(
(new ShippingSettings())
// Etag needs to be an empty string on initial insert
// On future inserts, call GET first to get the Etag
// Then use the retrieved Etag on future inserts.
// NOTE THAT ON THE INITIAL INSERT, YOUR SHIPPING SETTINGS WILL
// NOT BE STORED, YOU HAVE TO CALL INSERT AGAIN WITH YOUR
// RETRIEVED ETAG.
->setEtag("")
->setServices([
(new Service())
->setServiceName("Canadian Postal Service")
->setActive(true)
->setDeliveryCountries(["CA"])
->setCurrencyCode("CAD")
->setDeliveryTime(
(new DeliveryTime())
->setMinTransitDays(0)
->setMaxTransitDays(3)
->setMinHandlingDays(0)
->setMaxHandlingDays(3)
)
->setRateGroups(
[(new RateGroup())
->setApplicableShippingLabels(["Oversized","Perishable"])
->setSingleValue((new Value())->setPricePercentage("5.4"))
->setName("Oversized and Perishable items")]
)
->setShipmentType(ShipmentType::DELIVERY)
->setMinimumOrderValue(
(new Price())
->setAmountMicros(10000000)
->setCurrencyCode("CAD")
)
])
);
print "Sending insert ShippingSettings request" . PHP_EOL;
$response = $shippingSettingsServiceClient->insertShippingSettings($request);
print "Inserted ShippingSettings below" . PHP_EOL;
print_r($response);
// You can apply ShippingSettings to specific products by using the `shippingLabel` field
// on the product.
} catch (ApiException $e) {
print $e->getMessage();
}
}
/**
* Helper to execute the sample.
*
* @return void
*/
public function callSample(): void
{
$config = Config::generateConfig();
// Makes the call to insert shipping settings for the MC account.
self::insertShippingSettings($config);
}
}
// Run the script
$sample = new InsertShippingSettings();
$sample->callSample();
Python
from examples.authentication import configuration
from examples.authentication import generate_user_credentials
from google.shopping.merchant_accounts_v1beta import DeliveryTime
from google.shopping.merchant_accounts_v1beta import InsertShippingSettingsRequest
from google.shopping.merchant_accounts_v1beta import RateGroup
from google.shopping.merchant_accounts_v1beta import Service
from google.shopping.merchant_accounts_v1beta import ShippingSettings
from google.shopping.merchant_accounts_v1beta import ShippingSettingsServiceClient
from google.shopping.merchant_accounts_v1beta import Value
_ACCOUNT = configuration.Configuration().read_merchant_info()
_PARENT = f"accounts/{_ACCOUNT}"
def insert_shipping_settings():
"""Inserts a ShippingSettings for a Merchant Center account."""
# Gets OAuth Credentials.
credentials = generate_user_credentials.main()
# Creates a client.
client = ShippingSettingsServiceClient(credentials=credentials)
# Creates the request.
request = InsertShippingSettingsRequest(
parent=_PARENT,
shipping_setting=ShippingSettings(
# Etag needs to be an empty string on initial insert
# On future inserts, call GET first to get the Etag
# Then use the retrieved Etag on future inserts.
# NOTE THAT ON THE INITIAL INSERT, YOUR SHIPPING SETTINGS WILL
# NOT BE STORED, YOU HAVE TO CALL INSERT AGAIN WITH YOUR
# RETRIEVED ETAG.
etag="",
services=[
Service(
service_name="Canadian Postal Service",
active=True,
delivery_countries=["CA"],
currency_code="CAD",
delivery_time=DeliveryTime(
min_transit_days=0,
max_transit_days=3,
min_handling_days=0,
max_handling_days=3,
),
rate_groups=[
RateGroup(
applicable_shipping_labels=[
"Oversized",
"Perishable",
],
single_value=Value(price_percentage="5.4"),
name="Oversized and Perishable items",
)
],
shipment_type=Service.ShipmentType.DELIVERY,
minimum_order_value={
"amount_micros": 10000000,
"currency_code": "CAD",
},
)
],
),
)
# Makes the request and prints the inserted ShippingSettings name.
try:
response = client.insert_shipping_settings(request=request)
print("Inserted ShippingSettings below")
print(response)
# You can apply ShippingSettings to specific products by using the
# `shippingLabel` field on the product.
except RuntimeError as e:
print(e)
if __name__ == "__main__":
insert_shipping_settings()
배송 설정 가져오기
다음 요청은 판매자 센터 계정의 배송 설정을 가져오는 방법을 보여줍니다.
HTTP
GET https://merchantapi.googleapis.com/accounts/v1beta/accounts/{ACCOUNT_ID}/shippingSettings
cURL
curl \
'https://merchantapi.googleapis.com/accounts/v1beta/accounts/{ACCOUNT_ID}/shippingSettings' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
다음은 클라이언트 라이브러리를 사용하여 특정 계정의 배송 설정 정보를 가져오는 데 사용할 수 있는 샘플입니다.
자바
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest;
import com.google.shopping.merchant.accounts.v1beta.ShippingSettings;
import com.google.shopping.merchant.accounts.v1beta.ShippingSettingsName;
import com.google.shopping.merchant.accounts.v1beta.ShippingSettingsServiceClient;
import com.google.shopping.merchant.accounts.v1beta.ShippingSettingsServiceSettings;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;
/** This class demonstrates how to get the ShippingSettings for a given Merchant Center account. */
public class GetShippingSettingsSample {
public static void getShippingSettings(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.
ShippingSettingsServiceSettings shippingSettingsServiceSettings =
ShippingSettingsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credential))
.build();
// Creates ShippingSettings name to identify ShippingSettings.
String name =
ShippingSettingsName.newBuilder()
.setAccount(config.getAccountId().toString())
.build()
.toString();
// Calls the API and catches and prints any network failures/errors.
try (ShippingSettingsServiceClient shippingSettingsServiceClient =
ShippingSettingsServiceClient.create(shippingSettingsServiceSettings)) {
// The name has the format: accounts/{account}/shippingSettings
GetShippingSettingsRequest request =
GetShippingSettingsRequest.newBuilder().setName(name).build();
System.out.println("Sending Get ShippingSettings request:");
ShippingSettings response = shippingSettingsServiceClient.getShippingSettings(request);
System.out.println("Retrieved ShippingSettings below");
System.out.println(response);
} catch (Exception e) {
System.out.println(e);
}
}
public static void main(String[] args) throws Exception {
Config config = Config.load();
getShippingSettings(config);
}
}
PHP
use Google\ApiCore\ApiException;
use Google\Shopping\Merchant\Accounts\V1beta\Client\ShippingSettingsServiceClient;
use Google\Shopping\Merchant\Accounts\V1beta\GetShippingSettingsRequest;
/**
* This class demonstrates how to get the ShippingSettings for a given Merchant Center account.
*/
class GetShippingSettings
{
/**
* Retrieves the shipping settings for the specified Merchant Center account.
*
* @param array $config The configuration data containing the account ID.
* @return void
*/
public static function getShippingSettings($config)
{
// Gets the OAuth credentials to make the request.
$credentials = Authentication::useServiceAccountOrTokenFile();
// Creates options config containing credentials for the client to use.
$options = ['credentials' => $credentials];
// Creates a client.
$shippingSettingsServiceClient = new ShippingSettingsServiceClient($options);
// Creates ShippingSettings name to identify ShippingSettings.
// The name has the format: accounts/{account}/shippingSettings
$name = "accounts/" . $config['accountId'] . "/shippingSettings";
// Calls the API and catches and prints any network failures/errors.
try {
$request = (new GetShippingSettingsRequest())
->setName($name);
print "Sending Get ShippingSettings request:" . PHP_EOL;
$response = $shippingSettingsServiceClient->getShippingSettings($request);
print "Retrieved ShippingSettings below" . PHP_EOL;
print_r($response);
} catch (ApiException $e) {
print $e->getMessage();
}
}
/**
* Helper to execute the sample.
*
* @return void
*/
public function callSample(): void
{
$config = Config::generateConfig();
// Makes the call to get shipping settings for the MC account.
self::getShippingSettings($config);
}
}
// Run the script
$sample = new GetShippingSettings();
$sample->callSample();
Python
from examples.authentication import configuration
from examples.authentication import generate_user_credentials
from google.shopping.merchant_accounts_v1beta import GetShippingSettingsRequest
from google.shopping.merchant_accounts_v1beta import ShippingSettingsServiceClient
_ACCOUNT = configuration.Configuration().read_merchant_info()
_PARENT = f"accounts/{_ACCOUNT}"
def get_shipping_settings():
"""Gets the ShippingSettings for a given Merchant Center account."""
# Gets OAuth Credentials.
credentials = generate_user_credentials.main()
# Creates a client.
client = ShippingSettingsServiceClient(credentials=credentials)
# Creates the Shipping Settings name
name = _PARENT + "/shippingSettings"
# Creates the request.
request = GetShippingSettingsRequest(name=name)
# Makes the request and prints the retrieved ShippingSettings.
try:
response = client.get_shipping_settings(request=request)
print("Retrieved ShippingSettings below")
print(response)
except RuntimeError as e:
print(e)
if __name__ == "__main__":
get_shipping_settings()
창고 설정 추가
계정의 인벤토리를 저장하고 처리하는 창고 설정을 추가하거나 업데이트하려면 accounts.shippingSettings.insert
메서드를 사용합니다.
Merchant API를 사용하여 창고를 관리하는 방법은 다음과 같습니다.
기존
shippingsettings
및warehouses
을 모두 검색하려면accounts.shippingSettings.getShippingSettings
메서드를 사용하여GET
요청을 수행합니다.account.shippingSettings.insert
메서드를 사용하여 요청을 만듭니다.GET
요청의 응답에서shippingsettings
리소스를 삽입 요청에 복사합니다.삽입 호출을 사용하여 창고에 관한 정보를 추가하려면 요청 본문의
warehouses
리소스에 창고에 관한 세부정보를 입력합니다.삽입 요청을 실행합니다.
다음 샘플 요청은 accounts.shippingSettings.insert
메서드를 사용하여 계정의 창고 설정을 업데이트하는 방법을 보여줍니다. 이 요청은 주문이 수락되고 처리, 주문 상품 준비 일수, 배송지 주소가 시작될 수 있는 시간을 설정합니다.
POST https://merchantapi.googleapis.com/accounts/v1beta/accounts/ACCOUNT_ID/shippingSettings:insert
{
"etag": "",
"name": "accounts/ACCOUNT_ID/shippingSetting",
"warehouses": [
{
"cutoffTime": {
"hour": 7,
"minute": 50
},
"handlingDays": 7,
"name": "WAREHOUSE_NAME",
"shippingAddress": {
"streetAddress": "ADDRESS",
"administrativeArea": "CA",
"city": "CITY_NAME",
"postalCode": "POSTAL_CODE",
"regionCode": "REGION_CODE"
}
}
]
}
다음을 바꿉니다.
- ACCOUNT_ID: 판매자 센터 계정의 고유 식별자입니다.
- WAREHOUSE_NAME: 창고의 이름입니다.
- ADDRESS: 창고의 배송지 주소입니다.
- CITY_NAME: 시, 읍, 면 종속된 지역 또는 하위 지역도 포함될 수 있습니다. 예를 들어 인근 지역 또는 교외 지역입니다.
- POSTAL_CODE: 우편번호 또는 ZIP 코드입니다. 예: 94043
- REGION_CODE: CLDR 국가 코드입니다. 예: 'US'
다음은 성공적인 호출의 샘플 응답입니다.
{
"name": "accounts/ACCOUNT_ID/shippingSettings",
"warehouses": [
{
"name": "WAREHOUSE_NAME",
"shippingAddress": {
"streetAddress": "ADDRESS",
"city": "CITY_NAME",
"administrativeArea": "CA",
"postalCode": "POSTAL_CODE",
"regionCode": "REGION_CODE"
},
"cutoffTime": {
"hour": 7,
"minute": 50
},
"handlingDays": "7",
"businessDayConfig": {
"businessDays": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY"
]
}
}
],
"etag": "OAJiUAjB0au+FBABGgR0ZXN0Ii4KAlVTGgJDQSoKQ2FsaWZvcm5pYWIFOTQwNDNyETExMXcgMzFzdCBTdHJlZXQuKgQIBxAyMAc4ATgCOAM4BDgF"
}
우편번호 그룹 설정
계정 하위 API를 사용하여 판매자 센터 계정의 지역(postalCodeGroups)을 관리합니다.
postalCodeGroups 리소스는 그룹화 목록이며 각 그룹화는 동일한 배송 설정을 공유하는 여러 우편번호 목록입니다.
판매자 API를 사용하여 다음과 같이 postalCodeGroups를 관리합니다.
get을 호출하여 모든 shippingsettings 및 postalCodeGroups를 가져옵니다.
get 호출에서 update 호출로 shippingsettings를 복사합니다.
배송 서비스에서 배송 기간 라벨을 사용하지 않는 경우 요청 본문에서 다음 항목을 삭제합니다.
"transitTimeLabels": [ "all other labels" ],
update 호출의 postalCodeGroups 섹션에 사용할 지역을 입력합니다.
shippingsettings 및 postalCodeGroups 리소스를 사용하여 update 호출을 합니다.
당일 배송 추가
오프라인 판매점 인벤토리가 있는 경우 Merchant API를 사용하여 당일 배송 서비스를 구성할 수 있습니다. 오프라인 제품에 오프라인 매장 정보 추가(addlocalinventory)를 참고하세요.
당일 배송 서비스의 shipmentType은 local_delivery입니다.
다음과 같은 주의사항이 적용됩니다.
- 모든 local_delivery 배송 서비스는 당일 배송으로 간주됩니다.
- 오프라인 배송의 deliveryTime 정보는 변경할 수 없습니다.
오프라인 인벤토리 제품에 당일 배송을 설정하려면 accounts.shippingSettings.insert
메서드를 사용하세요.
다음은 배송 유형, storeConfig
(제품이 배송되는 매장 목록), 요금 그룹을 설정하는 요청의 예입니다.
POST https://merchantapi.googleapis.com/accounts/v1beta/accounts/{ACCOUNT_ID}/shippingSettings:insert
{
"etag": "",
"name": "accounts/ACCOUNT_ID/shippingSetting",
"services": [
{
"deliveryCountries": [
"COUNTRY_CODE"
],
"serviceName": "SERVICE_NAME",
"active": false,
"currencyCode": "CURRENCY_CODE",
"shipmentType": "SHIPMENT_TYPE",
"storeConfig": {
"cutoffConfig": {
"localCutoffTime": {
"hour": 7,
"minute": 40
}
},
"serviceRadius": {
"unit": "KILOMETERS",
"value": 40
},
"storeCodes": [],
"storeServiceType": "ALL_STORES"
},
"rateGroups": [
{
"applicableShippingLabels": [
"SHIPPING_LABEL"
],
"singleValue": {
"flatRate": {
"amountMicros": PRICE,
"currencyCode": "CURRENCY_CODE"
}
}
}
]
}
]
}
다음을 바꿉니다.
- SHIPMENT_TYPE: 이 서비스에서 주문을 배송하는 위치 유형입니다. 여기에는 다음이 포함됩니다.
SHIPMENT_TYPE_UNSPECIFIED
DELIVERY
LOCAL_DELIVERY
COLLECTION_POINT
- SHIPPING_LABEL: 이 요금 그룹이 적용되는 제품을 정의하는 배송 라벨 목록입니다.
다음은 성공적인 호출의 샘플 응답입니다.
{
"name": "accounts/ACCOUNT_ID/shippingSettings",
"services": [
{
"serviceName": "SERVICE_NAME",
"active": false,
"deliveryCountries": [
"COUNTRY_CODE"
],
"currencyCode": "CURRENCY_CODE",
"rateGroups": [
{
"applicableShippingLabels": [
"SHIPPING_LABEL"
],
"singleValue": {
"flatRate": {
"amountMicros": "PRICE",
"currencyCode": "CURRENCY_CODE"
}
}
}
],
"shipmentType": "SHIPMENT_TYPE",
"storeConfig": {
"storeServiceType": "ALL_STORES",
"cutoffConfig": {
"localCutoffTime": {
"hour": "7",
"minute": "40"
},
"noDeliveryPostCutoff": false
},
"serviceRadius": {
"value": "40",
"unit": "KILOMETERS"
}
}
}
],
"etag": "OAJCTQgBEAAaRwoEdGVzdBIEIgJVUxoDVVNEIggiBggHECgoACoeCAESDwoNCAESCU9WRVJTSVpFRBoJIgcIAhCAwtcvWAWSAQCaAQQIAhAo"
}
익일 배송 추가
당일 배송 마감 시간 이후에 접수된 주문은 기본적으로 다음날 배송으로 예약됩니다.
다음날 배송을 사용 중지하려면 no_delivery_post_cutoff를 true로 설정합니다.
다음날 배송을 사용 중지하면 매일 주문 마감 시간 전에만 배송 서비스가 표시됩니다.
다음날 배송은 shipmentType이 local_delivery인 경우에만 사용할 수 있습니다.
반품 정책 추가
쇼핑 광고 또는 무료 등록정보를 통해 제품을 등록하는 경우 returnpolicyonline을 사용하여 다음 속성으로 온라인 반품 정책을 생성, 조회, 수정 또는 삭제할 수 있습니다.
- 대상 국가: 쇼핑 광고 및 무료 등록정보의 반품 정책 설정을 참고하세요.
- 재입고 수수료
- 반환 방법
- 반품 상품 상태
- 반품 사유 카테고리
- 반품 정책 URL: 쇼핑 광고 및 무료 등록정보의 반품 정책 설정을 참고하세요.
쇼핑 광고 또는 무료 등록정보를 통해 판매되는 제품에는 반품 주소가 필요하지 않습니다.
자세한 내용은 쇼핑 광고 및 자연 등록정보의 반품 정책 설정을 참고하세요.
returnpolicyonline.create를 사용하여 반품 정책을 추가할 수 있습니다. 응답에는 업데이트된 정책이 포함됩니다.
POST https://merchantapi.googleapis.com/v1beta/{ACCOUNT_ID}/returnpolicyonline