UPS Bill to Third Party Shipper?

蓝咒 提交于 2019-12-13 15:23:16

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!