إعدادات الشحن

يتيح لك المورد shippingsettings استرداد إعدادات الشحن وتعديلها في حسابك متعدد العملاء (MCA) وجميع الحسابات الفرعية المرتبطة به.

يتمّ عادةً استخدام الحسابات المتعدّدة العملاء (MCA) من قِبل الشركات المدمَجة وخدمات التجميع وشركاء القنوات الذين يديرون متاجر على الإنترنت وخدمات واجهة برمجة التطبيقات لتجّار متعدّدين. قد يختار أيضًا التجّار الذين لديهم متاجر أو علامات تجارية متعددة على الإنترنت يتم بيعها على مواقع إلكترونية منفصلة أن يكون لديك حسابات فرعية ضمن حساب متعدّد العملاء (MCA) واحد.

يمكن أن تعدّل Google تلقائيًا الوقت المقدَّر للتسليم لبعض المنتجات. راجِع تفعيل التحسينات التلقائية للحصول على مزيد من التفاصيل.

shippingsettings.list

يؤدي الطلب shippingsettings.list إلى عرض كل معلومات مورد الشحن الخاصة بحساب أو كل الحسابات الفرعية في حال التعامل مع حساب متعدّد العملاء.

مثال على عنوان URL لطريقة shippingsettings.list:

GET https://shoppingcontent.googleapis.com/content/v2.1/merchantId/shippingsettings

في ما يلي نموذج لاستجابة JSON تعرض إعدادات الشحن للحسابَين الفرعيَين 1111 و2222 لحساب متعدّد العملاء:

{
 "kind": "content#shippingsettingsListResponse",
 "resources": [
  {
   "accountId": "1111",
   "services": [
    {
     "name": "Standard Shipping",
     "active": true,
     "deliveryCountry": "US",
     "currency": "USD",
     "deliveryTime": {
      "minHandlingTimeInDays": 0,
      "maxHandlingTimeInDays": 1,
      "transitTimeTable": {
       "postalCodeGroupNames": [
        "Region1",
        "Region2",
        "all other locations"
       ],
       "transitTimeLabels": [
        "all other labels"
       ],
       "rows": [
        {
         "values": [
          {
           "minTransitTimeInDays": 1,
           "maxTransitTimeInDays": 2
          }
         ]
        },
        {
         "values": [
          {
           "minTransitTimeInDays": 2,
           "maxTransitTimeInDays": 3
          }
         ]
        },
        {
         "values": [
          {
           "minTransitTimeInDays": 3,
           "maxTransitTimeInDays": 5
          }
         ]
        }
       ]
      }
     },
     "rateGroups": [
      {
       "singleValue": {
        "flatRate": {
         "value": "0",
         "currency": "USD"
        }
       },
       "name": "Standard Shipping"
      }
     ],
     "eligibility": "All scenarios"
    },
    {
     "name": "Expedited",
     "active": true,
     "deliveryCountry": "US",
     "currency": "USD",
     "deliveryTime": {
      "minTransitTimeInDays": 2,
      "maxTransitTimeInDays": 2,
      "minHandlingTimeInDays": 0,
      "maxHandlingTimeInDays": 1
     },
     "rateGroups": [
      {
       "singleValue": {
        "flatRate": {
         "value": "9.99",
         "currency": "USD"
        }
       },
       "name": "Expedited"
      }
     ],
     "eligibility": "All scenarios"
    }
   ],
   "postalCodeGroups": [
    {
     "name": "Region1",
     "country": "US",
     "postalCodeRanges": [
      {
       "postalCodeRangeBegin": "94035",
       "postalCodeRangeEnd": "94070"
      }
     ]
    },
    {
     "name": "Region2",
     "country": "US",
     "postalCodeRanges": [
      {
       "postalCodeRangeBegin": "94071",
       "postalCodeRangeEnd": "94082"
      }
     ]
    }
   ]
  },
  {
   "accountId": "2222",
   "services": [
    {
     "name": "FedEx",
     "active": true,
     "deliveryCountry": "US",
     "currency": "USD",
     "deliveryTime": {
      "minTransitTimeInDays": 4,
      "maxTransitTimeInDays": 6,
      "minHandlingTimeInDays": 0,
      "maxHandlingTimeInDays": 0
     },
     "rateGroups": [
      {
       "singleValue": {
        "flatRate": {
         "value": "5.99",
         "currency": "USD"
        }
       },
       "name": "All products"
      }
     ],
     "eligibility": "All scenarios except Shopping Actions"
    },
    {
     "name": "GSA Shipping - Free Ship Over $49.99",
     "active": true,
     "deliveryCountry": "US",
     "currency": "USD",
     "deliveryTime": {
      "minTransitTimeInDays": 3,
      "maxTransitTimeInDays": 7,
      "minHandlingTimeInDays": 1,
      "maxHandlingTimeInDays": 2
     },
     "rateGroups": [
      {
       "mainTable": {
        "rowHeaders": {
         "prices": [
          {
           "value": "49.99",
           "currency": "USD"
          },
          {
           "value": "infinity",
           "currency": "USD"
          }
         ]
        },
        "rows": [
         {
          "cells": [
           {
            "flatRate": {
             "value": "6.99",
             "currency": "USD"
            }
           }
          ]
         },
         {
          "cells": [
           {
            "flatRate": {
             "value": "0",
             "currency": "USD"
            }
           }
          ]
         }
        ]
       },
       "name": "Free Ship Over $49.99"
      }
     ],
     "eligibility": "Shopping Actions"
    }
   ]
  }
 ]
}

