问题
I'm trying to figure out how to bill a third party UPS Shipper Account Number using the API, When I try what I have listed below it doesn't work! It says "A single billing option is required per shipment" in the error message. Anyone have any idea whats wrong?
$ShipmentConfirmRequestXML->push('PaymentInformation');
$ShipmentConfirmRequestXML->push('Prepaid');
$ShipmentConfirmRequestXML->push('BillThirdParty');
$ShipmentConfirmRequestXML->element('AccountNumber', 'XXXXX');
$ShipmentConfirmRequestXML->pop(); // end BillShipper
$ShipmentConfirmRequestXML->pop(); // end Prepaid
$ShipmentConfirmRequestXML->pop(); // end PaymentInformation
回答1:
Third party billing is not within the Prepaid container. The end result XML should look something like this, based on the UPS API developers guide:
<PaymentInformation>
<BillThirdParty>
<BillThirdPartyShipper>
<AccountNumber>ABC123</AccountNumber>
<ThirdParty>
<Address>
<PostalCode>12345-6789</PostalCode>
<CountryCode>US</CountryCode>
</Address>
</ThirdParty>
</BillThirdPartyShipper>
</BillThirdParty>
</PaymentInformation>
For some reason, the UPS API will always fail with third party billing in test mode, giving a Transient 120001 error, "XML Shipping System is unavailable, please try again later". Switching off test mode fixes the problem - just void the shipment after you've confirmed your code works.
Also, if you ever enter an incorrect account code for third party billing, the same 120001 error will be returned.
来源:https://stackoverflow.com/questions/15256029/ups-bill-to-third-party-shipper