The challenge is not whether your posted solution is correct. Sure, the $result[10] works. No question. Kudos. Thanks for sharing what you've learned and helping to make the project better for everyone.

The reason for my questions is to determin whether it's the "best" or "most complete" solution.

What I'm most interested in is not so much the return code details, but the $errcode result that's being returned, and driving the various case() statements. Knowing why each of those conditions might be encountered is the key to knowing which of these lines should or shouldn't use $result[10], and even whether using $result[3] is correct for case 6, etc.

Hence the request for a copy of the API docs.

I've been waiting 2 weeks for UPS to cough up the documentation after going through their normal application process, as I had another issue I wanted to analyze in the same module for other reasons.