shippingsettings.get

من خلال طلب shippingsettings.get، يمكن لحساب MCA الحصول على معلومات إعدادات الشحن لحساب فرعي واحد أو لحساب مستقل للحصول على معلومات حالة الحساب الخاصة به.

استخدم الطلب التالي للحصول على معلومات إعدادات الشحن، حيث يشير merchantId إلى رقم حساب MCA وaccountId هو الحساب الفرعي. إذا لم يكن حساب Merchant Center متعدّد العملاء، سيظل بإمكان shippingsettings.get عرض معلومات إعدادات الشحن. في هذه الحالة، استخدِم رقم حساب Merchant Center نفسه للمعلَمتَين merchantId وaccountId.

GET https://shoppingcontent.googleapis.com/content/v2.1/merchantId/shippingsettings/accountId

في ما يلي نموذج لاستجابة JSON لحساب فرعي يتضمّن خدمة شحن Standard وExpedited تم ضبطها من حساب متعدّد العملاء (MCA) المستخدَم في طلب list:

{
 "accountId": "1111",
 "services": [
  {
   "name": "Standard Shipping",
   "active": true,
   "deliveryCountry": "US",
   "currency": "USD",
   "deliveryTime": {
    "minHandlingTimeInDays": 0,
    "maxHandlingTimeInDays": 1,
    "transitTimeTable": {
     "postalCodeGroupNames": [
      "Region1",
      "Region2",
      "all other locations"
     ],
     "transitTimeLabels": [
      "all other labels"
     ],
     "rows": [
      {
       "values": [
        {
         "minTransitTimeInDays": 1,
         "maxTransitTimeInDays": 2
        }
       ]
      },
      {
       "values": [
        {
         "minTransitTimeInDays": 2,
         "maxTransitTimeInDays": 3
        }
       ]
      },
      {
       "values": [
        {
         "minTransitTimeInDays": 3,
         "maxTransitTimeInDays": 5
        }
       ]
      }
     ]
    }
   },
   "rateGroups": [
    {
     "singleValue": {
      "flatRate": {
       "value": "0",
       "currency": "USD"
      }
     },
     "name": "Standard Shipping"
    }
   ],
   "eligibility": "All scenarios"
  },
  {
   "name": "Expedited",
   "active": true,
   "deliveryCountry": "US",
   "currency": "USD",
   "deliveryTime": {
    "minTransitTimeInDays": 2,
    "maxTransitTimeInDays": 2,
    "minHandlingTimeInDays": 0,
    "maxHandlingTimeInDays": 1
   },
   "rateGroups": [
    {
     "singleValue": {
      "flatRate": {
       "value": "9.99",
       "currency": "USD"
      }
     },
     "name": "Expedited"
    }
   ],
   "eligibility": "All scenarios"
  }
 ],
 "postalCodeGroups": [
  {
   "name": "Region1",
   "country": "US",
   "postalCodeRanges": [
    {
     "postalCodeRangeBegin": "94035",
     "postalCodeRangeEnd": "94070"
    }
   ]
  },
  {
   "name": "Region2",
   "country": "US",
   "postalCodeRanges": [
    {
     "postalCodeRangeBegin": "94071",
     "postalCodeRangeEnd": "94082"
    }
   ]
  }
 ]
}

shippingsettings.update

من خلال طلب shippingsettings.update، يمكن لحساب متعدّد العملاء تعديل معلومات إعدادات الشحن لحساب فرعي واحد أو حساب مستقل.

