Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPS API Change Request #37534

Open
ntmhung opened this issue May 24, 2023 · 114 comments
Open

UPS API Change Request #37534

ntmhung opened this issue May 24, 2023 · 114 comments

Comments

@ntmhung
Copy link

ntmhung commented May 24, 2023

Description

My client has informed me that starting from June 5, 2023, UPS no longer issues new access keys. UPS is going to change to use Oauth 2.0.
image

I think the magento/module-ups module should be updated to meet the requirement. It needed to be done before June 5, 2023. This is the API document https://developer.ups.com/api/reference#operation/GenerateToken.

Expected behavior

The magento/module-ups supports using the OAuth security model from UPS.

Benefits

It will help new users planning to use the UPS shipping method connect to the UPS API after June 5, 2023.

Additional information

No response

Release note

No response

@m2-assistant
Copy link

m2-assistant bot commented May 24, 2023

Hi @ntmhung. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@chernenm
Copy link

@magento give me 2.4-develop

@techguysourav
Copy link

HI, Please provide patch to us so we continue to use UPS as shipping method

@rhoerr
Copy link

rhoerr commented Jun 2, 2023

This is a major S0 issue that Adobe will need to address in the immediate future.

The immediate impact is that starting this coming Monday, June 5 2023, merchants will no longer be able to add UPS rates to Magento. UPS will no longer generate any XML API keys, which Magento requires.

The long-term impact is that as of June 2024, every merchant that uses Magento's native UPS rate connector will no longer get rates from UPS. This has a high probability of breaking checkout, as most US merchants do not offer multiple parcel shipment providers.

Until this is resolved in Magento core, Merchants have the option of switching to a third party provider for their UPS rates, but that involves additional costs and setup. That's not an acceptable solution in the broad picture. See eg. https://twitter.com/saas_boss/status/1664354635346243585

@chernenm
Copy link

chernenm commented Jun 2, 2023

Hello @rhoerr,

Adobe team is working on a solution for new 2.4.6 customers.
All the current 2.4.4, 2.4.5 and 2.4.6 customers who are currently using the XML API gateway to get shipping rates from UPS are not affected and can continue utilize this API till its EOL in June 2024.
Adobe Commerce 2.4.7 will come with upgraded UPS REST API instead.

@rhoerr
Copy link

rhoerr commented Jun 2, 2023

Great, thank you for the info @chernenm . Will look forward to that in the 2.4.7 release coming up soon.

@techguysourav
Copy link

techguysourav commented Jun 3, 2023 via email

@ihaveathumb
Copy link

Seriously, this is not a joke! Something needs to be done about this, now. There is no point in using Magento if it can't calculate shipping. If this doesn't get fixed soon, I foresee a mass exodus from Magento.

@chernenm
Copy link

chernenm commented Jun 9, 2023

hello @ihaveathumb, @techguysourav,
Please check the official UPS extension at Magento marketplace https://marketplace.magento.com/ups-shipping.html
while Adobe is working on a solution for out of the box integration.

@rhoerr
Copy link

rhoerr commented Jun 9, 2023

@chernenm Is the message at the top of that extension listing still applicable?

IMPORTANT NOTE: This extension is currently available for merchants in POLAND, FRANCE, UNITED KINGDOM, GERMANY, ITALY, SPAIN, NETHERLANDS and BELGIUM ONLY. It will be available for merchants in other countries soon. At this time, please only install this extension if you are in the above-mentioned countries.

Also, when will 2.4.7 with the UPS REST API be released? There's not currently any published release date for 2.4.7, which suggests it won't be until sometime in 2024. That's cutting it close for the many merchants that will need to update.

Thanks

@chernenm
Copy link

chernenm commented Jun 9, 2023

hi @rhoerr,

The API update is planed to be included into 2.4.7-beta2 version which scheduled for October 2023. In addition we are working on a hotfix for new 2.4.6 customers and ensuring that UPS extension documentation is up to date at Magento marketplace.

@ihaveathumb
Copy link

hello @ihaveathumb, @techguysourav, Please check the official UPS extension at Magento marketplace https://marketplace.magento.com/ups-shipping.html while Adobe is working on a solution for out of the box integration.

