การตั้งค่าการจัดส่ง

shippingsettings ช่วยให้คุณเรียกและอัปเดตการตั้งค่าการจัดส่งของบัญชีหลายลูกค้า (MCA) และบัญชีย่อยทั้งหมดที่เชื่อมโยงกับบัญชีดังกล่าวได้

โดยปกติแล้ว MCA จะใช้โดยผู้ให้บริการผสานรวม ผู้รวบรวม และพาร์ทเนอร์ช่องทางที่ จัดการร้านค้าออนไลน์และบริการ API สำหรับผู้ขายหลายราย ผู้ขายที่มี ร้านค้าออนไลน์หรือแบรนด์หลายรายการซึ่งขายในเว็บไซต์แยกกันอาจเลือกมี บัญชีย่อยภายใต้ MCA เดียวได้เช่นกัน

Google สามารถอัปเดตเวลานำส่งโดยประมาณสำหรับผลิตภัณฑ์บางรายการได้โดยอัตโนมัติ ดูรายละเอียดเพิ่มเติมได้ที่เปิดใช้การปรับปรุงอัตโนมัติ

shippingsettings.list

shippingsettings.list การเรียกจะแสดงข้อมูลทรัพยากรการจัดส่งทั้งหมดของ บัญชีหรือบัญชีย่อยทั้งหมดหากเป็นบัญชี MCA

ตัวอย่าง URL สำหรับเมธอด shippingsettings.list

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

ต่อไปนี้คือตัวอย่างการตอบกลับ JSON ที่แสดงการตั้งค่าการจัดส่งสำหรับ บัญชีย่อย 1111 และ 2222 ของบัญชี MCA

{
 "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 ช่วยให้บัญชี MCA อัปเดตข้อมูลการตั้งค่าการจัดส่งสำหรับบัญชีย่อยเดียวหรือบัญชีแบบสแตนด์อโลนได้

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

ต่อไปนี้คือตัวอย่างเนื้อหาคำขอ JSON เพื่ออัปเดต maxTransitTimeInDays to 7 สำหรับบริการจัดส่ง GSA Shipping - Free Ship Over $49.99 สำหรับ บัญชีย่อยที่มีรหัสบัญชี 2222 ภายในรหัสผู้ขาย MCA ของ 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 ตัวอย่างต่อไปนี้มี 2 ส่วน

  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 เพื่อดูแลบัญชีที่มีหลายภูมิภาคซึ่งมีการเปลี่ยนแปลงบ่อย

บริการการตั้งค่าการจัดส่ง ช่วยให้คุณตั้งค่า รับ และอัปเดตการตั้งค่าและภูมิภาคการจัดส่งได้ ใน API ภูมิภาคเรียกว่า postalCodeGroups

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

เช่นเดียวกับใน UI postalCodeGroups คือรายการรหัสไปรษณีย์ รหัสไปรษณีย์ ช่วง ตัวเลขขึ้นต้นของรหัสไปรษณีย์ หรือช่วงของตัวเลขขึ้นต้นอย่างง่าย

เนื่องจากระบบจะดึงและตั้งค่าภูมิภาคร่วมกับการตั้งค่าการจัดส่ง การpostalCodeGroupsผ่านแหล่งข้อมูลการตั้งค่าการจัดส่งที่มีอยู่เท่านั้นที่จะลบบริการจัดส่งได้

วิธีที่ถูกต้องในการตั้งค่าภูมิภาคผ่าน API มีดังนี้

  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 for 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() วิธีนี้ เนื่องจากเป็นวิธีเดียวที่เปลี่ยนแปลงค่าที่มีอยู่