PUT https://shoppingcontent.googleapis.com/content/v2.1/merchantId/shippingsettings/accountId

في ما يلي نموذج لنص طلب JSON لتعديل maxTransitTimeInDays إلى 7 لخدمة الشحن GSA Shipping - Free Ship Over $49.99 للحساب الفرعي الذي يحمل رقم تعريف الحساب 2222 ضمن رقم تعريف التغيير المتعدد العملاء في 10.

{
...
    "services": [
      {
        "name": "FedEx",
        "active": true,
        "deliveryCountry": "US",
        "currency": "USD",
        "deliveryTime": {
          "minTransitTimeInDays": 4,
          "maxTransitTimeInDays": 6,
          "minHandlingTimeInDays": 0,
          "maxHandlingTimeInDays": 0
        },
        "rateGroups": [
          {
            "singleValue": {
              "flatRate": {
                "value": "5.99",
                "currency": "USD"
              }
            },
            "name": "All products"
          }
        ],
        "eligibility": "All scenarios except Shopping Actions"
      },
      {
        "name": "GSA Shipping - Free Ship Over $49.99",
        "active": true,
        "deliveryCountry": "US",
        "currency": "USD",
        "deliveryTime": {
          "minTransitTimeInDays": 3,
          "maxTransitTimeInDays": 7,
          "minHandlingTimeInDays": 1,
          "maxHandlingTimeInDays": 2
        },
        "rateGroups": [
          {
            "mainTable": {
              "rowHeaders": {
                "prices": [
                  {
                    "value": "49.99",
                    "currency": "USD"
                  },
                  {
                    "value": "infinity",
                    "currency": "USD"
                  }
                ]
              },
              "rows": [
                {
                  "cells": [
                    {
                      "flatRate": {
                        "value": "6.99",
                        "currency": "USD"
                      }
                    }
                  ]
                },
                {
                  "cells": [
                    {
                      "flatRate": {
                        "value": "0",
                        "currency": "USD"
                      }
                    }
                  ]
                }
              ]
            },
            "name": "Free Ship Over $49.99"
          }
        ],
        "eligibility": "Shopping Actions"
      }
    ]
  }
}

في ما يلي نموذج لنص استجابة JSON:

{
 "accountId": "2222",
 "services": [
  {
   "name": "FedEx",
   "active": true,
   "deliveryCountry": "US",
   "currency": "USD",
   "deliveryTime": {
    "minTransitTimeInDays": 4,
    "maxTransitTimeInDays": 6,
    "minHandlingTimeInDays": 0,
    "maxHandlingTimeInDays": 0
   },
   "rateGroups": [
    {
     "singleValue": {
      "flatRate": {
       "value": "5.99",
       "currency": "USD"
      }
     },
     "name": "All products"
    }
   ],
   "eligibility": "All scenarios except Shopping Actions"
  },
  {
   "name": "GSA Shipping - Free Ship Over $49.99",
   "active": true,
   "deliveryCountry": "US",
   "currency": "USD",
   "deliveryTime": {
    "minTransitTimeInDays": 3,
    "maxTransitTimeInDays": 7,
    "minHandlingTimeInDays": 1,
    "maxHandlingTimeInDays": 2
   },
   "rateGroups": [
    {
     "mainTable": {
      "rowHeaders": {
       "prices": [
        {
         "value": "49.99",
         "currency": "USD"
        },
        {
         "value": "infinity",
         "currency": "USD"
        }
       ]
      },
      "rows": [
       {
        "cells": [
         {
          "flatRate": {
           "value": "6.99",
           "currency": "USD"
          }
         }
        ]
       },
       {
        "cells": [
         {
          "flatRate": {
           "value": "0",
           "currency": "USD"
          }
         }
        ]
       }
      ]
     },
     "name": "Free Ship Over $49.99"
    }
   ],
   "eligibility": "Shopping Actions"
  }
 ]
}

shippingsettings.custombatch

يؤدي الاستدعاء shippingsettings.custombatch إلى استرداد معلومات إعدادات الشحن أو تعديلها لحسابات فرعية متعددة لحساب متعدّد العملاء.

يتضمّن طلب JSON merchantId الخاص برقم حساب MCA وaccountId للحساب الفرعي وbatchId فريد وmethod مضبوطة على get لاسترداد إعدادات الشحن وupdate لتعديل إعدادات الشحن.

POST https://shoppingcontent.googleapis.com/content/v2.1/shippingsettings/batch

