karrioapi / karrio

Programmable Shipping APIs (self-hosted)
https://karrio.io
Apache License 2.0
560 stars 104 forks source link

[FEDEX] Schedule a pickup empty empty response #690

Closed vangelow closed 1 month ago

vangelow commented 2 months ago

Describe the bug Using the Karrio schedule a pickup endpoint returns a status code of 424 and and empty response.

I have managed to test a bit with Postman and the results are the same. Adding the encoding attr xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" to tsn:Envelope fixed the problem via Postman. (see screenshots bellow)

To Reproduce Steps to reproduce the behavior: Make a HTTP POST to /v1/pickups/fedex_ws/schedule Body:

{
  "address": {
    "address_line1": "SOME_VALID_ADDRESS",
    "city": "SOME_VALID_CITY",
    "country_code": "EG",
    "residential": false,
    "validate_location": false
  },
  "closing_time": "18:00",
  "pickup_date": "2024-09-21",
  "ready_time": "10:00",
  "tracking_numbers": [
    "SOME_VALID_TRACKING_NUMBER"
  ]
}

Expected behavior A response from the karrio API is received, in this case the request is even a successful one when i add the missing attributes manually in postman

Screenshots image image image

Desktop (please complete the following information):

Additional context Add any other context about the problem here. @danh91 Would appreciate if you think of a workaround while fixing this so that we can finalize the pickups

ChrisNolan commented 2 months ago

Have you considered using 'fedex' instead of 'fedex_ws'? i.e. the REST API instead of the SOAP one? As you may have seen, they recently turned off the SOAP for some of the services (Tracking, Address verification, couple others) and I've been told they plan to continue to turn off parts of the SOAP 'web services' going forward. I was going to make changes to my 'pickup request' stuff which is still using the SOAP too, but decided, nah give me some time to switch over to the REST instead so I won't have to re-do it 'soon'.

I haven't confirmed Karrio's support of the pickup api specifically yet though. Fedex's notes @ https://developer.fedex.com/api/en-us/catalog/pickup/docs.html

An aside, if you're talking to somebody internal at Fedex, they think of it has 'dispatch', and not 'pickup', which confused me for a bit (but makes sense -- they are dispatching a vehicle, based on our request for a pickup).

vangelow commented 2 months ago

With a bit of digging today I think I have the same conclusion. Thanks for the info also. I will see if karrio has the REST version integrated, but hopefully has. In this case we will stick to fedex only and drop fedex_ws. I will close the issue with ws if REST does the some job

danh91 commented 2 months ago

Hi @vangelow , I will add the xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" to the request. Thanks for testing it.

Though as @ChrisNolan mentioned, it is a matter of time before FedEx completely stop support for the webservice. Our effort would be better spent adding and testing Pickup support for the REST API.

vangelow commented 1 month ago

@danh91 @ChrisNolan Do you guys expect to have a pickup capability in the fedex integration with RES API soon ? Right now the capabilities of fedex connection is ['tracking', 'rating', 'shipping', 'paperless']

danh91 commented 1 month ago

@danh91 @ChrisNolan Do you guys expect to have a pickup capability in the fedex integration with RES API soon ? Right now the capabilities of fedex connection is ['tracking', 'rating', 'shipping', 'paperless']

Yes, I didn't add it when I was upgrading because of lack of time and because few to no user I were using the Pickup API. I can't make a promise of timeline when I will be able to add it. But I will add it to priorities. Please keep an eye for the upcoming release as it will need live testing and feedback to make it production ready.