odoo - 当我向 UPS 提出评级请求时,未返回协商费率

标签 odoo ups

我正在定制 UPS 和 Odoo 之间的集成。我需要能够使用 UPS 的 API 运行费率请求和运输请求,并返回协商好的费率。我确认我的 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': '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="96fff8f0f9d6e5f3fafaf3e4b8f5f9fb" rel="noreferrer noopener nofollow">[email protected]</a>' 
        } 
   },

  'ShipTo':
   { 'Name': 'CUSTOMER',
     'Address':
        { 'AddressLine': [], 
          'City': 'Lousada', 
          'StateProvinceCode': None, 
          'PostalCode': '4620-101', 
          'CountryCode': 'PT', 
          'AddressLine1': 'Street', 
          'AddressLine2': '',
          'AddressLine3': '' 
         } 
   },

  'ShipFrom': 
   { 'Name': 'SELLER', 
     'Address': 
        { 'AddressLine': [ 'STREET,' ],
          'City': '\u200bMataró',
          'StateProvinceCode': None,
          'PostalCode': '08302',
          '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',
                   'Description': None 
              },
          '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,
       'AccessPointCOD': None,
       'DeliverToAddresseeOnlyIndicator': None,
       'DirectDeliveryOnlyIndicator': None, 
       'COD': 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', 'SubVersion': None, 'TransactionReference': None }

Request
{ 'Description': 'S02806', 
  'ReturnService': None, 
  'DocumentsOnlyIndicator': None,
  'Shipper': 
     { 'Name': 'Company', 
       'AttentionName': 'Company', 
       'CompanyDisplayableName': None, 
       'TaxIdentificationNumber': 'ESB67488221', 
       'TaxIDType': None, 
       'Phone': 
          { 'Number': '34922808092',
            'Extension': None 
          },
       'ShipperNumber': 'XXXXXX',
       'FaxNumber': None, 
       'EMailAddress': '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2841464e47685b4d44444d5a064b4745" rel="noreferrer noopener nofollow">[email protected]</a>', 
       'Address': 
          { 'AddressLine': [ 'STREET' ], 
            'City': '\u200bMataró', 
            'StateProvinceCode': None, 
            'PostalCode': '08302', 
            'CountryCode': 'ES' 
          } 
     }, 
  'ShipTo': 
     { 'Name': 'CUSTOMER', 
       'AttentionName': 'CUSTOMER',
       'CompanyDisplayableName': None, 
       'TaxIdentificationNumber': 'PTTAXNUMBER', 
       'TaxIDType': None, 
       'Phone': 
          { 'Number': '12345678',
            'Extension': None 
          }, 
       'FaxNumber': None, 
       'EMailAddress': '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bfdccacccbd0d2dacdffdad2ded6d391dcd0d2" rel="noreferrer noopener nofollow">[email protected]</a>', 
       'Address': 
          { 'AddressLine': 'Street', 
            'City': 'Lousada',
            'StateProvinceCode': None,
            'PostalCode': '4620-101',
            'CountryCode': 'PT', 
            'ResidentialAddressIndicator': None, 
            'AddressLine2': '', 
            'AddressLine3': '' 
          },
       'LocationID': None 
     }, 
  'AlternateDeliveryAddress': None,
  'ShipFrom': 
     { 'Name': 'SELLER', 
       'AttentionName': 'SELLER',
       'CompanyDisplayableName': None, 
       'TaxIdentificationNumber': 'ESTAXNUMBER',
       'TaxIDType': None,
       'Phone': 
          { 'Number': '123456789', 
            'Extension': None 
          }, 
        'FaxNumber': None, 
        'Address': 
          { 'AddressLine': [ 'STREET' ], 
            'City': '\u200bMataró', 
            'StateProvinceCode': None, 
            'PostalCode': '08302', 
            'CountryCode': 'ES' 
          },
        'EMailAddress': None 
     }, 
  'PaymentInformation': 
     { 'ShipmentCharge': 
          [{ 'Type': '01', 
             'BillShipper': 
                { 'AccountNumber': '7W865X',
                  'CreditCard': None, 
                  'AlternatePaymentMethod': None 
                }, 
            'BillReceiver': None, 
            'BillThirdParty': None, 
            'ConsigneeBilledIndicator': None 
          }], 

       'SplitDutyVATIndicator': None 
     }, 
  
  'FRSPaymentInformation': None, 
  'FreightShipmentInformation': None, 
  'GoodsNotInFreeCirculationIndicator': None, 
  'ShipmentRatingOptions': 
     { 'NegotiatedRatesIndicator': 1, 
       'FRSShipmentIndicator': None, 
       'RateChartIndicator': None, 
       'TPFCNegotiatedRatesIndicator': None, 
       'UserLevelDiscountIndicator': None 
     }, 
  'MovementReferenceNumber': None,
  'ReferenceNumber': [], 
  'Service': 
     { 'Code': '11', 
       'Description': 'Service Code' 
     }, 
  'InvoiceLineTotal': None, 
  'NumOfPiecesInShipment': None, 
  'USPSEndorsement': None, 
  'MILabelCN22Indicator': None, 
  'SubClassification': None, 
  'CostCenter': None, 
  'PackageID': None, 
  'IrregularIndicator': None, 
  'ShipmentIndicationType': [], 
  'MIDualReturnShipmentKey': None, 
  'MIDualReturnShipmentIndicator': None, 
  'RatingMethodRequestedIndicator': None, 
  'TaxInformationIndicator': None, 
  'PromotionalDiscountInformation': None, 
  'ShipmentServiceOptions': 
     { 'SaturdayDeliveryIndicator': None, 
       'SaturdayPickupIndicator': None, 
       'COD': None, 
       'AccessPointCOD': None, 
       'DeliverToAddresseeOnlyIndicator': None, 
       'DirectDeliveryOnlyIndicator': 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', 
                           'City': 'Lousada', 
                           'StateProvinceCode': None, 
                           'Town': None, 'PostalCode': '4620-101', 
                           'CountryCode': 'PT', 
                           'AddressLine2': '', 
                           '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 
          }, 
       'DeliveryConfirmation': None, 
       'ReturnOfDocumentIndicator': None, 
       'ImportControlIndicator': None, 
       'LabelMethod': None, 
       'CommercialInvoiceRemovalIndicator': None, 
       'UPScarbonneutralIndicator': True, 
       'PreAlertNotification': [], 
       'ExchangeForwardIndicator': None, 
       'HoldForPickupIndicator': None, 
       'DropoffAtUPSFacilityIndicator': None, 
       'LiftGateForPickUpIndicator': None, 
       'LiftGateForDeliveryIndicator': None, 
       'SDLShipmentIndicator': None, 
       'EPRAReleaseCode': None, 'RestrictedArticles': None }, 
       'Package': 
          [{ 'Description': 'TEXTILE', 
             'Packaging': 
                { 'Code': '02', 
                  'Description': None 
                }, 
             'Dimensions': 
                { 'UnitOfMeasurement': 
                   { 'Code': 'CM', 
                     'Description': 'TEXTILE' }, 
                     'Length': 175.0, 
                     'Width': 14.0, 
                     'Height': 14.0 
                   }, 
             'DimWeight': None, 
             'PackageWeight': 
                { 'UnitOfMeasurement': 
                   { 'Code': 'KGS', 
                     'Description': None 
                   }, 
                  'Weight': 7.05
                }, 
             'LargePackageIndicator': None, 
             'ReferenceNumber': [], 
             'AdditionalHandlingIndicator': None, 
             'PackageServiceOptions': 
                { 'DeliveryConfirmation': None, 
                  'DeclaredValue': 
                     { 'Type': 
                        { 'Code': '01', 
                          'Description': 'TEXTILE' 
                        }, 
                       'CurrencyCode': 'EUR', 
                       'MonetaryValue': 552.38 
                     }, 
                  'COD': None, 
                  'AccessPointCOD': None, 
                  'VerbalConfirmation': None, 
                  'ShipperReleaseIndicator': None, 
                  'Notification': None, 
                  'HazMat': [], 
                  'DryIce': None, 
                  'UPSPremiumCareIndicator': None, 
                  'ProactiveIndicator': None, 
                  'PackageIdentifier': None, 
                  'ClinicalTrialsID': None 
                }, 
             'Commodity': 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', 'Description': 'Additional Handling has automatically been set on Package 1.' }, { 'Code': '110971', 'Description': 'Your invoice may vary from the displayed reference rates' } ], 'BillableWeightCalculationMethod': None, 'RatingMethod': None, 'BillingWeight': { 'UnitOfMeasurement': { 'Code': 'KGS', 'Description': 'Kilograms' }, 'Weight': '7.5' }, 'TransportationCharges': { 'Code': None, 'Description': None, 'CurrencyCode': 'EUR', 'MonetaryValue': '52.91', 'SubType': None }, 'BaseServiceCharge': None, 'ItemizedCharges': [], 'FRSShipmentData': None, 'ServiceOptionsCharges': { 'Code': None, 'Description': None, 'CurrencyCode': 'EUR', 'MonetaryValue': '24.30', 'SubType': None }, 'TaxCharges': [], 'TotalCharges': { 'Code': None, 'Description': None, 'CurrencyCode': 'EUR', 'MonetaryValue': '77.21', 'SubType': None }, 'TotalChargesWithTaxes': None, 'NegotiatedRateCharges': { 'ItemizedCharges': [], 'TaxCharges': [], 'TotalCharge': { 'Code': None, 'Description': None, 'CurrencyCode': 'EUR', 'MonetaryValue': '52.38', 'SubType': None }, 'TotalChargesWithTaxes': None }, 'GuaranteedDelivery': None, 'RatedPackage': [ { 'TransportationCharges': None, 'BaseServiceCharge': None, 'ServiceOptionsCharges': None, 'TotalCharges': None, 'Weight': '7.1', 'BillingWeight': None, 'Accessorial': [], 'ItemizedCharges': [], 'NegotiatedCharges': None } ], 'TimeInTransit': None }, { 'Disclaimer': [], 'Service': { 'Code': '65', 'Description': None }, 'RateChart': None, 'RatedShipmentAlert': [ { 'Code': '119001', 'Description': 'Additional Handling has automatically been set on Package 1.' }, { 'Code': '110971', 'Description': 'Your invoice may vary from the displayed reference rates' } ], 'BillableWeightCalculationMethod': None, 'RatingMethod': None, 'BillingWeight': { 'UnitOfMeasurement': { 'Code': 'KGS', 'Description': 'Kilograms' }, 'Weight': '7.5' }, 'TransportationCharges': { 'Code': None, 'Description': None, 'CurrencyCode': 'EUR', 'MonetaryValue': '295.78', 'SubType': None }, 'BaseServiceCharge': None, 'ItemizedCharges': [], 'FRSShipmentData': None, 'ServiceOptionsCharges': { 'Code': None, 'Description': None, 'CurrencyCode': 'EUR', 'MonetaryValue': '24.30', 'SubType': None }, 'TaxCharges': [], 'TotalCharges': { 'Code': None, 'Description': None, 'CurrencyCode': 'EUR', 'MonetaryValue': '320.08', 'SubType': None }, 'TotalChargesWithTaxes': None, 'NegotiatedRateCharges': { 'ItemizedCharges': [], 'TaxCharges': [], 'TotalCharge': { 'Code': None, 'Description': None, 'CurrencyCode': 'EUR', 'MonetaryValue': '292.82', 'SubType': None }, 'TotalChargesWithTaxes': None }, 'GuaranteedDelivery': None, 'RatedPackage': [ { 'TransportationCharges': None, 'BaseServiceCharge': None, 'ServiceOptionsCharges': None, 'TotalCharges': None, 'Weight': '7.1', 'BillingWeight': None, 'Accessorial': [], 'ItemizedCharges': [], 'NegotiatedCharges': None } ], 'TimeInTransit': None } ] }

最佳答案

根据我运行的测试,当“NegotiatedRatesIndicator”:1 或 0 时,我没有获得协商费率,但当设置为“True”时,我确实获得了费率。奇怪的是,“False”也会返回协商的价格或仅返回“”,而不返回任何文本。似乎任何文本都会导致协商费率返回,但 1 或 0 不会。

"NegotiatedRatesIndicator" : "True"

关于odoo - 当我向 UPS 提出评级请求时,未返回协商费率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66246664/

相关文章:

php - 尝试测试 UPS "Quantum"接口(interface) - XML 文档格式不正确

xml - Odoo 10 看板 View 隐藏 "Add new Column"

python - 如何使状态栏小部件可单击且只读 openerp 7.0

具有 Odoo 配置的 Nginx : host not found in upstream

ups - 将 EPL 图像转换为 PDF?

2d - 如何解码 U.P.S.来自 UPS MaxiCode 条形码的信息?

python - odoo - 2个字段的many2one字段组合的显示名称

python - odoo公​​司可以共享同一个合作伙伴吗?在哪些情况下?

linux - 如何远程监控家用电源 socket 的可用性?

php - UPS 运输模块无法在 Linux 环境中运行