送料設定の概要

ShippingSettings リソースを使用すると、アカウントの配送設定を取得、更新できます。

一部の商品では、目安のお届け日数が自動的に更新されることがあります。 詳しくは、自動有効化を有効にする 改善されています

配送設定の読み取り、書き込み、更新

Merchant API の配送サービスを使用する手順は次のとおりです。

  1. すべての配送設定を取得するには、GET リクエストを行います。 あります。
  2. 配送設定を変更する。
  3. 配送設定を変更して INSERT リクエストを送信します。

etag

Etag は、非同期更新を避けるためにエンコードされたトークンです。ETag が変更されると、 送料設定のデータが変更されますユーザーは ETag をコピーして取得する必要があります。 GET リクエストから取得したデータを INSERT リクエスト本文に送信します。

GET リクエストから INSERT までの間に配送設定データが変更された場合 別の GET リクエストをリクエストするエラー メッセージが表示されます。 最新の ETag トークンを取得する必要がありますGET リクエストを呼び出す必要があります。 新しい etag トークンを取得し、新しい etag トークンを INSERT リクエストにコピーする できます。

配送設定を追加する

shippingsettings.insert を使用して、商品の配送設定を追加または あります。次のリクエストの例では、maxTransitDays を 7 に アカウントで「GSA Shipping - Free Ship Over $49.99」という配送サービス 10.

POST https://merchantapi.googleapis.com/accounts/v1beta/accounts/{accountId}/shippingSettings/

{
  "services": [
    {
      "name": "FedEx",
      "active": true,
      "deliveryCountries": ["US"],
      "currencyCode": "USD",
      "deliveryTime": {
        "minTransitDays": 4,
        "maxTransitDays": 6,
        "minHandlingDays": 0,
        "maxHandlingDays": 0
      },
      "rateGroups": [
        {
          "singleValue": {
            "flatRate": {
              "amountMicros": 5990000,
              "currencyCode": "USD"
            }
          },
          "name": "All products"
        }
      ]
    },
    {
      "name": "GSA Shipping - Free Ship Over $49.99",
      "active": true,
      "deliveryCountries": "US",
      "currencyCode": "USD",
      "deliveryTime": {
        "minTransitDays": 3,
        "maxTransitDays": 7,
        "minHandlingDays": 1,
        "maxHandlingDays": 2
      },
      "rateGroups": [
        {
          "mainTable": {
            "rowHeaders": {
              "prices": [
                {
                  "amountMicros": 49990000,
                  "currencyCode": "USD"
                },
                {
                  "amountMicros": -1,
                  "currencyCode": "USD"
                }
              ]
            },
            "rows": [
              {
                "cells": [
                  {
                    "flatRate": {
                      "amountMicros": 6990000,
                      "currencyCode": "USD"
                    }
                  }
                ]
              },
              {
                "cells": [
                  {
                    "flatRate": {
                      "amountMicros": 0,
                      "currencyCode": "USD"
                    }
                  }
                ]
              }
            ]
          },
          "name": "Free Ship Over $49.99"
        }
      ]
    }
  ]
}

ウェアハウスを設定する

次の JSON サンプルは、販売者の配送設定を使用する方法を示しています。 サービスを利用して、販売アカウントの倉庫情報を管理できます。

"warehouses": [
  {
    "name": "warehouse 1",
    "shippingAddress": {
      "streetAddress": {street_address},
      "city": {city},
      "administrativeArea": {administrative_area},
      "postalCode": {postal_code},
      "regionCode": {region_code}
    },
    "cutoffTime": {
      "minutes": {minutes}
    },
    "handlingDays": {handling_days},
    "businessDaysConfig": {
      "businessDays": [
        "MONDAY", "SUNDAY"
      ]
    }
  }
]

次のように置き換えます。

  • {street_address}: 倉庫の住所の番地。
  • {city}: 倉庫がある市、町、コミューン。
  • {administrative_area}: 行政区域 国によって異なります。(都道府県や州など)。
  • {postal_code}: 郵便番号。
  • {region_code}: 文字列の国コード。
  • {minutes}: 受付終了時間の分数。 その日のうちに倉庫で処理されるようにする必要があります。
  • {handling_days}: 所要時間 商品を梱包して発送します

