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 präziser sein möchten, können Sie Steuern und Versand über den Dienst products auf Artikelebene angeben.

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

Das Attribut tax und damit die Nutzung des Kontosteuerdiensts gelten nur für Produkte, die auf die USA ausgerichtet sind.

Die Content API-Dienste für Accounttax und Versandeinstellungen entsprechen den Funktionen der Merchant Center-Benutzeroberfläche.

Einfaches Beispiel

Für Versandkosten in Höhe von 8 € in Frankreich und basierend auf vom Transportunternehmen berechneten Preisen in den USA, bei denen die Lieferung eines Versandservice innerhalb von 3–7 Tagen in Anspruch nimmt:

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 und Dienste von Transportunternehmen abzurufen.

Komplexes Beispiel

Wenn Sie ein Angebot für kostenlosen Versand in den Bundesstaaten von New York erstellen möchten, ohne Versandkosten zu berechnen, UPS für den Rest der USA zu nutzen und für jeden US-Bundesstaat eine andere Steuer anzuwenden, verwenden Sie Anfragen an die Dienste accounttax und shippingsettings der Content API. Gehen Sie dazu so vor: Konfigurieren Sie zunächst 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 Verwaltungsgebiete dargestellt werden.

Konfigurieren Sie als Nächstes die Steuersätze:

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

Komplexe Versandregeln: zweidimensionale Tabellen und untergeordnete Tabellen

Um ein Versandangebot von 7 € in den USA, 3 € oder 5 € für Bestellungen mit einem Gewicht von mehr als 5 kg in NYC (je nach Bestellwert) und einem kostenlosen Angebot unter diesem Gewicht festzulegen, 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 und Dienstleistungen aufteilen

In den Versandeinstellungen darf jeder Versandservice maximal 20 Versandpreisgruppen enthalten. Da Versandpreisgruppen zur Unterscheidung von Versandkosten anhand von Versandlabels verwendet werden, deutet dies möglicherweise darauf hin, dass nur 20 unterschiedliche Versandkostenpauschalen über Versandlabels erzwungen werden können. Sie können jedoch bis zu 20 Versandservices pro Land angeben. Wenn Sie die Preise anhand von Versandlabels auf mehrere Services für dasselbe Land aufteilen, können Sie bis zu 400 unterschiedliche Versandkostenpauschalen anhand von Versandlabels unterscheiden.

Hinweis: Wenn du mehrere Services hast, wird jedes Produkt im jeweiligen Land mit allen Versandservices für dieses Land verglichen, um mögliche Versandkostenpauschalen 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 Preisen auf zwei verschiedene Services aufgeteilt. In diesem Beispiel werden andere Details der Versandressource, z. B. die tatsächlichen Preise, 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": [ ... ]
}

Die Aufteilung der Versandlabels auf Preisgruppen kann auch dann erforderlich sein, wenn für die Versandlabels dieselben Versandkosten gelten, da jede Preisgruppe nur 30 Versandlabels im Feld applicableShippingLabels haben kann. Wenn also 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 Versandservices pro Land.

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