If you're talking about validating the input to see if it's in the correct format for an account number, then it would take a small RegEx to do that. What constitutes a valid format would have to be defined by UPS and FedEx. You'd have to ask them what formats are valid in their developer portals.
If you're asking if you can see if the account number really exists, last I checked, you can't. Admittedly, that was a long time ago. Again, your best source of information on that would be the developer portals for UPS and FedEx.
UPS[
^] and
FedEx[
^]