يتكون نص طلب JSON التالي من جزأين:

  1. السمة batchId=1 المستخدَمة لاسترداد إعدادات الشحن للحساب الذي يحمل رقم التعريف 1111.
  2. تم استخدام batchId=2 لتعديل maxTransitTimeInDays إلى 8 لخدمة الشحن GSA Shipping - Free Ship Over $49.99. (تم تغيير هذا الإعداد من 7 لرقم تعريف الحساب 2222 المعروض في مثال نص الاستجابة السابق لـ shippingsettings.update).
{
  "entries": [
    {
      "accountId": 1111,
      "merchantId": 10,
      "method": "get",
      "batchId": 1
    },
    {
      "accountId": 2222,
      "merchantId": 10,
      "method": "update",
      "batchId": 2,
      "shippingSettings": {
        "services": [
          {
            "name": "FedEx",
            "active": true,
            "deliveryCountry": "US",
            "currency": "USD",
            "deliveryTime": {
              "minTransitTimeInDays": 4,
              "maxTransitTimeInDays": 5,
              "minHandlingTimeInDays": 0,
              "maxHandlingTimeInDays": 0
            },
            "rateGroups": [
              {
                "singleValue": {
                  "flatRate": {
                    "value": "5.99",
                    "currency": "USD"
                  }
                },
                "name": "All products"
              }
            ],
            "eligibility": "All scenarios except Shopping Actions"
          },
          {
            "name": "GSA Shipping - Free Ship Over $49.99",
            "active": true,
            "deliveryCountry": "US",
            "currency": "USD",
            "deliveryTime": {
              "minTransitTimeInDays": 3,
              "maxTransitTimeInDays": 8,
              "minHandlingTimeInDays": 1,
              "maxHandlingTimeInDays": 2
            },
            "rateGroups": [
              {
                "mainTable": {
                  "rowHeaders": {
                    "prices": [
                      {
                        "value": "49.99",
                        "currency": "USD"
                      },
                      {
                        "value": "infinity",
                        "currency": "USD"
                      }
                    ]
                  },
                  "rows": [
                    {
                      "cells": [
                        {
                          "flatRate": {
                            "value": "6.99",
                            "currency": "USD"
                          }
                        }
                      ]
                    },
                    {
                      "cells": [
                        {
                          "flatRate": {
                            "value": "0",
                            "currency": "USD"
                          }
                        }
                      ]
                    }
                  ]
                },
                "name": "Free Ship Over $49.99"
              }
            ],
            "eligibility": "Shopping Actions"
          }
        ]
      }
    }
  ]
}

في ما يلي نموذج لنص استجابة JSON:

