Ups Bill to Third Party Shipper?

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
0

1 Answer

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest