XML syntax for MonetaryValue, for insurance, from UPS rate API
Posted on 2007-09-29
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!)
I tried this, in ASP/VBScript/XML:
strXML=strXML & "<PackageServiceOptions>"
if shipmentdeclaredvalue <> "" then
if isnumeric(shipmentdeclaredvalue) then
if shipmentdeclaredvalue > 100 then
strXML=strXML & "<InsuredValue><CurrencyCode>USD</CurrencyCode><MonetaryValue>" & shipmentdeclaredvalue & "</MonetaryValue></InsuredValue>"
strXML=strXML & "</PackageServiceOptions>"