Submit Your Article Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-24-2007, 12:16 PM
WebProWorld Member
 
Join Date: Feb 2004
Location: New York
Posts: 82
JSeverson RepRank 0
Default UPS Rates & Services Tool

Hi all,
A client of mine is complaining that the rates that are returned by UPS are wrong and I can find nothing wrong with the code. Due to my client's refusal to purchase a security certificate, I had to set this up using the HTML version of the tool rather than the XML version which, according to the documentation, requires an SSL. The data is sent via an HTTP post with ASP.

He claims that he is losing sales due to the shipping rates which are supposedly too high . I personally believe it is due to the lack of an SSL even though the credit card from is hosted by Authorize.net. Anyways, it is currently set to retrieve residential rates. When it is set to commercial, my client complains that the rates are too low. The rates are off only by a few dollars in each instance.

I've checked a few of his orders against the UPS Web site and the rates he says they should be. Although the UPS Web site returns rates that are higher then what the client says they should be, those rates are still lower then what is returned by the UPS Rates & Services tool.

Could somebody take a look at the code below and let me know if you notice anything that could be causing the rates to be "wrong"?

<%
const Request_POST = 1
const Request_GET = 2

response.buffer = true
dim objXMLHTTP, xml

' Create an xmlhttp object:
set xml = Server.CreateObject("Microsoft.XMLHTTP")

reDim shipmentArray(10,2)
shipmentIndex = 0

' Get the data from UPS
for z=0 to 2

' Set service type
select case z
case 0
ServiceType="GND"
shipmentArray(shipmentIndex,1) = "Ground"
case 1
ServiceType="1DA"
shipmentArray(shipmentIndex,1) = "Next Day Air"
case 2
ServiceType="2DA"
shipmentArray(shipmentIndex,1) = "2nd Day Air"
end select

shippingdata = "?accept_UPS_license_agreement=yes"
shippingdata = shippingdata & "&10_action=3"
shippingdata = shippingdata & "&13_product=" & ServiceType
shippingdata = shippingdata & "&origCity=Highland"
shippingdata = shippingdata & "&14_origCountry=US"
shippingdata = shippingdata & "&15_origPostal=12528"
shippingdata = shippingdata & "&19_destPostal=" & ord_shipping_postal
shippingdata = shippingdata & "&20_destCity=" & ord_shipping_city
shippingdata = shippingdata & "&22_destCountry=US"
shippingdata = shippingdata & "&23_weight=" & WeightTotal
shippingdata = shippingdata & "&weightstd=lbs"
shippingdata = shippingdata & "&24_value=" & ord_subtotal
shippingdata = shippingdata & "&34_handling=1"
shippingdata = shippingdata & "&47_rate_chart=Regular Daily Pickup"
shippingdata = shippingdata & "&48_container=00"
shippingdata = shippingdata & "&49_residential=1"

on error resume next

'Open the connection to the UPS server.
xml.Open "GET", "http://www.ups.com/using/services/rave/qcostcgi.cgi?"&shippingdata, False
xml.Send
strRetval=xml.responseText

if err.number <> 0 then
if err.number >= 400 Then
response.write "Error Retrieving Shipping Costs from UPS: "&Err.Number
else
response.redirect "Error Retrieving Shipping Costs from UPS, component/WinInet error: "&Err.Description
end if
response.end
end If

response.write "<!-- " & strRetval & " -->" & vbcrlf

UPSarray = split(strRetval,"%")

'If no fee is returned, insert a default fee
if UPSarray(10) = "" or UPSarray(10) = "0" or UPSarray(10) = "0.0" then
UPSarray(10) = 20
end if

shipmentArray(shipmentIndex,0) = Cdbl(UPSarray(10))

shipmentIndex = shipmentIndex + 1

next

'Insert a generic fee if no service is available
if shipmentIndex = 0 then
shipmentArray(shipmentIndex,0) = 20
shipmentArray(shipmentIndex,1) = "UPS Ground"
shipmentIndex = shipmentIndex + 1
end if
%>

<select name="shipmentString">
<% for f=0 to shipmentIndex - 1 %>
<option value="<%= shipmentArray(f,0) & "|" & shipmentArray(f,1) %>"><%= shipmentArray(f,1) & " - " & FormatCurrency(shipmentArray(f,0)) %></option>
<% next %>
</select>

Thanks,
__________________
Jeff T. Severson
J.T.S. Design, Inc.
Reply With Quote
  #2 (permalink)  
Old 07-24-2007, 01:18 PM
Dubbya's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Nov 2006
Location: Steinbach, Manitoba, Canada
Posts: 1,307
Dubbya RepRank 6Dubbya RepRank 6Dubbya RepRank 6Dubbya RepRank 6Dubbya RepRank 6Dubbya RepRank 6
Default Re: UPS Rates & Services Tool