{
 "kind": "content#shippingsettingsCustomBatchResponse",
 "entries": [
  {
   "kind": "content#shippingsettingsCustomBatchResponseEntry",
   "batchId": 1,
   "shippingSettings": {
    "accountId": "1111",
    "services": [
     {
      "name": "Standard Shipping",
      "active": true,
      "deliveryCountry": "US",
      "currency": "USD",
      "deliveryTime": {
       "minHandlingTimeInDays": 0,
       "maxHandlingTimeInDays": 1,
       "transitTimeTable": {
        "postalCodeGroupNames": [
         "Region1",
         "Region2",
         "all other locations"
        ],
        "transitTimeLabels": [
         "all other labels"
        ],
        "rows": [
         {
          "values": [
           {
            "minTransitTimeInDays": 1,
            "maxTransitTimeInDays": 2
           }
          ]
         },
         {
          "values": [
           {
            "minTransitTimeInDays": 2,
            "maxTransitTimeInDays": 3
           }
          ]
         },
         {
          "values": [
           {
            "minTransitTimeInDays": 3,
            "maxTransitTimeInDays": 5
           }
          ]
         }
        ]
       }
      },
      "rateGroups": [
       {
        "singleValue": {
         "flatRate": {
          "value": "0",
          "currency": "USD"
         }
        },
        "name": "Standard Shipping"
       }
      ],
      "eligibility": "All scenarios"
     },
     {
      "name": "Expedited",
      "active": true,
      "deliveryCountry": "US",
      "currency": "USD",
      "deliveryTime": {
       "minTransitTimeInDays": 2,
       "maxTransitTimeInDays": 2,
       "minHandlingTimeInDays": 0,
       "maxHandlingTimeInDays": 1
      },
      "rateGroups": [
       {
        "singleValue": {
         "flatRate": {
          "value": "9.99",
          "currency": "USD"
         }
        },
        "name": "Expedited"
       }
      ],
      "eligibility": "All scenarios"
     }
    ],
    "postalCodeGroups": [
     {
      "name": "Region1",
      "country": "US",
      "postalCodeRanges": [
       {
        "postalCodeRangeBegin": "94035",
        "postalCodeRangeEnd": "94070"
       }
      ]
     },
     {
      "name": "Region2",
      "country": "US",
      "postalCodeRanges": [
       {
        "postalCodeRangeBegin": "94071",
        "postalCodeRangeEnd": "94082"
       }
      ]
     }
    ]
   }
  },
  {
   "kind": "content#shippingsettingsCustomBatchResponseEntry",
   "batchId": 2,
   "shippingSettings": {
    "accountId": "2222",
    "services": [
     {
      "name": "FedEx",
      "active": true,
      "deliveryCountry": "US",
      "currency": "USD",
      "deliveryTime": {
       "minTransitTimeInDays": 4,
       "maxTransitTimeInDays": 5,
       "minHandlingTimeInDays": 0,
       "maxHandlingTimeInDays": 0
      },
      "rateGroups": [
       {
        "singleValue": {
         "flatRate": {
          "value": "5.99",
          "currency": "USD"
         }
        },
        "name": "All products"
       }
      ],
      "eligibility": "All scenarios except Shopping Actions"
     },
     {
      "name": "GSA Shipping - Free Ship Over $49.99",
      "active": true,
      "deliveryCountry": "US",
      "currency": "USD",
      "deliveryTime": {
       "minTransitTimeInDays": 3,
       "maxTransitTimeInDays": 8,
       "minHandlingTimeInDays": 1,
       "maxHandlingTimeInDays": 2
      },
      "rateGroups": [
       {
        "mainTable": {
         "rowHeaders": {
          "prices": [
           {
            "value": "49.99",
            "currency": "USD"
           },
           {
            "value": "infinity",
            "currency": "USD"
           }
          ]
         },
         "rows": [
          {
           "cells": [
            {
             "flatRate": {
              "value": "6.99",
              "currency": "USD"
             }
            }
           ]
          },
          {
           "cells": [
            {
             "flatRate": {
              "value": "0",
              "currency": "USD"
             }
            }
           ]
          }
         ]
        },
        "name": "Free Ship Over $49.99"
       }
      ],
      "eligibility": "Shopping Actions"
     }
    ]
   }
  }
 ]
}

shippingsettings.getsupportedcarriers

من خلال طلب shippingsettings.getsupportedcarriers، يمكن لحساب MCA أو لحساب مستقل الاستفادة من مشغّلي شبكات الجوّال المتوافقين.

GET https://shoppingcontent.googleapis.com/content/v2.1/merchantId/supportedCarriers

في ما يلي نموذج لنص استجابة JSON:

{
 "kind": "content#shippingsettingsGetSupportedCarriersResponse",
 "carriers": [
  {
   "name": "FedEx",
   "country": "US",
   "services": [
    "Ground",
    "Home Delivery",
    "Express Saver",
    "First Overnight",
    "Priority Overnight",
    "Standard Overnight",
    "2Day"
   ]
  },
  {
   "name": "UPS",
   "country": "US",
   "services": [
    "2nd Day Air",
    "2nd Day Air AM",
    "3 Day Select",
    "Ground",
    "Next Day Air",
    "Next Day Air Early AM",
    "Next Day Air Saver"
   ]
  },
  {
   "name": "USPS",
   "country": "US",
   "services": [
    "Priority Mail Express",
    "Media Mail",
    "Retail Ground",
    "Priority Mail",
    "First Class Package Service Retail",
    "First Class Package Service Commercial Base"
   ]
  },
  {
   "name": "Australia Post",
   "country": "AU",
   "services": [
    "Regular Parcel",
    "Express Post"
   ]
  },
  {
   "name": "TNT",
   "country": "AU",
   "services": [
    "Road Express",
    "Overnight Express"
   ]
  },
  {
   "name": "TOLL",
   "country": "AU",
   "services": [
    "Road Delivery",
    "Overnight Priority"
   ]
  },
  {
   "name": "DHL",
   "country": "DE",
   "services": [
    "Paket",
    "Päckchen"
   ]
  },
  {
   "name": "DPD",
   "country": "DE",
   "services": [
    "Express 12",
    "Express",
    "Classic Parcel"
   ]
  },
  {
   "name": "Hermes",
   "country": "DE",
   "services": [
    "Päckchen",
    "Paketklasse S",
    "Paketklasse M",
    "Paketklasse L"
   ]
  },
  {
   "name": "UPS",
   "country": "DE",
   "services": [
    "Express",
    "Express Saver",
    "Standard"
   ]
  },
  {
   "name": "DHL UK",
   "country": "GB",
   "services": [
    "Express",
    "Express 12"
   ]
  },
  {
   "name": "DPD UK",
   "country": "GB",
   "services": [
    "Express 12",
    "Express Next Day",
    "Standard Parcel 12",
    "Standard Parcel Next Day",
    "Standard Parcel Two Day"
   ]
  },
  {
   "name": "RMG",
   "country": "GB",
   "services": [
    "1st Class Small Parcel",
    "1st Class Medium Parcel",
    "2nd Class Small Parcel",
    "2nd Class Medium Parcel"
   ]
  },
  {
   "name": "TNT UK",
   "country": "GB",
   "services": [
    "Express",
    "Express 10",
    "Express 12"
   ]
  },
  {
   "name": "UPS UK",
   "country": "GB",
   "services": [
    "Express",
    "Express Saver",
    "Standard"
   ]
  },
  {
   "name": "Yodel",
   "country": "GB",
   "services": [
    "B2C 48HR",
    "B2C 72HR",
    "B2C Packet"
   ]
  }
 ]
}

