gpt4 book ai didi

ups - 在一个请求中获取所有服务的费率

转载 作者:行者123 更新时间:2023-12-02 17:19:02 27 4
gpt4 key购买 nike

问题

是否可以在同一请求中获取所有可能的 ups 服务的费率?

背景

尽管 UPS 费率文档指出 service 元素是可选的 proof of optionality

定义了 service 元素的请求成功响应,而没有定义元素的请求会导致以下错误:

["Error"]=>
array(3) {
["ErrorSeverity"]=>
string(4) "Hard"
["ErrorCode"]=>
string(6) "111100"
["ErrorDescription"]=>
string(58) "The requested service is invalid from the selected origin."
}

此外,我见过的每个示例和库要么只希望为一种类型的服务创建请求,要么 creates a request for each service the user specifies they want to receive :

// optional, you can specify which rates to look for -- performs multiple requests, so be careful not to do too many

总结

有没有办法返回我遗漏的所有 UPS 服务的费率,或者我们必须向 UPS 查询我们希望获得费率的每项服务?

最佳答案

您应该能够通过将 /RateRequest/Request/RequestOption 设置为 Shop 并省略 /RateRequest/Shipment/Service 来接收多种服务的费率 元素。

这在 UPS 的 Rate Webservice 端点文档中有概述:

Can a customer compare services for a shipment using the Rating API?

Yes. Use the “Shop” value, instead of the “Rate” value, in the RequestOption element of the ../Request container to retrieve the rates for all services for the stated lane pair. The API response will return a rate for each of the available services. This is known as the Shop option.

关于ups - 在一个请求中获取所有服务的费率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44469242/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com