Make sure you've specified the correct shipping information. UPS uses the shipping address and their zones table to calculate rates dynamically and the system is not always accurate.

Be sure to check the weights and sizes of the items being shipped. Since couriers use "dimensional weight" to calculate their rates, it's imperative that you ensure your measurements and weights are correct.

If your customer has adjusted the item weights and sizes to include packaging and shipping box dimensions, it might be messing up your computations. Likewise, shipping multiple items in the same box can cause similar problems.

Finally, the rates also take fluctuating fuel subsidies into account. This alone could be tossing things completely out of whack, especially if your client is using an older software tool to do their comparative shipping calculations.

Make sure that your client is using UPS latest calculation tools so that you're comparing apples to apples.

If you're certain that these things are all accurate and correct, you might want to contact UPS support to see what they recommend.

Good Luck.
Reply With Quote
  #3 (permalink)  
Old 07-24-2007, 01:56 PM
WebProWorld Member
 
Join Date: Feb 2004
Location: New York
Posts: 82
JSeverson RepRank 0
Default Re: UPS Rates & Services Tool

Dubbya,
Thanks for the reply.

The originating shipping address is correct.

I believe my client uses UPS packaging which, according to the documentation, means that the dimensions are not required fields. As far as I know, the weights themselves are accurate but my client entered all of that data so I can't be certain.

My client is using an Excel spreadsheet to calculate the rates manually and to compare them to the rates generated on his Web site. His rates are off as compared to the UPS Web site itself. For example, he claims one order should have cost less then $9 in shipping costs. But, when I plug in the information on the UPS Web site, it returns $11+ for shipping. So, I do believe he is either calculating wrong or is using old information in his Excel document.

However, the rates calculated on the UPS Web site are still lower then what is generated on my clients Web site.

I was able to fine tune it a bit so that the prices are now more in line. I made sure handling was turned on and it is set to receive commercial rates. The rates now appear to be off by $1, give or take a few cents. What is weird is that ground shipping rates seem to be the rates that are most off. 2nd Day Air and Next Day Air are only off by a matter of $.50 or less.

Another oddity is that the unmodified sample code that UPS provides in their PDF for the HTML version, which is basically HTML code for a form, returns different rates as well. If I remember correctly, these rates are different from the UPS Web site, my clients Web site and my clients manual calculations.

I would much rather switch over to the XML version as it offers more flexibility and I would assume that this is the same functionality used on the UPS site. But, my client refuses to purchase a security certificate. So, I don't know how much more assistance I can give him until he decides to stop being cheap - which I believe is what is causing him to lose sales and not the shipping rates.
__________________
Jeff T. Severson
J.T.S. Design, Inc.
Reply With Quote
  #4 (permalink)  
Old 07-24-2007, 06:32 PM
WebProWorld Member
 
Join Date: Jun 2007
Posts: 50
Matteo RepRank 0
Default Re: UPS Rates & Services Tool

UPS also sometimes applies discounts for certain shippers, and you would need to sign in to get those discounts......perhaps he's expecting those
__________________
There is a time for every purpose under heaven.
http://www.expresspools.com http://www.sjvwd.com
Reply With Quote
  #5 (permalink)  
Old 07-24-2007, 07:59 PM
deepsand's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2004
Location: Philadelphia, PA
Posts: 3,945
deepsand RepRank 10deepsand RepRank 10deepsand RepRank 10deepsand RepRank 10deepsand RepRank 10deepsand RepRank 10deepsand RepRank 10deepsand RepRank 10deepsand RepRank 10deepsand RepRank 10deepsand RepRank 10
Default Re: UPS Rates & Services Tool

Does your client have an Account with UPS?

If so, are you retrieving his account specific rate, or the retail rate?
Reply With Quote
  #6 (permalink)  
Old 07-24-2007, 09:39 PM
WebProWorld Pro
 
Join Date: Apr 2006
Location: Earth
Posts: 256
blitzen RepRank 0
Default Re: UPS Rates & Services Tool

We had this problem.
You really need to code the parameters exactly what they should be.
Don't assume any defaults - it's just as easy to hard code the parameters.
Code all of them.

If this keeps up, just apply a percentage or monetary amount to the total to get it closer to what your client thinks it should be.

Also, contact UPS for help. They'll review your code.
__________________
Advertising without research is like shooting an arrow into the air and
then looking up for a target to catch it with.
Reply With Quote
  #7 (permalink)  
Old 07-24-2007, 11:03 PM
WebProWorld New Member
 
Join Date: Sep 2006
Posts: 10
remccain RepRank 0
Angry Re: UPS Rates & Services Tool