That doesn't work for me, because I'm not in the very few countries that it supports.

@maxq
Copy link

maxq commented Aug 3, 2023

This is an issue as UPS will no longer generate keys and the extension on marketplace isn't for the USA!
So if you don't have keys then no UPS on your Magento site.
Not good at all.

@maxq
Copy link

maxq commented Aug 3, 2023

Can you still generate keys on UPS as I have not been able to?

@chernenm
Copy link

chernenm commented Aug 3, 2023

Hello, @maxq,

Adobe is currently working on the solution for this issue, we will be releasing a hotfix for 2.4.4, 2.4.5 and 2.4.6 customers.

@ihaveathumb
Copy link

ihaveathumb commented Aug 3, 2023 via email

@joemstar
Copy link

Is there any update on this?

@chernenm
Copy link

Hello @joemstar,

The fix will be published tomorrow, September 14 around noon CST at https://experienceleague.adobe.com/docs/commerce-knowledge-base/kb/overview.html?lang=en

@rhoerr
Copy link

rhoerr commented Sep 14, 2023

Thank you @chernenm! That's good to see.

@laconica-vasilij
Copy link

@chernenm for 2.4.3-p1 patch is applying?

@chernenm
Copy link

hello @laconica-vasilij, the patch is only applicable for supported versions of Adobe Commerce and Magento Open Source which are 2.4.4+

@maxq
Copy link

maxq commented Sep 19, 2023

Applied the patch, anyone know how to get credentials from UPS?

@laconica-vasilij
Copy link

Applied the patch, anyone know how to get credentials from UPS?

Look at the instructions https://developer.ups.com/get-started. You need to create an application to receive API keys

@maxq
Copy link

maxq commented Sep 26, 2023

Their API signup is so bad you go through all the steps then get this.
There is a non-technical issue with your request, in order to resolve it you will need to complete and submit the requested information. [Click Here to Resolve] so you click on it and get HTTP 400 bad request.

See this stuff so much nowadays wonder who's coding this stuff.

Also love this little gem.
ups-logic

@chernenm
Copy link

chernenm commented May 9, 2024

Hi @chernenm Is there any patch available for magento 2.3.5 ?

Hi Did you found answer for this version. We are also using same right now

Hi @rahuldambare,

Unfortunately we do not have a patch for a 2.3 versions, since it is no longer supported.

@vipin12117
Copy link

@chernenm Please connect us support@ecomplugins.com for magento 2.3.x support.

@vipin12117
Copy link

@Franciscof-Serfe Why flagged me ? why I can not help to other peoples ?

@yomyyo
Copy link

yomyyo commented May 21, 2024

Does anybody have issues not receiving their negotiated rates after switching?

@jaywilliams
Copy link
Contributor

Yes, same issue here.

@vipin12117
Copy link

@jaminion @yomyyo You must check API logs in magento var/log/shipping.log

"ShipmentRatingOptions" => array(
"TPFCNegotiatedRatesIndicator" => "Y",
"NegotiatedRatesIndicator" => "Y"
),

Then check admin setting if negotiated rates enabled in ups plugin.

If still facing issues then contact us support@ecomplugins.com

@vipin1211987
Copy link

you should check admin setting if enabled or check var/log/shipping.log if tag being pass ?

@jaywilliams
Copy link
Contributor

Admin settings are enabled, reviewing the log confirms that negotiated rates are being requested, but the returned rates are significantly higher than the rates the XML API is returning for identical shipments.

@vipin1211987
Copy link

Can you share api logs?

@jaminion
Copy link

Hey @jaywilliams if you are reviewing the log check and see if the "ResidentialAddressIndicator" is being passed in the request. In the new UPS REST API, they do not check the value of that parameter - they only check if it exists to determine if the request is residential or not. UPS also does not itemize out the residential rate adjustment in the data returned so it's difficult to determine if that's affecting you.

"ResidentialAddressIndicator" => "{$residentialAddressIndicator}"

