goshippo / shippo-node-client

Shipping API Node.js library (USPS, FedEx, UPS and more)
https://goshippo.com/docs
MIT License
136 stars 54 forks source link

Error message "Not found" from carrier #69

Closed pat154 closed 3 years ago

pat154 commented 3 years ago

Hi guys, I wasn't sure where else to post this for support.

I'm having an issue with the Shippo API that seems impossible to debug.

When using an Australia Post carrier accounts, I don’t seem to be getting any meaningful error messaging. When requesting rates for a shipment via Shippo, I receive this error:

messages: [ { source: 'AustraliaPost', code: '', text: 'Not found' } ],

After some investigation using Australia Post’s API directly, I intentionally got it to throw an error by omitting the length from a request and found the following response returns a 404 with the payload here:

{
 "data": {
  "error": {
   "errorMessage": "Please enter Length."
  }
 },
 "status": 404,
 "config": {
  "method": "POST",
  "transformRequest": [
   null
  ],
  "transformResponse": [
   null
  ],
  "jsonpCallbackParam": "callback",
  "url": "/backend/proxy/get/pac/postage/parcel/domestic/service.json",
  "params": {
   "from_postcode": "2008",
   "to_postcode": "2034",
   "length": "",
   "width": "1",
   "height": "1",
   "weight": "2.4"
  },
  "headers": {
   "AUTH-KEY": "adca17df-9cb8-43dc-8004-3e98ec4988b4",
   "Accept": "application/json, text/plain, */*",
   "X-XSRF-TOKEN": "60389296-9e72-40c0-9efe-ad6f86f836c6"
  }
 },
 "statusText": "Not Found",
 "xhrStatus": "complete"
}

Shippo is returning the statusText of the response instead of the error message which makes it impossible to know what the specific issue with my request is. The default carrier accounts seem to accept the address and parcel information so I'm at a loss of how to workout what the issue is.

It also seems that if I manually create an order in Shippo and request rates the Shippo app itself returns the same error:

image

Is there a way I can debug the issue in Shippo? Is there a way to access more information? I seem to be stuck with the lack of possible directions I can go to continue to troubleshoot this problem.

Thanks guys.

jfriedr commented 3 years ago

I think the best place for us to get all the context is for you to email support (create a zendesk ticket).

https://support.goshippo.com/hc/en-us/requests/new

I was not able to locate your account using your github email address. So including that would be helpful. Feel free to include the zendesk ticket number here. That being said I'm not sure if this is an issue specific to the shippo-node-client. Please let me know if I'm missing something w regard to your request.

jfriedr commented 3 years ago

Given that this is not related to the shippo-node-client I am closing the issue. Unfortunately there's not a way for you to debug the underlying API calls being made directly between the Shippo backend and the Australia Post API (this specific situation does not have to do with the WebApp).

That being said there seemed to be a few issues I noticed. After some additional research I noticed that there had never been a successful API rate call with the account. Before diving into this again I would do the following:

1) Ensure that your Australia Post charge account is 10 digits or 8 digit number (is a StarTrack account) and that the API credentials match a production (or "Test Bed") 2) Ensure that if you are using the production credentials you are not placing the Shippo Carrier Object in Test Mode (do not check the "Enable Test Mode" unless the API credentials for australia post are for a "Test Bed" account) 3) First things first I would get a rate using the example addresses provided in Australia Post's docs: 4) Once that is working then you can add additional accounts (just ensure that the production accounts don't have test mode enabled within Shippo).

Note: I used this raw JSON's dimensions / addresses to ensure I was getting back a rate