shippingsettings.getsupportedholidays

من خلال طلب shippingsettings.getsupportedholidays، يمكن لحساب MCA أو حساب مستقل استرداد العطلات المتوافقة.

GET https://shoppingcontent.googleapis.com/content/v2.1/merchantId/supportedHolidays

في ما يلي نموذج لاستجابة JSON:

{
 "kind": "content#shippingsettingsGetSupportedHolidaysResponse",
 "holidays": [
  {
   "id": "FR_Christmas_2019-12-25",
   "countryCode": "FR",
   "type": "Christmas",
   "date": "2019-12-25",
   "deliveryGuaranteeDate": "2019-12-24",
   "deliveryGuaranteeHour": "18"
  },
  {
   "id": "US_Easter_2019-04-21",
   "countryCode": "US",
   "type": "Easter",
   "date": "2019-04-21",
   "deliveryGuaranteeDate": "2019-04-20",
   "deliveryGuaranteeHour": "18"
  },
  {
   "id": "US_Mother's Day_2019-05-12",
   "countryCode": "US",
   "type": "Mother's Day",
   "date": "2019-05-12",
   "deliveryGuaranteeDate": "2019-05-11",
   "deliveryGuaranteeHour": "18"
  },
  {
   "id": "US_Father's Day_2019-06-16",
   "countryCode": "US",
   "type": "Father's Day",
   "date": "2019-06-16",
   "deliveryGuaranteeDate": "2019-06-15",
   "deliveryGuaranteeHour": "18"
  },
  {
   "id": "US_Independence Day (USA)_2019-07-04",
   "countryCode": "US",
   "type": "Independence Day (USA)",
   "date": "2019-07-04",
   "deliveryGuaranteeDate": "2019-07-03",
   "deliveryGuaranteeHour": "18"
  },
  {
   "id": "US_Halloween_2019-10-31",
   "countryCode": "US",
   "type": "Halloween",
   "date": "2019-10-31",
   "deliveryGuaranteeDate": "2019-10-30",
   "deliveryGuaranteeHour": "18"
  },
  {
   "id": "US_Thanksgiving_2019-11-28",
   "countryCode": "US",
   "type": "Thanksgiving",
   "date": "2019-11-28",
   "deliveryGuaranteeDate": "2019-11-27",
   "deliveryGuaranteeHour": "18"
  },
  {
   "id": "US_Christmas_2019-12-25",
   "countryCode": "US",
   "type": "Christmas",
   "date": "2019-12-25",
   "deliveryGuaranteeDate": "2019-12-24",
   "deliveryGuaranteeHour": "18"
  }
 ]
}

ضبط مجموعات الرموز البريدية

مع أنّه من السهل إنشاء مناطق في Merchant Center، يمكنك استخدام Content API للحفاظ على الحسابات التي تتغير بشكل متكرّر في عدة مناطق.

تتيح لك خدمة "إعدادات الشحن" ضبط إعدادات الشحن والمناطق والحصول عليها وتعديلها. في واجهة برمجة التطبيقات، تُسمى المناطق postalCodeGroups