It looks to me like they are still putting that parameter in the request and setting the value of it based on whether it's intended to be a residentially-rated request, rather than only including the parameter if it is to be rated residential.

@vipin1211987
Copy link

@jaywilliams i think issue with discounted rates.

$rateParams['RateRequest']['Shipment']['ShipmentRatingOptions']['NegotiatedRatesIndicator'] = "Y";

So need to confirm if above parameter being pass in request. Then need to review API response.

@jaywilliams
Copy link
Contributor

I've added the necessary lines to the API request, and am still getting significantly higher quotes on the REST API.

@jaminion the residential address indicator is being passed, which does increase the rates, but I am passing the same residential flag on the XML request so they should still be the same.

While debugging this issue, I've found that the stock M2 UPS REST patch sends "01" as the AddressLine on the Shipper and ShipTo, which doesn't appear to affect rates but is definitely not the correct address and should simply be removed.

@jaminion
Copy link

That's the really tricky thing about the residential indicator for rating on their REST API - they changed how it works (it's wild and awkward and I have no good things to say about it). It's difficult to get to the documentation as searching doesn't really work since they hide/show the content based on clicks. If you go the rating api, and look under Shipment->ShipTo->Address, there is a "ResidentialAddressIndicator" element, and their documentation there is:

Residential Address flag. This field is a flag to indicate if the destination is a residential location. True if ResidentialAddressIndicator tag exists; false otherwise. This element does not require a value and if one is entered it will be ignored.

Note: When requesting TimeInTransit information, this indicator must be passed to determine if Three Day Select or Ground shipment is eligible for Saturday Delivery at no charge. If this indicator is not present, address will be considered as commercial. Empty Tag.

If the rates are wildly off then yeah it's probably something else, but we were seeing differences from about $3 to $5.50 which were accounted for when editing the patch to change how that works (only include that entire element in that section conditionally).

@jflissar
Copy link

jflissar commented May 25, 2024 via email

@vipin1211987
Copy link

If you are facing lots of errors then hire any magento developer or buy any 3rd party extension.

@rahuldambare
Copy link

rahuldambare commented May 26, 2024

I have added patch of 2.4.4 in Magento 2.3 and override method in my custom module. However Sometimes I am getting error as "The shipping method is missing. Select the shipping method and try again." on payment page.

This error is coming from vendor/magento/module-quote/etc/di.xml from Magento\Quote\Model\ValidationRules\ShippingMethodValidationRule
I have check there is shipping amount available in quote by adding log. Still getting same error.

Even I have data available in total_segments shipping still this error shows. when moving from shipping page to payment page order summary gets reload and shipping amount removed from order summary .

Functions I have override in my custom module after adding patch in 2.3 version as below
protected function _getRestQuotes()
protected function _parseRestResponse($rateResponse)

My Customization are available on url https://www.file.io/YghI/download/vfXL5oVlg3Cd

@vipin1211987
Copy link

vipin1211987 commented May 27, 2024

Not able to open file There was an error retrieving your file.

Connect us at ecomplugins support for integration help.

@rahuldambare
Copy link

Upsphp.txt
Please check file here

@vipin1211987
Copy link

There are many issues. Main issue with ups token. You can not call again and again. There are API limits. You must cache it.

You have many hardcoded variables and using session which also created these type issues like sometime showing shipping methods and next call hide rates.

@rahuldambare
Copy link

Could you please highlight the code or provide some correction which can help to fix this bug.

@yomyyo
Copy link

yomyyo commented May 31, 2024

I've added the necessary lines to the API request, and am still getting significantly higher quotes on the REST API.

@jaminion the residential address indicator is being passed, which does increase the rates, but I am passing the same residential flag on the XML request so they should still be the same.

While debugging this issue, I've found that the stock M2 UPS REST patch sends "01" as the AddressLine on the Shipper and ShipTo, which doesn't appear to affect rates but is definitely not the correct address and should simply be removed.

