2017-09-25 61 views
1

我使用UPS費率API(基於選項Shoptimeintransit的JSON)獲取供貨日期的可用交貨日期。多個裝運日期的UPS費率API問題

https://www.ups.com/upsdeveloperkit/downloadresource?loc=en_CA

在DeliveryTimeInformation,我設置皮卡信息。

{ 
    "Security": { 
    "UsernameToken": { 
     "Username": "xxxxxxx", 
     "Password": "xxxxxxx" 
    }, 
    "UPSServiceAccessToken": { 
     "AccessLicenseNumber": "xxxxxxxxxxx" 
    } 
    }, 
    "RateRequest": { 
    "Request": { 
     "RequestOption": "Shoptimeintransit", 
     "TransactionReference": { 
     "CustomerContext": "Your Customer Context" 
     } 
    }, 
    "CustomerClassification": { 
     "Code": "00" 
    }, 
    "PickupType": { 
     "Code": "06" 
    }, 
    "Shipment": { 
     "DeliveryTimeInformation": { 
     "PackageBillType": "07", 
     "Pickup": { 
      "Date": "20170925", 
      "Time": "1140" 
     } 
     }, 
     "Shipper": { 

     "ShipperNumber": "xxxxxxx", 
     "Address": { 
      "City": "Kansas City", 
      "StateProvinceCode": "MO", 
      "CountryCode": "US", 
      "PostalCode": "xxxx" 
     } 
     }, 
     "ShipTo": { 

     "Address": { 
      "City": "Redwood", 
      "StateProvinceCode": "CA", 
      "CountryCode": "US", 
      "PostalCode": "xxxx" 
     } 
     }, 
     "ShipFrom": { 

     "Address": { 
      "City": "Kansas City", 
      "StateProvinceCode": "MO", 
      "CountryCode": "US", 
      "PostalCode": "xxxx" 
     } 
     }, 
     "Package": { 
     "PackagingType": { 
      "Code": "02" 
     }, 
     "Dimensions": { 
      "UnitOfMeasurement": { 
      "Code": "IN" 
      }, 
      "Length": "5", 
      "Width": "4", 
      "Height": "3" 
     }, 
     "PackageWeight": { 
      "UnitOfMeasurement": { 
      "Code": "LBS" 
      }, 
      "Weight": "1" 
     } 
     }, 

     "NumOfPieces": "3", 
     "ShipmentRatingOptions": { 
     "NegotiatedRatesIndicator": "" 
     } 
    } 
    } 
} 

的問題是,我需要爲接下來的N發貨日期可用的交付日期,但API只需要一次裝運日期在DeliveryTimeInformation>拾取部分。

所以,一種可能性是調用API N次併合並結果,這似乎不是一個好主意。

任何人都知道任何相關API,用於將提取日期作爲列表並返回所有可能的交付日期,提供的數據的服務代碼。

回答

2

Docs狀態Max Allowed: 1DeliveryTimeInformation,所以沒有。

您可以通過客戶服務請求下一次API更新(每個月1月和7月),但您必須直到N請求爲止。

+0

謝謝,馬丁,我也這麼做了。我認爲他們應該爲日期範圍選項提供一些API。 –