如何解决当我向 UPS 提出评级请求时,协商的费率不会被退回
我正在自定义 UPS 和 odoo 之间的集成。我需要能够使用他们的 API 运行来自 UPS 的费率请求和运输请求,并返回协商费率。我确认我的 UPS 帐户已启用协商费率。
我可以根据发货请求获得协商的费率。然而,费率请求返回公布的费率。有人可以帮忙找出问题所在吗?
费率请求:
End URL
https://onlinetools.ups.com/webservices/
Request Option
{ 'RequestOption': 'Shop','SubVersion': None,'TransactionReference': None }
Request
{ 'OriginRecordTransactionTimestamp': None,'Shipper':
{ 'Name': 'SELLER','ShipperNumber': 'XXXXXX','Address':
{ 'AddressLine': [ 'STREET' ],'City': '\u200bMataró','StateProvinceCode': None,'PostalCode': '08302','CountryCode': 'ES','TaxIdentificationNumber':
'ESB67488221','EMailAddress': 'info@seller.com'
}
},'ShipTo':
{ 'Name': 'CUSTOMER','Address':
{ 'AddressLine': [],'City': 'Lousada','PostalCode': '4620-101','CountryCode': 'PT','AddressLine1': 'Street','AddressLine2': '','AddressLine3': ''
}
},'ShipFrom':
{ 'Name': 'SELLER','Address':
{ 'AddressLine': [ 'STREET,' ],'CountryCode': 'ES' }
},'AlternateDeliveryAddress': None,'ShipmentIndicationType': [],'PaymentDetails': None,'FRSPaymentinformation': None,'FreightShipmentinformation': None,'GoodsnotinFreeCirculationIndicator': None,'Service': None,'NumOfPieces': 1,'ShipmentTotalWeight': None,'DocumentsOnlyIndicator': None,'Package':
[{ 'PackagingType':
{ 'Code': '02','Description': None
},'Dimensions':
{ 'UnitOfMeasurement':
{ 'Code': 'CM','Length': 175.0,'Width': 14.0,'Height': 14.0
},'DimWeight': None,'PackageWeight':
{ 'UnitOfMeasurement':
{ 'Code': 'KGS','Description': None
},'Weight': 7.05
},'commodity': None,'LargePackageIndicator': None,'PackageServiceOptions':
{ 'DeliveryConfirmation': None,'AccesspointCOD': None,'COD': None,'DeclaredValue':
{ 'CurrencyCode': 'EUR','MonetaryValue': 555.0
},'ShipperDeclaredValue':
{ 'CurrencyCode':
'EUR','MonetaryValue': 555.0
},'ProactiveIndicator': None,'Insurance': None,'VerbalConfirmationIndicator': None,'UPSPremiumCareIndicator': None,'HazMat': None,'DryIce': None },'AdditionalHandlingIndicator': None,'Description': ''
}],'ShipmentServiceOptions':
{ 'SaturdayPickupIndicator': None,'SaturdayDeliveryIndicator': None,'DeliverToAddresseeOnlyIndicator': None,'DirectDeliveryOnlyIndicator': None,'DeliveryConfirmation': None,'ReturnOfDocumentIndicator': None,'UPScarbonneutralIndicator': True,'CertificateOfOriginIndicator': None,'PickupOptions': None,'DeliveryOptions': None,'RestrictedArticles': None,'ShipperExportDeclarationIndicator': None,'CommercialInvoiceRemovalIndicator': None,'ImportControl': None,'ReturnService': None,'SDLShipmentIndicator': None,'EPRAIndicator': None
},'ShipmentratingOptions':
{ 'NegotiatedratesIndicator': 1,'FRSShipmentIndicator': None,'RateChartIndicator': None,'UserLeveldiscountIndicator': 1
},'InvoiceLinetotal': None,'ratingMethodRequestedindicator': None,'TaxinformationIndicator': None,'Promotionaldiscountinformation': None,'DeliveryTimeinformation': None
}
发货请求:
End URL
https://onlinetools.ups.com/webservices/
Request Option
{ 'RequestOption': 'nonvalidate','TransactionReference': None }
Request
{ 'Description': 'S02806','Shipper':
{ 'Name': 'Company','AttentionName': 'Company','CompanydisplayableName': None,'TaxIdentificationNumber': 'ESB67488221','TaxIDType': None,'Phone':
{ 'Number': '34922808092','Extension': None
},'Faxnumber': None,'EMailAddress': 'info@seller.com','Address':
{ 'AddressLine': [ 'STREET' ],'CountryCode': 'ES'
}
},'ShipTo':
{ 'Name': 'CUSTOMER','AttentionName': 'CUSTOMER','TaxIdentificationNumber': 'PTTAxnuMBER','Phone':
{ 'Number': '12345678','EMailAddress': 'customer@email.com','Address':
{ 'AddressLine': 'Street','ResidentialAddressIndicator': None,'AddressLine3': ''
},'LocationID': None
},'ShipFrom':
{ 'Name': 'SELLER','AttentionName': 'SELLER','TaxIdentificationNumber': 'ESTAxnuMBER','Phone':
{ 'Number': '123456789','CountryCode': 'ES'
},'EMailAddress': None
},'Paymentinformation':
{ 'ShipmentCharge':
[{ 'Type': '01','BillShipper':
{ 'AccountNumber': '7W865X','CreditCard': None,'AlternatePaymentMethod': None
},'BillReceiver': None,'BillThirdParty': None,'ConsigneeBilledindicator': None
}],'SplitDutyVATIndicator': None
},'TPFCNegotiatedratesIndicator': None,'UserLeveldiscountIndicator': None
},'MovementReferenceNumber': None,'ReferenceNumber': [],'Service':
{ 'Code': '11','Description': 'Service Code'
},'NumOfPiecesInShipment': None,'uspsEndorsement': None,'MILabelCN22Indicator': None,'SubClassification': None,'CostCenter': None,'PackageID': None,'IrregularIndicator': None,'MIDualReturnShipmentKey': None,'MIDualReturnShipmentIndicator': None,'ShipmentServiceOptions':
{ 'SaturdayDeliveryIndicator': None,'SaturdayPickupIndicator': None,'Notification': [],'LabelDelivery': None,'InternationalForms':
{ 'FormType': '01','UserCreatedForm': None,'CN22Form': None,'UPSPremiumCareForm': None,'AdditionalDocumentIndicator': None,'FormGroupIdName': None,'SEDFilingOption': None,'EEIFilingOption': None,'Contacts':
{ 'ForwardAgent': None,'UltimateConsignee': None,'IntermediateConsignee': None,'Producer': None,'SoldTo':
{ 'Name': 'Trofeuveloz Fabrica de Calcado','AttentionName': 'Trofeuveloz Fabrica de Calcado','TaxIdentificationNumber': 'PT513066004','Phone':
{ 'Number': '351255829143','Extension': None
},'Option': None,'Address':
{ 'AddressLine': 'Street','Town': None,'AddressLine3': ''
},'EMailAddress': None
}
},'Product':
{ 'Description': 'Textile','Unit':
{ 'Number': 10,'UnitOfMeasurement':
{ 'Code': 'M','Description': None
},'Value': 50.0
},'commodityCode': '5602109000','PartNumber': None,'OriginCountryCode': 'PH','JointProductionIndicator': None,'NetCostCode': None,'NetCostDaterange': None,'PreferenceCriteria': None,'ProducerInfo': None,'MarksAndNumbers': None,'NumberOfPackagesPercommodity': None,'ProductWeight': None,'VehicleID': None,'ScheduleB': None,'ExportType': None,'SEDTotalValue': None,'ExcludeFromForm': None,'ProductCurrencyCode': None,'PackingListInfo': None,'EEIinformation': None
},'InvoiceNumber': 'S0280000','InvoiceDate': '20201210','PurchaSEOrderNumber': 'S0280000','TermsOfShipment': None,'ReasonForExport': 'SALE','Comments': None,'DeclarationStatement': None,'discount': None,'FreightCharges': None,'InsuranceCharges': None,'OtherCharges': None,'CurrencyCode': 'EUR','BlanketPeriod': None,'ExportDate': None,'ExportingCarrier': None,'CarrierID': None,'InBondCode': None,'EntryNumber': None,'PointOfOrigin': None,'PointOfOriginType': None,'ModeOfTransport': None,'PortOfExport': None,'PortOfUnloading': None,'LoadingPier': None,'PartiesToTransaction': None,'RoutedExportTransactionIndicator': None,'Containerizedindicator': None,'License': None,'ECCNNumber': None,'OverridePaperlessIndicator': 1,'ShipperMemo': None,'MultiCurrencyInvoiceLinetotal': None,'HazardousMaterialsIndicator': None
},'ImportControlIndicator': None,'LabelMethod': None,'PreAlertNotification': [],'ExchangeForwardindicator': None,'HoldForPickupIndicator': None,'DropoffAtUPSFacilityIndicator': None,'LiftGateForPickUpIndicator': None,'LiftGateForDeliveryIndicator': None,'EPRAReleaseCode': None,'RestrictedArticles': None },'Package':
[{ 'Description': 'TEXTILE','Packaging':
{ 'Code': '02','Description': None
},'Dimensions':
{ 'UnitOfMeasurement':
{ 'Code': 'CM','Description': 'TEXTILE' },'Height': 14.0
},'PackageWeight':
{ 'UnitOfMeasurement':
{ 'Code': 'KGS','Description': None
},'Weight': 7.05
},'PackageServiceOptions':
{ 'DeliveryConfirmation': None,'DeclaredValue':
{ 'Type':
{ 'Code': '01','Description': 'TEXTILE'
},'MonetaryValue': 552.38
},'VerbalConfirmation': None,'ShipperReleaseIndicator': None,'Notification': None,'HazMat': [],'DryIce': None,'PackageIdentifier': None,'ClinicalTrialsID': None
},'HazMatPackageinformation': None
}]
}
评价响应
{ 'Response': { 'ResponseStatus': { 'Code': '1','Description': 'Success' },'Alert': [ { 'Code': '119001','Description': 'Additional Handling has automatically been set on Package 1.' },{ 'Code': '110971','Description': 'Your invoice may vary from the displayed reference rates' } ],'AlertDetail': [],'TransactionReference': None },'RatedShipment': [ { 'disclaimer': [],'Service': { 'Code': '11','Description': None },'RateChart': None,'RatedShipmentAlert': [ { 'Code': '119001','BillableWeightCalculationMethod': None,'ratingMethod': None,'BillingWeight': { 'UnitOfMeasurement': { 'Code': 'KGS','Description': 'Kilograms' },'Weight': '7.5' },'TransportationCharges': { 'Code': None,'Description': None,'MonetaryValue': '52.91','SubType': None },'BaseServiceCharge': None,'ItemizedCharges': [],'FRSShipmentData': None,'ServiceOptionsCharges': { 'Code': None,'MonetaryValue': '24.30','TaxCharges': [],'TotalCharges': { 'Code': None,'MonetaryValue': '77.21','TotalChargesWithTaxes': None,'NegotiatedrateCharges': { 'ItemizedCharges': [],'TotalCharge': { 'Code': None,'MonetaryValue': '52.38','TotalChargesWithTaxes': None },'GuaranteedDelivery': None,'RatedPackage': [ { 'TransportationCharges': None,'ServiceOptionsCharges': None,'TotalCharges': None,'Weight': '7.1','BillingWeight': None,'Accessorial': [],'NegotiatedCharges': None } ],'TimeInTransit': None },{ 'disclaimer': [],'Service': { 'Code': '65','MonetaryValue': '295.78','MonetaryValue': '320.08','MonetaryValue': '292.82','TimeInTransit': None } ] }
解决方法
从我运行的测试中,当“NegotiatedRatesIndicator”为 1 或 0 时,我没有得到协商的费率,但是当设置为“True”时,我确实得到了一个费率。奇怪的是“假”也返回一个协商的费率或只是“”没有任何文字。似乎任何文本都会导致协商费率返回,但 1 或 0 不会。
"NegotiatedRatesIndicator" : "True"
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。