Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

UPSXML Rates error


cmcgill

Recommended Posts

We've been getting the following error message, seemingly whenever someone tries to add an item to their cart:

UPSXML Rates Error: multiple errors: 111285-The postal code  is invalid for VT United States.,111215-The requested service is unavailable to residential destinations. experienced by customer with id  on 2023-11-06 11:21:15

We've not received any orders since setting up under OSC4.  Any help would be greatly appreciated.

Link to comment
Share on other sites

@Ivan Holbi  There seems to be an error after updating the UPS module.  The estimator gets "stuck" on a state. If a user uses a state and then tries a zip code invalid for that state it fails with no message shown to them.  Continuing to the checkout page will show the error and it clears after a compatible state and zip code are input.  But returning to the cart it sticks on that state.  Since I use my cart for freight calculation, the estimator is "broken".

Link to comment
Share on other sites

On 11/6/2023 at 6:41 PM, cmcgill said:

We've been getting the following error message, seemingly whenever someone tries to add an item to their cart:

UPSXML Rates Error: multiple errors: 111285-The postal code  is invalid for VT United States.,111215-The requested service is unavailable to residential destinations. experienced by customer with id  on 2023-11-06 11:21:15

We've not received any orders since setting up under OSC4.  Any help would be greatly appreciated.

Hi Chuck,

Based on the error you quoted the invalid postal code is filled in for VT United States. Once the valid code is filled in there should not be such an error.

Best regards,

Ivan

Link to comment
Share on other sites

34 minutes ago, jimdanforth said:

@Ivan Holbi  There seems to be an error after updating the UPS module.  The estimator gets "stuck" on a state. If a user uses a state and then tries a zip code invalid for that state it fails with no message shown to them.  Continuing to the checkout page will show the error and it clears after a compatible state and zip code are input.  But returning to the cart it sticks on that state.  Since I use my cart for freight calculation, the estimator is "broken".

Hi Jim,

Returning to the cart is the responsibility of the browser, not the UPS module so the browser keeps the wrong information that was initially filled in. Could you please clarify it further what you mean by "Since I use my cart for freight calculation, the estimator is "broken"."

Best regards,

Ivan

Link to comment
Share on other sites

I see several of the UPS errors a day and have had customers tell me they are not getting quotes.  So when I get a call, I act as if I am the customer and put their item in the cart and go to the estimator since it should give them the exact same numbers.  However it will error if I do not use a zip code from the same state I previously used.  I have to go all the way to the checkout and change the state and then put the zip in to get a valid quote.  But when the next customer calls, the estimator tries to use the same state I previously used.
Is it possible to add a state selection to the estimator?  My previous cart did this and now I think I understand why.

Edited by jimdanforth
Link to comment
Share on other sites

2 hours ago, Ivan Holbi said:

Hi Chuck,

Based on the error you quoted the invalid postal code is filled in for VT United States. Once the valid code is filled in there should not be such an error.

Best regards,

Ivan

I'm afraid that's not much help.  In the latest occurrence of this, the person is from another state, and already has an account set up, so the system has the correct zip code for that person for the state they live in.  It seems that the module is always expecting a valid zip code for VT, even if the customer lives in another state.

Link to comment
Share on other sites

On 11/13/2023 at 1:14 PM, cmcgill said:

I'm afraid that's not much help.  In the latest occurrence of this, the person is from another state, and already has an account set up, so the system has the correct zip code for that person for the state they live in.  It seems that the module is always expecting a valid zip code for VT, even if the customer lives in another state.

I can concur on this problem.

Link to comment
Share on other sites

  • 6 months later...
  • 3 weeks later...

So I was having this problem with the new UPS module, UpsApiV2, which I had to move to because UPSXML wasn't supported by UPS any more. If anyone is coming to this thread because they got the 111285 error and they're looking for help with UpsApiV2, I can tell you that basically this error was happening when a guest used the shipping estimator on the shopping cart. If the zip code they typed in was for the state of my shop (CA), then it would give rates. Otherwise it would throw the ol' 111285 Postal Code Invalid error. I traced it down and the problem appears to be in UpsApi.php in the lib/common/modules/orderShipping/UpsApiV2 folder. Inside the function setDeliveryData it assigns the state by calling the get_zone_code from the helpers script, but if the user isn't logged in then the zone_id element in the data array is set to 0. So that means that the query in get_zone_code fails because it needs a value there, so it returns the default state instead. I got around it by replacing this line inside setDeliveryData :

$state = \common\helpers\Zones::get_zone_code((int)$data['country_id'], (int)$data['zone_id'], 'CA');

with this :

if ((int)$data['zone_id'] != 0) {
      $state = \common\helpers\Zones::get_zone_code((int)$data['country_id'], (int)$data['zone_id'], 'CA');
}

So what happened then is that it just sends the state as an empty variable in the UPS call if the user is a guest but that seems to be ok because UPS can return rates with the zip code alone (in the US at least idk about Europe etc and I'm not gonna act like I'm an expert with the UPS API). You may have to replace the CA in that snippet with your state, idk. Your mileage may vary. Obviously there's probably a more elegant solution but this is just what worked for me so I figured if I posted it maybe it could help someone else.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...