Quote:
Originally Posted by JSeverson View Post
... Due to my client's refusal to purchase a security certificate, I had to set this up using the HTML version of the tool rather than the XML version which, according to the documentation, requires an SSL.
The UPS tool requires XML and a security certificate, right?
Why would your client want you to cobble something together that is 1) not UPS approved code, 2) not secure, and 3) requires ongoing (and expensive, I hope) maintenance from you?

Explain to the cheapskate that setting up UPS approved code via SSL will cost less than your hourly fee to maintain any created code - and you absolutely refuse to guarantee the security of the site if he refuses.
Reply With Quote
  #8 (permalink)  
Old 07-24-2007, 11:51 PM
WebProWorld Member
 
Join Date: Feb 2004
Location: New York
Posts: 82
JSeverson RepRank 0
Default Re: UPS Rates & Services Tool

Thank you all for your replies.

To answer the questions regarding whether my client has an account with UPS, as far as I know, he doesn't. He is expecting the retail rates and not negotiated rates.

As I mentioned previously, I did apply some adjustments that did bring the rates more inline with what the UPS Web site returns. Previously, I had added functionality that allows the client to specify a certain percentage to be applied to the rates but, for some reason, he isn't using it.

Remccain: The XML version of the tool does require an SSL but the HTML version does not. I worded that quote wrong. I've seen similar methods applied on third-party shopping carts where the request is sent via an HTTP post for the HTML version. This method was the only avenue I had left to me due to the client's refusal to purchase the SSL...aside from using the exact HTML version that basically takes the customer to the UPS site and essentially gives them control for specifying what their shipping rate should be.

Thanks,
__________________
Jeff T. Severson
J.T.S. Design, Inc.
Reply With Quote
  #9 (permalink)  
Old 07-25-2007, 12:58 PM
advancedmerchant's Avatar
WebProWorld Pro
 
Join Date: Aug 2003
Location: Fullerton, CA
Posts: 170
advancedmerchant RepRank 2
Default Re: UPS Rates & Services Tool

You might want to test the XML version on another site (maybe your own if you have a cert), and make sure that really does fix the problem. If this guy is squeaking over the cost of a cert (which is STUPID, a cert adds credibility to your company and site), imagine how he will howl if he continues to get the same results WITH the cert.
__________________
Accept Credit Cards Anywhere!
www.merchantanywhere.com
Reply With Quote
  #10 (permalink)  
Old 07-25-2007, 03:02 PM
WebProWorld Member
 
Join Date: Feb 2004
Location: New York
Posts: 82
JSeverson RepRank 0
Default Re: UPS Rates & Services Tool

Quote:
Originally Posted by advancedmerchant View Post
You might want to test the XML version on another site (maybe your own if you have a cert), and make sure that really does fix the problem. If this guy is squeaking over the cost of a cert (which is STUPID, a cert adds credibility to your company and site), imagine how he will howl if he continues to get the same results WITH the cert.
Good point. I need to buy an SSL for my own site anyways so it the only thing I would be losing is the time involved with setting up a demo of the XML version.

It should be noted that the form for requesting credit card information is hosted by Authorize.net. If he had wanted to capture credit card information without any type of security, I would have told him to take a hike. I would have preferred to set up the form on my client's server but Authorize.net wouldn't allow it due to his lack of an SSL. However, order information and user information (e.g. shipping info, billing info, name, e-mail, etc.) is captured on his server and I feel that that should be in a secure environment as well. At the least, it would make the customers feel safe.
__________________
Jeff T. Severson
J.T.S. Design, Inc.
Reply With Quote
  #11 (permalink)  
Old 07-27-2007, 10:22 AM
NetPhr3ak's Avatar
WebProWorld New Member
 
Join Date: Jun 2007
Location: Pennsylvania
Posts: 16
NetPhr3ak RepRank 0
Default Re: UPS Rates & Services Tool

How much of a difference is there from UPS rates and your clients? Is it a dollar? After looking through your settings (shippingdata = shippingdata & "&34_handling=1") I've come to the conclusion you're clients settings are applying an additional handling fee to the published rates. Set the handling to 0 and see if that works. If that still doesn't work call 1-800 Call UPS and ask for Tech. They'll be able to walk you through the set up.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Noframe & Noembed tags Ann Google Discussion Forum 4 07-21-2007 02:50 AM
IT.Com Enhances Services With White Paper Search Tool WPW_Feedbot Search Engine Optimization Forum 0 10-11-2005 02:30 PM
SQL Server 2005's ETL Tool: Integration Services WPW_Feedbot IT Discussion Forum 0 03-31-2005 07:30 PM
Court rules in pop-ups' favor WPW_Feedbot IT Discussion Forum 0 01-05-2005 11:31 AM
Unsubscribe rates for first one free services..help! mowgster Marketing Strategies Discussion Forum 0 10-13-2004 01:30 PM


All times are GMT -4. The time now is 01:47 PM.



Search Engine Optimization by vBSEO 3.3.0