【问题标题】:Fedex Special Rate Request using python-fedex使用 python-fedex 的 Fedex 特殊费率请求
【发布时间】:2013-08-31 15:23:56
【问题描述】:

我对联邦快递费率服务请求有疑问。我需要从fedex 获得星期六递送费率。我怎样才能得到这个?我正在使用python-fedex 模块。

我尝试过使用

rate_request.RequestedShipment.ServiceType = None
rate_request.VariableOptions = 'SATURDAY_DELIVERY'

与其他参数。请给我一些提示。我只是坚持下去。

【问题讨论】:

    标签: python fedex


    【解决方案1】:

    我不知道那个模块。但是周六的运费请求看起来像这样:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://fedex.com/ws/rate/v13">
       <SOAP-ENV:Body>
          <RateRequest>
             <WebAuthenticationDetail>
                <UserCredential>
                   <Key></Key>
                   <Password/>
                </UserCredential>
             </WebAuthenticationDetail>
             <ClientDetail>
                <AccountNumber></AccountNumber>
                <MeterNumber></MeterNumber>
             </ClientDetail>
             <TransactionDetail>
                <CustomerTransactionId>RateRequest_Condor_Sat_Del</CustomerTransactionId>
             </TransactionDetail>
             <Version>
                <ServiceId>crs</ServiceId>
                <Major>13</Major>
                <Intermediate>0</Intermediate>
                <Minor>0</Minor>
             </Version>
             <RequestedShipment>
                <ShipTimestamp>2012-08-17T09:30:47-05:00</ShipTimestamp>
                <DropoffType>REGULAR_PICKUP</DropoffType>
                <ServiceType>FIRST_OVERNIGHT</ServiceType>
                <PackagingType>YOUR_PACKAGING</PackagingType>
                <TotalWeight>
                   <Units>LB</Units>
                   <Value>50.0</Value>
                </TotalWeight>
                <Shipper>
                   <AccountNumber></AccountNumber>
                   <Contact>
                      <CompanyName>FedEx-WAPI</CompanyName>
                      <PhoneNumber>1234567890</PhoneNumber>
                   </Contact>
                   <Address>
                      <StreetLines>SN2000 Test Meter 8</StreetLines>
                      <StreetLines>10 Fedex Parkway</StreetLines>
                      <City>COLORADO SPRINGS</City>
                      <StateOrProvinceCode>CO</StateOrProvinceCode>
                      <PostalCode>80915</PostalCode>
                      <CountryCode>US</CountryCode>
                   </Address>
                </Shipper>
                <Recipient>
                   <AccountNumber></AccountNumber>
                   <Contact>
                      <PersonName>Recipient Contact</PersonName>
                      <PhoneNumber>1234567890</PhoneNumber>
                   </Contact>
                   <Address>
                      <StreetLines>Recipient Address Line 1</StreetLines>
                      <StreetLines>Recipient Address Line 2</StreetLines>
                      <City>Minneapolis</City>
                      <StateOrProvinceCode>MN</StateOrProvinceCode>
                      <PostalCode>55411</PostalCode>
                      <CountryCode>US</CountryCode>
                   </Address>
                </Recipient>
                <ShippingChargesPayment>
                   <PaymentType>SENDER</PaymentType>
                   <Payor>
                      <ResponsibleParty>
                         <AccountNumber></AccountNumber>
                         <Tins>
                            <TinType>BUSINESS_STATE</TinType>
                            <Number>123456</Number>
                         </Tins>
                      </ResponsibleParty>
                   </Payor>
                </ShippingChargesPayment>
                <SpecialServicesRequested>
                   <SpecialServiceTypes>SATURDAY_DELIVERY</SpecialServiceTypes>
                </SpecialServicesRequested>
                <LabelSpecification>
                   <LabelFormatType>COMMON2D</LabelFormatType>
                   <ImageType>PNG</ImageType>
                   <LabelStockType>PAPER_4X6</LabelStockType>
                </LabelSpecification>
                <RateRequestTypes>ACCOUNT</RateRequestTypes>
                <PackageCount>1</PackageCount>
                <RequestedPackageLineItems>
                   <SequenceNumber>1</SequenceNumber>
                   <GroupPackageCount>1</GroupPackageCount>
                   <Weight>
                      <Units>LB</Units>
                      <Value>20.0</Value>
                   </Weight>
                   <Dimensions>
                      <Length>12</Length>
                      <Width>12</Width>
                      <Height>12</Height>
                      <Units>IN</Units>
                   </Dimensions>
                   <ContentRecords>
                      <PartNumber>123445</PartNumber>
                      <ItemNumber>kjdjalsro1262739827</ItemNumber>
                      <ReceivedQuantity>12</ReceivedQuantity>
                      <Description>ContentDescription</Description>
                   </ContentRecords>
                </RequestedPackageLineItems>
             </RequestedShipment>
          </RateRequest>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    

    其中ShipmentSpecialServiceType是定义的重要部分-开发者手册第37页-:

    标识托运人要求的特殊服务的集合 并由联邦快递提供。托运人要求提供特殊服务,要求 附加数据(如货到付款),特殊服务类型必须是 存在于 SpecialServiceTypes 集合中,并且支持 必须在适当的子对象中提供详细信息(例如 鳕鱼详细信息)。

    【讨论】:

    • 感谢您的回复。这对我帮助很大。现在我面临另一个问题。可能是所有服务或送货地址都没有可用的周六送货特殊服务,这就是为什么我收到像这样的“不允许特殊服务周六送货”错误。再次感谢。很好的帮助!
    • 是的,当然...星期六递送不是所有联邦快递服务和国家/地区的选项。据我所知:FedEx Priority Overnight,FedEx First Overnight, FedEx Ground, FedEx Ground Freight, FedEx 2Day, FedEx 2Day AM, International Priority, FedEx 1Day® Freight, FedEx 2Day Freight。但重要的是检查国际中的国家对,从阿根廷到美国,您可能可以支付周六交货,但不能从我们到 argentina.brgds
    【解决方案2】:

    我会看看 Shiprush SDK。它有一个 SOAP 入口点,您可以为 Fedex 和其他运营商评分和发货。 (而且他们支持它。)

    【讨论】:

      【解决方案3】:

      rate_request.derivedData.commitDetail.proofOfDeliveryDayOfWeek='SATURDAY'

      这将解决你的 python-fedex 问题

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-31
        相关资源
        最近更新 更多