"postalCodeGroups": [
  {
    "name": "string,
    "country": string,
    "postalCodeRanges": [
      {
        "postalCodeRangeBegin": string,
        "postalCodeRangeEnd": string
      }
    ]
  }
]

كما في واجهة المستخدم، تمثّل السمة postalCodeGroups قائمة بسيطة بالرموز البريدية أو نطاقات الرموز البريدية أو بادئات الرموز البريدية أو نطاقات البادئات.

بما أنّه يتم استرداد المناطق وضبطها مع إعدادات الشحن، يؤدي ملء postalCodeGroups من خلال مورد إعدادات الشحن الحالي فقط إلى حذف خدمات الشحن.

الطريقة الصحيحة لإعداد المناطق من خلال واجهة برمجة التطبيقات هي كالتالي:

  1. يمكنك إجراء مكالمة على الرقم get لاسترداد كلّ خدمات الشحن وpostalCodeGroups (المناطق).
  2. انسخ خدمات الشحن من المكالمة على الرقم get إلى المكالمة على الرقم update.
  3. أزِل الإدخال التالي من نص الطلب إذا لم تكن تستخدم تصنيفات مدة النقل في خدمة الشحن:

    "transitTimeLabels": [
        "all other labels"
    ],
    
  4. املأ المناطق في القسم postalCodeGroups لاستدعاء update.

  5. أجرِ مكالمة update مع تعبئة كل من خدمات الشحن وأقسام postalCodeGroups.

في ما يلي نموذج لنص طلب استدعاء update من المثال get الأول المستخدَم أعلاه مع postalCodeGroups للمنطقة 1 التي تم تعديلها من 94035 إلى 94036:

{
  "services": [
    {
      "name": "Standard Shipping",
      "active": true,
      "deliveryCountry": "US",
      "currency": "USD",
      "deliveryTime": {
        "minHandlingTimeInDays": 0,
        "maxHandlingTimeInDays": 1,
        "transitTimeTable": {
          "postalCodeGroupNames": [
            "Region1",
            "Region2",
            "all other locations"
          ],
          "rows": [
            {
              "values": [
                {
                  "minTransitTimeInDays": 1,
                  "maxTransitTimeInDays": 2
                }
              ]
            },
            {
              "values": [
                {
                  "minTransitTimeInDays": 2,
                  "maxTransitTimeInDays": 3
                }
              ]
            },
            {
              "values": [
                {
                  "minTransitTimeInDays": 3,
                  "maxTransitTimeInDays": 5
                }
              ]
            }
          ]
        }
      },
      "rateGroups": [
        {
          "singleValue": {
            "flatRate": {
              "value": "0",
              "currency": "USD"
            }
          },
          "name": "Standard Shipping"
        }
      ],
      "eligibility": "All scenarios"
    },
    {
      "name": "Expedited",
      "active": true,
      "deliveryCountry": "US",
      "currency": "USD",
      "deliveryTime": {
        "minTransitTimeInDays": 2,
        "maxTransitTimeInDays": 2,
        "minHandlingTimeInDays": 0,
        "maxHandlingTimeInDays": 1
      },
      "rateGroups": [
        {
          "singleValue": {
            "flatRate": {
              "value": "9.99",
              "currency": "USD"
            }
          },
          "name": "Expedited"
        }
      ],
      "eligibility": "All scenarios"
    }
  ],
  "postalCodeGroups": [
    {
      "name": "Region1",
      "country": "US",
      "postalCodeRanges": [
        {
          "postalCodeRangeBegin": "94036",
          "postalCodeRangeEnd": "94070"
        }
      ]
    },
    {
      "name": "Region2",
      "country": "US",
      "postalCodeRanges": [
        {
          "postalCodeRangeBegin": "94071",
          "postalCodeRangeEnd": "94082"
        }
      ]
    }
  ]
}

في ما يلي نموذج لاستجابة JSON:

