Steuern und Versand auf Kontoebene

Mit der Content API können Sie die Steuern und Versandkosten, die für alle Produkte innerhalb eines Kontos gelten, über die Dienste shippingsettings und accounttax angeben. Wenn Sie präzisere Angaben machen möchten, können Sie Steuern und Versandkosten auf Artikelebene über den Dienst products festlegen.

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

Beachten Sie, dass das Attribut tax und somit die Verwendung des Kontosteuerdienstes nur für Produkte gelten, die auf die USA ausgerichtet sind.

Die Content API-Dienste für Konto und Versand entsprechen den Funktionen der Merchant Center-UI.

Einfaches Beispiel

Für Versandgebühren in Höhe von 8 € in Frankreich und auf der Grundlage der vom Transportunternehmen berechneten Preise in den USA beträgt die Lieferungszeit jedes Versandservices drei bis sieben Tage:

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

Rufen Sie die verfügbaren Mobilfunkanbieter-Namen und -Dienste mit der Methode getsupportedcarriers ab.

Komplexes Beispiel

Wenn Sie ein Angebot für kostenlosen Versand in den Bundesstaaten rund um New York erstellen möchten (indem Sie keine Versandkosten berechnen), verwenden Sie UPS für den Rest der USA. Um für jeden US-Bundesstaat eine andere Steuer anzuwenden, verwenden Sie die Anfragen an die Dienste accounttax und shippingsettings der Content API. 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: Mit Standort-IDs können Sie Verwaltungsgebiete repräsentieren.

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: Transportunternehmen sind nur in Deutschland, Australien und den USA verfügbar. Standortgruppen werden derzeit nur in den USA und Australien unterstützt.

Komplexe Versandregeln: zweidimensionale Tabellen und untergeordnete Tabellen

Um einen Versandpreis von 7 $in den USA, 3 $ oder 5 $für Bestellungen mit einem Gewicht über 3 kg je nach Preis der Bestellung festzulegen und unter diesem Gewicht kostenlos zu verwenden, 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 über Dienste aufteilen

In den Versandeinstellungen kann jeder Versandservice maximal 20 Versandpreisgruppen enthalten. Da Versandpreisgruppen verwendet werden, um Versandkosten anhand von Versandlabels zu unterscheiden, kann es den Anschein haben, dass nur 20 eindeutige Versandkosten über Versandlabels erzwungen werden können. Sie können jedoch bis zu 20 Versandservices pro Land angeben. Durch die Aufteilung der Preise, die nach Versandlabeln gekennzeichnet sind, können Sie bis zu 400 eindeutige Versandkosten über Versandservices für dasselbe Land angeben.

Hinweis: Wenn Sie mehrere Dienstleistungen haben, wird jedes Produkt für ein bestimmtes Land mit allen Versandservices dieses Landes verglichen, 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 eindeutigen Preisen auf zwei verschiedene Dienste aufgeteilt. In diesem Beispiel werden die anderen Details der Versandressource, z. B. die tatsächlichen Preise, hinter Auslassungspunkten ausgeblendet.

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 der Versandlabels in Preisgruppen kann auch dann erforderlich sein, wenn die Versandlabels denselben Versandpreis haben, da jede Preisgruppe nur 30 Versandlabels im Feld applicableShippingLabels haben kann. Ein extremes Beispiel: Wenn alle Versandlabels dieselbe Preisstruktur haben, kann shippingsettings bis zu 12.000 Versandlabels für ein einzelnes Land verarbeiten: 30 Versandlabels pro Preisgruppe, 20 Preisgruppen pro Versandservice und 20 Versanddienste pro Land.

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