Steuern und Versand auf Kontoebene

Mit der Content API können Sie über die Dienste shippingsettings und accounttax Steuern und Versandkosten angeben, die für alle Produkte in einem Konto gelten. Wenn Sie genauere Angaben machen möchten, können Sie Steuern und Versandkosten auf Artikelebene über den products-Service angeben.

Informationen zu Google-Richtlinien und den verschiedenen Optionen zur Angabe von Steuern und Versand finden Sie in den folgenden Hilfeartikeln:

Das Attribut tax und damit die Verwendung des Dienstes „accounttax“ gilt nur für Produkte, die auf die USA ausgerichtet sind.

Die Content API-Dienste „accounttax“ und „shippingsettings“ spiegeln die Funktionen der Merchant Center-Benutzeroberfläche wider.

Einfaches Beispiel

Bei Versandkosten von 8 € in Frankreich und basierend auf den Tarifen von Transportunternehmen in den USA, wo die Lieferung jedes Versandservices 3–7 Tage dauert:

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 },
    }
  ]
}

Verwenden Sie die Methode getsupportedcarriers, um die verfügbaren Namen von Mobilfunkanbietern und Dienste abzurufen.

Komplexes Beispiel

Wenn Sie ein Angebot mit kostenlosem Versand in den Bundesstaaten rund um New York erstellen möchten (ohne Versandkosten zu berechnen), UPS für den Rest der USA verwenden und für jeden US-Bundesstaat eine andere Steuer anwenden möchten, verwenden Sie Anfragen an die Dienste accounttax und shippingsettings der Content API wie unten beschrieben. Konfigurieren Sie zuerst die Versandeinstellungen:

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*" }
      ]
    }
  ]
}

Hinweis: Standort-IDs können zur Darstellung von Verwaltungsgebieten verwendet werden.

Konfigurieren Sie als Nächstes die Steuergebühren:

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"
    }
    // ...
  ]
}

Hinweis: Vom Transportunternehmen berechnete Preise sind nur in den USA, Deutschland und Australien verfügbar. Standortgruppen werden derzeit in den USA und Australien unterstützt.

Komplexe Versandregeln: zweidimensionale Tabellen und untergeordnete Tabellen

Wenn Sie ein Versandangebot von 7 $in den USA, 3 $ oder 5 $für Bestellungen mit einem Gewicht von mehr als 4, 5 kg in New York City (je nach Bestellwert) und kostenlosen Versand für Bestellungen mit einem geringeren Gewicht definieren möchten, verwenden Sie Folgendes:

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" }
      ]
    }
  ]
}

Komplexe Versandregeln: Versandlabels auf mehrere Dienste aufteilen

In den Versandeinstellungen kann jeder Versandservice maximal 20 Versandkostengruppen enthalten. Da Versandkostengruppen verwendet werden, um Versandkosten über Versandlabels zu unterscheiden, könnte dies darauf hindeuten, dass nur 20 eindeutige Versandkosten über Versandlabels erzwungen werden können. Sie können jedoch bis zu 20 Versandservices pro Land haben. Wenn Sie Versandkostenpauschalen, die sich durch Versandlabels unterscheiden, auf mehrere Services für dasselbe Land aufteilen, können Sie bis zu 400 einzelne Versandkostenpauschalen über Versandlabels unterscheiden.

Hinweis:Wenn Sie mehrere Services haben, wird jedes Produkt für ein bestimmtes Land mit allen Versandservices für dieses Land abgeglichen, um mögliche Versandkosten zu berechnen. Wenn mehrere Dienste unterschiedliche Preise für dasselbe Produkt zurückgeben, wird der niedrigste Preis verwendet.

Im folgenden Beispiel werden 40 Versandlabels mit individuellen Raten auf zwei verschiedene Dienste aufgeteilt. In diesem Beispiel werden die anderen Details der Versandressource, z. B. die tatsächlichen Raten, hinter Auslassungspunkten verborgen.

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": [ ... ]
}

Diese Aufteilung von Versandlabels auf Raten-Gruppen kann auch dann erforderlich sein, wenn die Versandlabels denselben Versandpreis haben, da jede Raten-Gruppe nur 30 Versandlabels im Feld applicableShippingLabels haben kann. Ein extremes Beispiel: Wenn alle Versandlabels dieselbe Tarifstruktur haben, kann shippingsettings bis zu 12.000 Versandlabels für ein einzelnes Land verarbeiten: 30 Versandlabels pro Tarifgruppe, 20 Tarifgruppen pro Versandservice und 20 Versandservices pro Land.

Weitere Informationen finden Sie in der Referenzdokumentation zu accounttax und shippingsettings.