Skip to main content

API calls to Get Rate fail

  • Jan 21, 2023 6:47 PM UTC
  • 2 replies
  • 0 views

Using the example from the website. Make a call for "fedex" or "ups" to get rates. The POST request with valid authorization and payload returns internal ShipStation error data. All my GET requests work fine where I get my lists of carriers on the account etc. Only a POST to get rates on a shipment fail. What is the secret sauce to debugging this with ShipStation. The error returned has no information of much use.

 

 

 

{"Message"=>"An error has occurred.", "ExceptionMessage"=>"One or more providers reported an error", "ExceptionType"=>"SS.Core.Utilities.Rates.Exceptions.RateException", "StackTrace"=> " at SS.Core.Utilities.Rates.RateUtility.GetRates(Nullable`1 carrierId, Nullable`1 providerId, Nullable`1 warehouseId, String fromZip, String country, String postalCode, String city, Nullable`1 weight, UnitOfMeasureWeight weightUnitOfMeasure, Nullable`1 package, Nullable`1 l, Nullable`1 w, Nullable`1 h, UnitOfMeasureDimension dimensionUnitOfMeasure, Confirmation confirmation, Int32 insuranceProvider, Nullable`1 insuredValue, Boolean allowSelection, Boolean residential, Nullable`1 nonMachinable, OrderPackage[] packages, CustomsItem[] customsItems, Nullable`1 billDutiesToSender, Nullable`1 saturdayDelivery, Nullable`1 alcohol, String shipState, OrderSetting[] settings, Order order, Warehouse warehouse, Boolean primaryProvidersOnly, Address destinationAddress, HashSet`1 shippingServiceIds, String fromCity, String fromState) in D:\\buildAgentFull\\work\\8e15a453e647e65a\\SS.Core\\Utilities\\Rates\\RateUtility.cs:line 643\r\n at SS.OpenApi.Controllers.ShipmentsController.GetRates(RateRequest request) in D:\\buildAgentFull\\work\\8e15a453e647e65a\\SS.OpenApi\\Controllers\\ShipmentsController.cs:line 499\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"}

 

 

2 replies

  • Jun 20, 2023 3:12 AM UTC

I am seeing this same issue, did you ever find resolution on this or does anyone else have a working example of the getRates API endpoint?


  • Jun 21, 2023 12:22 AM UTC

For anyone else who ends here, heard back from tech support and since I am using their built in UPS accounts the correct carrierCode is actually ups_walleted

Not sure that is documented anywhere.

Here is an example that works:

{
"carrierCode": "ups_walleted",
"serviceCode": null,
"packageCode": null,
"fromPostalCode": "78703",
"toState": "DC",
"toCountry": "US",
"toPostalCode": "20500",
"toCity": "Washington",
"weight": {
"value": 3,
"units": "ounces"
},
"dimensions": {
"units": "inches",
"length": 7,
"width": 5,
"height": 6
},
"confirmation": "delivery",
"residential": false
}