0

How do I integrate the UPS Ratings API in NetSuite? I know this is a broad question, but I need some guidance. I'm just looking for a general overview of what I need to do to integrate the UPS Ratings API in NetSuite.

More specifically, I need my users to be able to check UPS shipping rates directly from a Sales Order record in NetSuite. While I know NetSuite has a lot of this built in, it doesn't account for everything we need it to do.

John
  • 302
  • 2
  • 23
  • So far, my thoughts are that this would be a User Event script for a Sales Order that would call the Ratings API and populate rates into custom fields on the Sales Order. – John Nov 18 '15 at 19:20
  • 1
    Hi John, Last time I looked at it the Ratings API was fairly complex -- you generally needed to do a few calls to get the info you needed. A simpler option was to integrate with Pacejet. I found Pacejet to be a bit price-y but it's much simpler to integrate. Note if you are just going to dive into the ratings api I'd initiate from a client script that calls a suitelet. Have the suitelet do the actual communication with UPS – bknights Nov 18 '15 at 20:10
  • My company has actually been using Pacejet, but the cost is a problem. In addition, Pacejet doesn't account for package dimensions, only weight, right? – John Nov 18 '15 at 20:52
  • don't recall about dimensions but since the company I was looking at this for didn't want to deal with dimensions it wasn't an issue. – bknights Nov 18 '15 at 21:20
  • 1
    Can you be more specific on how built in solution is not able to help you or where is it failing? – prasun Nov 19 '15 at 05:34
  • Okay, I asked my boss for more specifics, and it's actually about volume. Pacejet times out after a certain number, and since we ship thousands of packages, that timeout really doesn't work for us. We've talked to Pacejet about this, and they said that they have no plans to change their current model. As a result, we need a new solution. – John Nov 19 '15 at 15:56

1 Answers1

1

User event looks the correct approach and I would recommend not using standard NetSuite solution as if your API and NetSuite API(in-built one) both makes HTTP to UPS, the performance can be bad.

I have answered a similar question here

Instead of using custom fields for storing rates you can directly modify the standard shipping rates fields (eg: shippingcost and handlingcost).

If you think UPS Rating API is too complex for a client in SuiteScripts I would recommend writing a proxy web server that gets the rates from UPS and you can contact your proxy web server endpoints using nlapiRequestURL()

Community
  • 1
  • 1
prasun
  • 7,073
  • 9
  • 41
  • 59
  • prasun, I'm having trouble with this. I know you suggested a User Event script, but I need the rates to be retrieved while a user is editing the sales record, and not after it has been saved. This sounds like a Client script instead of a User Event script, is this possible? Since this would be client-side instead of server-side, I know certain APIs like nlapiLoadFile (for the XML template) won't work. – John Dec 16 '15 at 17:23
  • 1
    I am not very clear why you need APIs like nlapiLoadFile here, but, if there is some restrictive API of client side you can write a suitelet and AJAX your suitelet to get the response – prasun Dec 16 '15 at 17:26
  • huh I've never done that with a suitelet, I will look into it, thanks! – John Dec 16 '15 at 17:29
  • Okay, so I've created a Suitelet that I'm calling from a Client Script on a Sales Order Record. The Suitelet constructs the XML document and sends it to UPS and gets a response that I will then parse and display on the Sales Order. It's not working, when I try to display the results from UPS, all I get is "null". I sent my code to the UPS tech support, and they say that it works on their end, which means my NetSuite code is off. Can you think of anything that I've described above that wouldn't work? – John Dec 18 '15 at 21:59
  • Can you post your suitelet code, probably in an another question? – prasun Dec 19 '15 at 03:08