Link to home
Start Free TrialLog in
Avatar of dtleahy
dtleahyFlag for United States of America

asked on

XML syntax for MonetaryValue, for insurance, from UPS rate API

Re: eCommerce rate calculation using UPS XML

It appears that UPS has changed their XML that they use to communicate with their online rate calculator. In the 2007 version, I don't see anywhere to assign an InsuredValue or MonitaryValue field or something like that, that can be used to calculate the shipping rate with insurance. I see MonetaryValue associated with C.O.D., but I m pretty sure I don't want to use that XML field because then there will be a COD surcharge added.

I have found samples from the UPS 2006 XML that appear to directly address the value for insurance, but the 2007 version seems to have dropped it.

Do you know how to form the XML to ask UPS to include insurance in a rate quote? Your sample can be straight XML, ASP with XML, or PHP with XML and I can grab what I need (the XML!)

Thanks,

Dennis

==========================

I tried this, in ASP/VBScript/XML:

(snippet)

strXML=strXML & "<PackageServiceOptions>"
      if shipmentdeclaredvalue <> "" then
            if isnumeric(shipmentdeclaredvalue) then
                  if shipmentdeclaredvalue > 100 then
                          strXML=strXML & "<InsuredValue><CurrencyCode>USD</CurrencyCode><MonetaryValue>" & shipmentdeclaredvalue & "</MonetaryValue></InsuredValue>"
                  end if
            end if
      end if
      strXML=strXML & "</PackageServiceOptions>"
Avatar of dtleahy
dtleahy
Flag of United States of America image

ASKER

This was solved by a response from UPS tech support:
===============================================
Dear Dennis,

Thank you for your inquiry. It turns out that the elements for Insured Value are missing from the new Developer's Guides (they were in the previous versions). A defect will be opened against the RSS Guide to get it updated (this might not happen until January though).

The elements that should be included in the RSS XML request are:

<Insured Value>
<CurrencyCode>XXX</CurrencyCode>
<MonetaryValue>XXXXXX</MonetaryValue> (holds up to 99999999.99 but only supports up to 50,000.00)
</InsuredValue>

These elements should fall under the <PackageServiceOptions> section (begins on page 28 of the new Developer's Guide).

The Insured Value charge will be returned in the <ServiceOptionCharges> section of the response.

I apologize for any confusion the missing information may have caused.

Please contact us if you need any additional assistance.
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial