cancel
Showing results for 
Search instead for 
Did you mean: 

Inappropriate GetRates API Responses

SarahATX
Moderator
Moderator

Original post by user Ken Cox

 

Even though I supply the dimensions for a medium-size box to the GetRates API, I get a few rate results that are quite bizarre such as the price for sending the box in a shipping tube or letter envelope. 😉

Is there a way of ensuring the return of only rates suitable for the type and size of the package described?

I'm wondering if this is done through the packageCode value in the API call?

 

What are the valid values (other than null) for packageCode as shown below?

 

{
  "carrierCode": "fedex",
  "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
1 REPLY 1

SarahATX
Moderator
Moderator

Hi Ken, 

 

Yes, if you use the values available for the carrier's packageCode fields, you should get appropriate rates back (this is especially important for carriers and services that use dimensional weight, like FedEx and UPS). 

 

You can use the list-packages call to get a list of the available packageCode values for each carrier you wish to use. Here is the documentation about this on our Developer Portal: https://www.shipstation.com/docs/api/carriers/list-packages/