Finally got word back from developer support. The issues with negotiated rate was due to using the non-production url to send our requests to (https://wwwcie.ups.com/api/rating/). We need to be using https://onlinetools.ups.com/api/rating/ to send our requests as that is the production URL

@fballiano
Copy link
Contributor

ok, the default values where changed in 20.9.0 but they're also configurable in the backend

@qrider
Copy link

qrider commented Jun 19, 2024

Hi,
Does anyone know of a 2.3 patch? @rahuldambare looks like your link expired.

@klou
Copy link

klou commented Sep 5, 2024

M2.4.7-p2

Leaving this for anybody else:

Using UPS Type: United Parcel Service REST, can confirm that the Gateway REST URL and the Tracking REST URL need to change to (https://onlinetools.ups.com/api/rating/) and (https://onlinetools.ups.com/api/track/) instead of the original defaults, which were pointing to (https://wwwcie.ups.com/api/ rating or track /)

With the defaults, tracking responses kept giving results for Tracking Number "1Z1202R66698804005", no matter what the request tracking number was.

@jaywilliams
Copy link
Contributor

@klou Thank you for sharing that information, that solves the issue I was experiencing with incorrect negotiated rates showing up.

I created this patch to change the Magento defaults to use the production API endpoint:

diff --git a/vendor/magento/module-ups/etc/config.xml b/vendor/magento/module-ups/etc/config.xml
index aaeccf87..10d21849 100644
--- a/vendor/magento/module-ups/etc/config.xml
+++ b/vendor/magento/module-ups/etc/config.xml
@@ -21,13 +21,13 @@
                 <free_method>GND</free_method>
                 <gateway_url>https://www.ups.com/using/services/rave/qcostcgi.cgi</gateway_url>
                 <gateway_xml_url>https://onlinetools.ups.com/ups.app/xml/Rate</gateway_xml_url>
-                <gateway_rest_url>https://wwwcie.ups.com/api/rating/</gateway_rest_url>
+                <gateway_rest_url>https://onlinetools.ups.com/api/rating/</gateway_rest_url>
                 <handling>0</handling>
                 <model>Magento\Ups\Model\Carrier</model>
                 <pickup>CC</pickup>
                 <title>United Parcel Service</title>
                 <tracking_xml_url>https://onlinetools.ups.com/ups.app/xml/Track</tracking_xml_url>
-                <tracking_rest_url>https://wwwcie.ups.com/api/track/</tracking_rest_url>
+                <tracking_rest_url>https://onlinetools.ups.com/api/track/</tracking_rest_url>
                 <unit_of_measure>LBS</unit_of_measure>
                 <username backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
                 <password backend_model="Magento\Config\Model\Config\Backend\Encrypted" />

I'd also like to make everyone aware that Magento has released updated patches which fix an issue with UPS dimensional shipping.
https://experienceleague.adobe.com/en/docs/commerce-knowledge-base/kb/troubleshooting/known-issues-patches-attached/ups-shipping-method-integration-migration-from-soap-to-restful-api

@glo05363
Copy link
Contributor

glo05363 commented Sep 9, 2024

@klou and @jaywilliams thanks for your observation onto the same, internal team is looking into this if this is a required change and we will update you ASAP on this.

@engcom-Bravo
Copy link
Contributor

Hi @ntmhung,

Internal team has looked into the issue and following are the observation:

As we have given the avenue of having a Live Account set as “No” by default which will work on sandbox authorisation and shipment. Where the user has the option of setting it up as “Yes” making it to production.

Screenshot 2024-09-09 at 6 54 34 PM

2.The same way as Live Account option , By Default we have given the Sandbox “Tracking” and “Rating” Urls which can be edited from admin panel to production Gateway Urls, and we kept the possibility open for the user to edit the same as they want.
Screenshot 2024-09-09 at 9 56 44 PM

We have tried to keep it streamlined for REST APIs. Having said that we also understand that this may have caused some confusion.
We will update the Developer documentation on “Sandbox” and “production” setup steps and information for the patches.

Thanks.

@engcom-Bravo
Copy link
Contributor

Hi @ntmhung,

Our internal team has updated the Developer documentation on “Sandbox” and “production” setup steps. Please go through the same while you are setting up the shipping.

We will update further on the default URLs change once delivered.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready for Grooming
Development

No branches or pull requests