warehouses リソースはウェアハウスのリストです。各ウェアハウスは 配送サービスの倉庫ベースのお届け日数で表します warehouse.name

ウェアハウスを管理する

Merchant API を使用して倉庫を管理する方法は次のとおりです。

  1. GET リクエストを作成して、既存の shippingsettings と 構築できます
  2. GET リクエストの shippingsettingsUPDATE リクエストにコピーします。

  3. warehouses セクションで使用する場合は、ウェアハウスにデータを入力します。 INSERT リクエスト。

  4. shippingsettingswarehouses を含む UPDATE リクエストを作成します。 説明します。

以下は、ウェアハウス 1 の倉庫を更新した INSERT リクエスト本文のサンプルです。 ニューヨーク発マウンテンビュー:

{
  "services": [
    {
      "name": "Standard Shipping",
      "active": true,
      "deliveryCountries": ["US", "UK"],
      "currencyCode": "USD",
      "deliveryTime": {
        "minHandlingDays": 0,
        "maxHandlingDays": 1,
        "warehouseBasedDeliveryTimes": [
{"carrier": "Fedex"
 "carrierService": "ground"
 "warehouse": "Warehouse 1"
},
{"carrier": "Fedex"
 "carrierService": "2 days"
 "warehouse": "Warehouse 2"
}
]
      },
      "rateGroups": [
        {
          "singleValue": {
            "flatRate": {
              "amountMicros": 0,
              "currencyCode": "USD"
            }
          },
          "name": "Standard Shipping"
        }
      ],
    },
    {
      "name": "Expedited",
            "flatRate": {
              "amountMicros": 9990000,
              "currencyCode": "USD"
            }
          },
          "name": "Expedited"
        }
      ],
    }
  ],
  "warehouses": [
    {
      "name": "Warehouse1",
      "shippingAddress": [
        {
        "streetAddress": "1111 shoreline street"
          "city": "Mountain View",
          "administrativeArea": "CA"
        }
      ]
    },
    {
      "name": "Warehouse 2",
      "country": "US",
      "postalCodeRanges": [
        {
        "streetAddress": "1111 5th avenue"
          "city": "New York",
          "administrativeArea": "NY"
        }
      ]
    }
  ]
}

当日配達を追加

Content API for Shopping を使用して当日配達の配送を設定できます ローカル在庫がある場合は当日配達サービスは shipment_type として local_delivery。すべての配送(local_delivery) サービスは、現時点では当日配達とみなされます。

ローカル配送の delivery_time 情報は変更できません。使用 shippingsettings.insert: ローカル在庫の当日配達を設定します プロダクトの

以下は、すべての店舗に当日配達サービスを追加するリクエスト本文の例です。 :

{
  "name": "accounts/accountId/shippingSettings",
  "services": [
    {
      "name": "Local Delivery",
      "active": true,
      "shipmentType": "local_delivery",
      "deliveryCountries": "US",
      "currencyCode": "USD",
      "rateGroups": [
        {
          "singleValue": {
            "flatRate": {
              "amountMicros": 0,
              "currencyCode": "USD"
            }
          }
        }
      ],
      "storeConfig": {
        "storeServiceType": "all stores",
        "storeCodes": [],
        "cutoffConfig": {
          "storeCloseOffsetHours": 2,
          "noDeliveryPostCutoff": true
        },
        "serviceRadius": {
          "value": 4,
          "unit": "Miles"
        }
      }
    }
  ]
}

翌日配達を追加

同日配達の受付終了時間を過ぎてから行われた注文は、次の時間にスケジュール設定されます デフォルトで設定されます。翌日配達を無効にするには、 no_delivery_post_cutoff フィールドを true に設定します。翌日配達をオフにした場合、 配送サービスは毎日、受付終了時間より前にのみ表示されます。

翌日配達は、shipment_typeの場合にのみ可能です。 local_delivery

その他の情報

Content API for Shopping からの移行について詳しくは、配送の移行に関する説明をご覧ください。 設定管理をご覧ください。