gpt4 book ai didi

python - UPS:每批货件需要单一计费选项

转载 作者:太空宇宙 更新时间:2023-11-04 10:46:17 29 4
gpt4 key购买 nike

我是 UPS api 的新手,我正在尝试向 UPS 调用 ShipmentConfirmRequest,这是我使用 python 发送到 wwwcie.ups.com/ups.app/xml/ShipConfirm 的 xml 格式。

<?xml version="1.0"?>
<AccessRequest xml:lang='en-US'>
<AccessLicenseNumber>NUMBER</AccessLicenseNumber>
<UserId>UUUUU</UserId>
<Password>PASSWORD</Password>
</AccessRequest>
<?xml version="1.0"?>
<ShipmentConfirmRequest>
<Request>
<TransactionReference>
<CustomerContext>00001</CustomerContext>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<RequestAction>ShipConfirm</RequestAction>
<RequestOption>nonvalidate</RequestOption>
</Request>

<Shipment>
<Description>00001</Description>
<!--InvoiceLineTotal>
<CurrencyCode>EUR</CurrencyCode>
<MonetaryValue>4887</MonetaryValue>
</InvoiceLineTotal-->
<Shipper>
<Name>HELICONIA</Name>
<AttentionName>HELICONIA</AttentionName>
<Address>
<AddressLine1></AddressLine1>
<AddressLine2></AddressLine2>
<AddressLine3></AddressLine3>
<City></City>
<StateProvinceCode></StateProvinceCode>
<CountryCode></CountryCode>
<PostalCode></PostalCode>
</Address>
<PhoneNumber></PhoneNumber>
<ShipperNumber>NUMBER</ShipperNumber>
<TaxIdentificationNumber></TaxIdentificationNumber>
<FaxNumber></FaxNumber>
<EMailAddress></EMailAddress>
</Shipper>
<ShipTo>
<CompanyName>Agriiolait</CompanyName>
<AttentionName></AttentionName>
<Address>
<AddressLine1>Agriiolait</AddressLine1>
<AddressLine2>69 rue de Chimay</AddressLine2>
<AddressLine3></AddressLine3>
<City>Wavre</City>
<StateProvinceCode></StateProvinceCode>
<CountryCode>BE</CountryCode>
<PostalCode></PostalCode>

</Address>
<PhoneNumber>+32 10 588 558</PhoneNumber>
<FaxNumber></FaxNumber>
<EMailAddress>info@agroiilait.com</EMailAddress>
<TaxIdentificationNumber></TaxIdentificationNumber>
<LocationID></LocationID>
</ShipTo>
<Service>
<Code>14</Code>
<Description>Next Day Air</Description>
</Service>
</Shipment>

<PaymentInformation>
<Prepaid>
<BillShipper>
<AccountNumber>25AC57</AccountNumber>
</BillShipper>
</Prepaid>
</PaymentInformation>

<Package>
<Description></Description>
<PackagingType>
<Code>01</Code>
<Description>UPS Letter</Description>
</PackagingType>
<Dimensions>
<UnitOfMeasurement>
<Code>IN</Code>
<Description>Inches</Description>
</UnitOfMeasurement>
<Length>11.0</Length>
<Width>110.0</Width>
<Height>11.0</Height>
</Dimensions>
<PackageWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
<Description>Pounds</Description>
</UnitOfMeasurement>
<Weight>11.0</Weight>
</PackageWeight>
<ReferenceNumber>
<Code>01</Code>
<Value></Value>
</ReferenceNumber>
<ReferenceNumber>
<Code>02</Code>
<Value></Value>
</ReferenceNumber>
<PackageServiceOptions>
<InsuredValue>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>975.0</MonetaryValue>
</InsuredValue>
</PackageServiceOptions>
</Package>


<LabelSpecification>
<LabelPrintMethod>
<Code>GIF</Code>
<Description>GIF</Description>
</LabelPrintMethod>
<HTTPUserAgent></HTTPUserAgent>
<LabelImageFormat>
<Code>GIF</Code>
</LabelImageFormat>
<LabelStockSize>
<Height>8</Height>
<Width>8</Width>
</LabelStockSize>
<LabelImageFormat>
<Code>GIF</Code>
<Description>GIF</Description>
</LabelImageFormat>
</LabelSpecification>
</ShipmentConfirmRequest>

但是我得到了不好的回应,比如

<ShipmentConfirmResponse>
<Response>
<TransactionReference>
<CustomerContext>00001</CustomerContext>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<ResponseStatusCode>0</ResponseStatusCode>
<ResponseStatusDescription>Failure</ResponseStatusDescription>
<Error>
<ErrorSeverity>Hard</ErrorSeverity>
<ErrorCode>120416</ErrorCode>
<ErrorDescription>A single billing option is required per shipment.
</ErrorDescription>
</Error>
</Response>
</ShipmentConfirmResponse>

谁能指导我如何摆脱它?

最佳答案

您缺少以下元素 /ShipmentRequest/Shipment/PaymentInformation/ShipmentCharge/Type 在您的发货请求中。此元素的值可以是 01 = Transportation02 = Duties and Taxes。如果您需要有关运费类型的更多信息,请参阅Shipping Package Web Service Developers Guide(2012 年 12 月 31 日) 第 67 页。

请注意,TypeShipmentCharge 元素只能有一个等于 01

最好!

关于python - UPS:每批货件需要单一计费选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17063314/

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