UPS-API / api-documentation

MIT License
32 stars 19 forks source link

Void request not working #108

Open mxmissile opened 2 months ago

mxmissile commented 2 months ago

Sending a dev/test Delete request for a void using one the of the tracking numbers listed here. With this URL:

https://wwwcie.ups.com/api/shipments/v2403/void/cancel/1Z2220060291994175?trackingnumber=string

No matter which number I send it always returns

{"response":{"errors":[{"code":"190102","message":"No shipment found within the allowed void period"}]}}

The documentation says "A successful response will be returned for a package level void request. The request will void the package in the shipment."

Any ideas what I am doing wrong?

christianspecht commented 1 month ago

Same here. I'm also interested in a working solution.

christianspecht commented 1 month ago

OK, now I understand how it works. The problem was this part: ?trackingnumber=string

Valid URLs look like this:

The number that you used in your example (1Z2220060291994175) is, according to the documentation, a package number (and not a shipment id), but you're using it as a shipment id.

Try this instead:

https://wwwcie.ups.com/api/shipments/v2403/void/cancel/1Z2220060294314162?trackingnumber=1Z2220060291994175
nightcoding2021 commented 4 weeks ago

I realised voiding wasn't working last week. Having looked at the documentation, v1 now shows deprecated and replaced by v2403. However, v1 was returning the misleading error "No shipment found within the allowed void period". This error was resolved by changing version to v2403.

I was wondering if v2403 was even in the documentation a couple of months ago.

icyavocado commented 2 weeks ago

Still having issue with v2403

First issue is with the inconsitency between the doc and the actual behaviour.

Testing show the API working as expected with one tracking number

https://wwwcie.ups.com/api/shipments/v2403/void/cancel/1Z2220060294314162?trackingnumber=1Z2220060291994175

However when dealing with 2 packages, the format is not ["trackingnumber","trackingnumber"] but [trackingnumber,trackingnumber]

You can reproduce with this URL

DELETE /shipments/v2403/void/cancel/1ZISDE016691609089?trackingnumber=%5B1ZISDE016694068891%2C1ZISDE016690889305%5D

Second issue is the response is incorrectly formated, getting extra formating data in the decoded response.

Response ``` { "VoidShipmentResponse":{ "Response":{ "ResponseStatus":{ "Code":" 1", "Description":" Success" }, "TransactionReference":{ "CustomerContext":" testing", "TransactionIdentifier":" sxlhcXhZ84mMy05wzx" } }, "SummaryResult":{ "Status":{ "Code":" 1", "Description":" Voided" } }, "PackageLevelResult":[ { "TrackingNumber":" 1ZISDE016690889305", "Status":{ "Code":" 1", "Description":" Voided" } }, { "TrackingNumber":" 1ZISDE016694068891", "Status":{ "Code":" 1", "Description":" Voided" } } ] } } ```
Image taken from the try API ![image](https://github.com/UPS-API/api-documentation/assets/45118765/b0ac61dd-2f6c-4e6f-a4c7-cd235ed0efa2)