Content API를 사용하면 shippingsettings 및 accounttax 서비스를 통해 계정 내 모든 제품에 적용되는 세금 및 배송을 지정할 수 있습니다. 더 정확하게 지정하려면 products 서비스를 통해 상품 수준에서 세금과 배송비를 지정하면 됩니다.
Google 정책 및 세금과 배송을 지정하는 전체 옵션에 대한 자세한 내용은 다음 고객센터 도움말을 참고하세요.
tax 속성 및 계정 세금 서비스 사용은 미국을 타겟팅하는 제품에만 적용됩니다.
accounttax 및 shippingsettings Content API 서비스는 판매자 센터 UI의 기능을 반영합니다.
간단한 예시
프랑스의 배송비가 8유로이고 각 배송 서비스의 배송 기간이 3~7일인 미국의 운송업체 요금을 기준으로 하는 경우:
PUT /content/v2.1/<merchant_id>/shippingsettings/<account_id>
{
  "accountId": <account_id>,
  "services": [
    {
      "name": "Livraison Prioritaire",
      "deliveryCountry": "FR",
      "currency": "EUR",
      "rateGroups": [
        {
          "singleValue": {
            "flatRate": { "currency": "EUR", "value": "8" }
          }
        }
      ],
      "active": true,
      "deliveryTime": { "minTransitTimeInDays": 3, "maxTransitTimeInDays": 7 }
    },
    {
      "name": "UPS in US",
      "deliveryCountry": "US",
      "currency": "USD"
      "rateGroups": [
        {
          "singleValue": { "carrierRateName": "ups" },
          "carrierRates": [
            {
              "name": "ups",
              "carrierName": "UPS",
              "carrierService": "Ground",
              "originPostalCode": "10011"
            }
          ]
        }
      ],
      "active": true,
      "deliveryTime": { "minTransitTimeInDays": 3, "maxTransitTimeInDays": 7 },
    }
  ]
}사용 가능한 운송업체 이름과 서비스를 가져오려면 getsupportedcarriers 메서드를 사용합니다.
복잡한 예
뉴욕 주변 주에서 배송비를 청구하지 않아 무료 배송 프로모션을 만들고, 미국 나머지 지역에는 UPS를 사용하고, 미국 주마다 다른 세금을 적용하려면 다음과 같이 Content API의 accounttax 및 shippingsettings 서비스에 대한 요청을 사용하세요. 먼저 배송 설정을 구성합니다.
PUT /content/v2.1/<merchant_id>/shippingsettings/<account_id>
{
  "accountId": <account_id>,
  "services": [
    {
      "name": "Eligible for free shipping",
      "deliveryCountry": "US",
      "rateGroups": [
        {
          "mainTable": {
            "rowHeaders": {
              "locations": [
                { "locationIds": ["21167"] }, // NY
                { "locationIds": ["21164", "21139"] }  // NJ, CT
              ]
            },
            "rows": [
              {
                "cells": [
                  {
                    "flatRate": { "currency": "USD", "value": "0" }
                  }
                ]
              },
              {
                "cells": [
                  {
                    "flatRate": { "currency": "USD", "value": "0" }
                  }
                ]
              }
            ]
          }
        }
      ],
      "active": true,
      "deliveryTime": { "minTransitTimeInDays": 3, "maxTransitTimeInDays": 7 },
      "currency": "USD"
    },
    {
      "name": "UPS in US",
      "deliveryCountry": "US",
      "rateGroups": [
        {
          "singleValue": { "carrierRateName": "UPS mainland" },
          "carrierRates": [
            {
              "name": "UPS mainland",
              "carrierName": "UPS",
              "carrierService": "Ground",
              "originPostalCode": "10011",  // currently only US, AU, and DE postal codes
              "percentageAdjustment": "1.05",
              "flatAdjustment": { "currency": "USD", "value": "0.75" }
            }
          ]
        }
      ],
      "active": true,
      "deliveryTime": { "minTransitTimeInDays": 3, "maxTransitTimeInDays": 7 },
      "currency": "USD"
    }
   ],
  "postalCodeGroups": [
    {
      "name": "More cities",  // An alternative using postal codes
      "country": "US",
      "postalCodeRanges": [
        { "postalCodeRangeBegin": "94041" },
        { "postalCodeRangeBegin": "94042" },
        { "postalCodeRangeBegin": "94043", "postalCodeRangeEnd": "94045" },
        { "postalCodeRangeBegin": "9405*" },
        { "postalCodeRangeBegin": "9406*", "postalCodeRangeEnd": "9408*" }
      ]
    }
  ]
}위치 ID를 사용하여 행정 구역을 나타낼 수 있습니다.
다음으로 세금 청구액을 구성합니다.
PUT /content/v2.1/<merchant_id>/accounttax/<account_id>
{
  "accountId": <account_id>,
  "rules": [
    {
      "country": "US",  // currently only US is supported, may be omitted
      "locationId": 21167,
      "useGlobalRate": true,
      "shippingTaxed": false
    },
    {
      "locationId": 21137,
      "useGlobalRate": false,
      "shippingTaxed": true,
      "ratePercent": "2.15"
    }
    // ...
  ]
}참고: 운송업체 요금은 독일, 미국, 오스트레일리아에서만 사용할 수 있습니다. 위치 그룹은 현재 미국과 오스트레일리아에서 지원됩니다.
복잡한 배송 규칙: 2차원 표 및 하위 표
미국에서 배송 프로모션을 7달러로 정의하고, 뉴욕시에서 주문 가격에 따라 10파운드를 초과하는 주문의 경우 3달러 또는 5달러, 그 미만의 중량의 경우 무료로 정의하려면 다음을 사용하세요.
PUT /content/v2.1/<merchant_id>/shippingsettings/<account_id> { "accountId": <account_id>, "services": [ { "name": "Custom shipping rules", "deliveryCountry": "US", "rateGroups": [ { "mainTable": { "rowHeaders": { "postalCodeGroupNames": [ "NYC", "all other locations" ] }, "columnHeaders": { "weights": [ { "unit": "lb", "value": "10" }, { "unit": "lb", "value": "infinity" } ] }, "rows": [ { "cells": [ { "flatRate": { "value": "0", "currency": "USD" } }, { "subtableName": "NYC large packages" } ] }, { "cells": [ { "flatRate": { "value": "7", "currency": "USD" } }, { "flatRate": { "value": "7", "currency": "USD" } } ] } ] }, "subtables": [ { "name": "NYC large packages", "rowHeaders": { "prices": [ {"value": "100", "currency": "USD"}, {"value": "infinity", "currency": "USD"}] }, "rows": [ { "cells": [ { "flatRate": { "value": "3", "currency": "USD" } } ] }, { "cells": [ { "flatRate": { "value": "5", "currency": "USD" } } ] } ] } ] } ], "active": true, "currency": "USD", "deliveryTime": { "minTransitTimeInDays": 3, "maxTransitTimeInDays": 7 } } ], "postalCodeGroups": [ { "name": "NYC", // Approximation of NYC using postal codes "country": "US", "postalCodeRanges": [ { "postalCodeRangeBegin": "10000", postalCodeRangeEnd: "11999" } ] } ] }
복잡한 배송 규칙: 서비스 전반에 배송물 라벨 분할
shippingsettings에서 각 운송 서비스는 최대 20개의 운송 요금 그룹만 포함할 수 있습니다. 배송비 요율 그룹은 배송물 라벨을 통해 배송비 요율을 구분하는 데 사용되므로 배송물 라벨을 통해 고유한 배송비 요율을 20개만 적용할 수 있는 것으로 보일 수 있습니다. 하지만 국가당 최대 20개의 배송 서비스를 사용할 수 있습니다. 동일한 국가의 여러 서비스에 배송 라벨로 구분된 요율을 분할하면 배송 라벨을 통해 최대 400개의 고유한 배송비 요율을 구분할 수 있습니다.
참고: 서비스가 여러 개인 경우 특정 국가의 각 제품이 해당 국가의 모든 배송 서비스에 대해 검사되어 가능한 배송비가 계산됩니다. 여러 서비스에서 동일한 제품에 대해 다른 요율을 반환하는 경우 가장 낮은 요율이 사용됩니다.
아래 예에서는 서로 다른 두 서비스에서 고유한 요율을 사용하여 배송 라벨 40개를 분할합니다. 이 예에서는 실제 요금과 같은 배송 리소스의 다른 세부정보가 줄임표 뒤에 숨겨져 있습니다.
PUT /content/v2.1/<merchant_id>/shippingsettings/<account_id>
{
  "accountId": <account_id>,
  "services": [
    {
      "name": "labels_0_19",
      "deliveryCountry": "US",
      "active": true,
      "currency": "USD",
      "deliveryTime": { "minTransitTimeInDays": 3, "maxTransitTimeInDays": 7 }
      "rateGroups": [
        { "applicableShippingLabels": ["shipping_label_0"], ... }
        { "applicableShippingLabels": ["shipping_label_1"], ... }
        { "applicableShippingLabels": ["shipping_label_2"], ... }
        { "applicableShippingLabels": ["shipping_label_3"], ... }
        { "applicableShippingLabels": ["shipping_label_4"], ... }
        { "applicableShippingLabels": ["shipping_label_5"], ... }
        { "applicableShippingLabels": ["shipping_label_6"], ... }
        { "applicableShippingLabels": ["shipping_label_7"], ... }
        { "applicableShippingLabels": ["shipping_label_8"], ... }
        { "applicableShippingLabels": ["shipping_label_9"], ... }
        { "applicableShippingLabels": ["shipping_label_10"], ... }
        { "applicableShippingLabels": ["shipping_label_11"], ... }
        { "applicableShippingLabels": ["shipping_label_12"], ... }
        { "applicableShippingLabels": ["shipping_label_13"], ... }
        { "applicableShippingLabels": ["shipping_label_14"], ... }
        { "applicableShippingLabels": ["shipping_label_15"], ... }
        { "applicableShippingLabels": ["shipping_label_16"], ... }
        { "applicableShippingLabels": ["shipping_label_17"], ... }
        { "applicableShippingLabels": ["shipping_label_18"], ... }
        { "applicableShippingLabels": ["shipping_label_19"], ... }
      ]
    },
    {
      "name": "labels_20_39",
      "deliveryCountry": "US",
      "active": true,
      "currency": "USD",
      "deliveryTime": { "minTransitTimeInDays": 3, "maxTransitTimeInDays": 7 }
      "rateGroups": [
        { "applicableShippingLabels": ["shipping_label_20"], ... }
        { "applicableShippingLabels": ["shipping_label_21"], ... }
        { "applicableShippingLabels": ["shipping_label_22"], ... }
        { "applicableShippingLabels": ["shipping_label_23"], ... }
        { "applicableShippingLabels": ["shipping_label_24"], ... }
        { "applicableShippingLabels": ["shipping_label_25"], ... }
        { "applicableShippingLabels": ["shipping_label_26"], ... }
        { "applicableShippingLabels": ["shipping_label_27"], ... }
        { "applicableShippingLabels": ["shipping_label_28"], ... }
        { "applicableShippingLabels": ["shipping_label_29"], ... }
        { "applicableShippingLabels": ["shipping_label_30"], ... }
        { "applicableShippingLabels": ["shipping_label_31"], ... }
        { "applicableShippingLabels": ["shipping_label_32"], ... }
        { "applicableShippingLabels": ["shipping_label_33"], ... }
        { "applicableShippingLabels": ["shipping_label_34"], ... }
        { "applicableShippingLabels": ["shipping_label_35"], ... }
        { "applicableShippingLabels": ["shipping_label_36"], ... }
        { "applicableShippingLabels": ["shipping_label_37"], ... }
        { "applicableShippingLabels": ["shipping_label_38"], ... }
        { "applicableShippingLabels": ["shipping_label_39"], ... }
      ]
    }
  ],
  "postalCodeGroups": [ ... ]
}
  배송물 라벨이 동일한 배송 요금을 공유하더라도 요금 그룹별로 배송물 라벨을 분할해야 할 수도 있습니다. 각 요금 그룹에는 applicableShippingLabels 필드 내에 배송물 라벨이 30개만 있을 수 있기 때문입니다. 따라서 극단적인 예로 모든 배송물 라벨이 동일한 요금 구조를 공유하는 경우 shippingsettings는 단일 국가에 대해 최대 12,000개의 배송물 라벨을 처리할 수 있습니다. 요금 그룹당 30개의 배송물 라벨, 배송 서비스당 20개의 요금 그룹, 국가당 20개의 배송 서비스가 있기 때문입니다.
자세한 내용은 accounttax 및 shippingsettings 참조 문서를 참고하세요.