dtleahy
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(shipmentdeclared value) then
if shipmentdeclaredvalue > 100 then
strXML=strXML & "<InsuredValue><CurrencyCo de>USD</Cu rrencyCode ><Monetary Value>" & shipmentdeclaredvalue & "</MonetaryValue></Insured Value>"
end if
end if
end if
strXML=strXML & "</PackageServiceOptions>"
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(shipmentdeclared
if shipmentdeclaredvalue > 100 then
strXML=strXML & "<InsuredValue><CurrencyCo
end if
end if
end if
strXML=strXML & "</PackageServiceOptions>"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
==========================
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</Currenc
<MonetaryValue>XXXXXX</Mon
</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.