{
 "accountId": "1111",
 "services": [
  {
   "name": "Standard Shipping",
   "active": true,
   "deliveryCountry": "US",
   "currency": "USD",
   "deliveryTime": {
    "minHandlingTimeInDays": 0,
    "maxHandlingTimeInDays": 1,
    "transitTimeTable": {
     "postalCodeGroupNames": [
      "Region1",
      "Region2",
      "all other locations"
     ],
     "rows": [
      {
       "values": [
        {
         "minTransitTimeInDays": 1,
         "maxTransitTimeInDays": 2
        }
       ]
      },
      {
       "values": [
        {
         "minTransitTimeInDays": 2,
         "maxTransitTimeInDays": 3
        }
       ]
      },
      {
       "values": [
        {
         "minTransitTimeInDays": 3,
         "maxTransitTimeInDays": 5
        }
       ]
      }
     ]
    }
   },
   "rateGroups": [
    {
     "singleValue": {
      "flatRate": {
       "value": "0",
       "currency": "USD"
      }
     },
     "name": "Standard Shipping"
    }
   ],
   "eligibility": "All scenarios"
  },
  {
   "name": "Expedited",
   "active": true,
   "deliveryCountry": "US",
   "currency": "USD",
   "deliveryTime": {
    "minTransitTimeInDays": 2,
    "maxTransitTimeInDays": 2,
    "minHandlingTimeInDays": 0,
    "maxHandlingTimeInDays": 1
   },
   "rateGroups": [
    {
     "singleValue": {
      "flatRate": {
       "value": "9.99",
       "currency": "USD"
      }
     },
     "name": "Expedited"
    }
   ],
   "eligibility": "All scenarios"
  }
 ],
 "postalCodeGroups": [
  {
   "name": "Region1",
   "country": "US",
   "postalCodeRanges": [
    {
     "postalCodeRangeBegin": "94036",
     "postalCodeRangeEnd": "94070"
    }
   ]
  },
  {
   "name": "Region2",
   "country": "US",
   "postalCodeRanges": [
    {
     "postalCodeRangeBegin": "94071",
     "postalCodeRangeEnd": "94082"
    }
   ]
  }
 ]
}

استخدام نقاط استلام الطلب أو استلامه

لمزيد من المعلومات حول طلبات الاستلام أو نقاط الاستلام، بما في ذلك كيفية اختلافها عن طلبات التوصيل إلى المنزل والمعلومات الخاصة بالاستلام المطلوب معالجتها، يُرجى الاطّلاع على دليل نقاط الاستلام/نقاط الاستلام.

التسليم في اليوم نفسه

يمكنك استخدام Content API في Shopping لضبط خدمات الشحن للتوصيل في اليوم نفسه إذا كانت لديك مستودع محلي.

تتضمّن خدمات الشحن للتوصيل في اليوم نفسه local_delivery على أنّه shipmentType. وتُعتبر كل خدمات الشحن البالغ عددها local_delivery خدمة تسليم في اليوم نفسه. لا يمكنك تغيير معلومات deliveryTime المتعلقة بخدمات التوصيل المحلية.

استخدِم السمة shippingsettings.update لإعداد ميزة التوصيل في اليوم نفسه للمنتجات المتوفرة داخل المتجر.

إليك نموذج نص طلب يضيف خدمة التسليم في اليوم نفسه إلى جميع المتاجر في حسابك:

عدِّل جميع القيم في النموذج التالي قبل استخدامه في عملية التنفيذ.

{
   "accountId":"accountId",
   "services":[
      {
         "name": "Local Delivery",
         "active":true,
         "shipmentType":"local_delivery",
         "deliveryCountry":"US",
         "currency":"USD",
         "rateGroups":[
            {
               "singleValue":{
                  "flatRate":{
                     "value":"0",
                     "currency":"USD"
                  }
               }
            }
         ],
         "eligibility":"All scenarios",
         "storeConfig":{
            "storeServiceType":"all stores",
            "storeCodes":[
               
            ],
            "cutoffConfig":{
               "storeCloseOffsetHours":2,
               "no_delivery_post_cutoff":true
            },
            "serviceRadius":{
               "value":4,
               "unit":"Miles"
            }
         }
      }
   ]
}

التسليم في اليوم التالي

إنّ الطلبات التي يتم تقديمها بعد الموعد النهائي للتسليم في اليوم نفسه مُجدوَلة تلقائيًا للتسليم في اليوم التالي. لإيقاف التسليم في اليوم التالي، اضبط no_delivery_post_cutoff على true. إذا أوقفت خدمة التوصيل في اليوم التالي، لن تظهر خدمات الشحن إلا قبل الموعد النهائي لطلب المنتجات كل يوم.

تتوفّر خدمة التسليم في اليوم التالي فقط عندما تبلغ قيمة shipmentType في local_delivery.

الاختبار

بما أنّ جميع العناصر قيد الإنتاج، يجب توخي الحذر لتجنب تغيير أي شيء مهم في العناصر التي تكون نشطة، وخاصةً باستخدام طريقة update()، لأنّها هي العنصر الوحيد الذي يؤدي إلى تغيير القيم الحالية.