简体   繁体   中英

Fedex API - Authentication Failed for creating shipping labels only

Development for fedex API is finished and I'm trying to make the switch to production.

I use the following constants for my credentials:

FEDEX_KEY // The fedex production key
FEDEX_PASSWORD // The api passwd
FEDEX_ACCOUNT_NUMBER // The account number tied to the key/pw
FEDEX_METER_NUMBER // The meter number tied to the key/pw

As stated in the "move to production" I have removed the "beta" attribute from all the .wsdl files.

I'm getting live estimates for cost of shipments which tells me my credentials are reading properly.

The problem is creating shipment labels isnt working and its giving me the following error:

The transaction returned an Error.
Severity: ERROR
Source: prof
Code: 1000
Message: Authentication Failed

Request
//Hiding this due to containing private information
Response
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><v17:ProcessShipmentReply xmlns:v17="http://fedex.com/ws/ship/v17"> <v17:HighestSeverity xmlns:v17="http://fedex.com/ws/ship/v17">ERROR</v17:HighestSeverity>  <v17:Notifications xmlns:v17="http://fedex.com/ws/ship/v17">     <v17:Severity xmlns:v17="http://fedex.com/ws/ship/v17">ERROR</v17:Severity>     <v17:Source xmlns:v17="http://fedex.com/ws/ship/v17">prof</v17:Source>     <v17:Code xmlns:v17="http://fedex.com/ws/ship/v17">1000</v17:Code>     <v17:Message xmlns:v17="http://fedex.com/ws/ship/v17">Authentication Failed</v17:Message>  </v17:Notifications> <v17:TransactionDetail xmlns:v17="http://fedex.com/ws/ship/v17"><v17:CustomerTransactionId xmlns:v17="http://fedex.com/ws/ship/v17">*** Ground Domestic Shipping Request using PHP ***</v17:CustomerTransactionId> </v17:TransactionDetail>  <v17:Version xmlns:v17="http://fedex.com/ws/ship/v17">     <v17:ServiceId xmlns:v17="http://fedex.com/ws/ship/v17">ship</v17:ServiceId>     <v17:Major xmlns:v17="http://fedex.com/ws/ship/v17">17</v17:Major>     <v17:Intermediate xmlns:v17="http://fedex.com/ws/ship/v17">0</v17:Intermediate>     <v17:Minor xmlns:v17="http://fedex.com/ws/ship/v17">0</v17:Minor>  </v17:Version> </v17:ProcessShipmentReply></SOAP-ENV:Body></SOAP-ENV:Envelope>

Here is the call I'm making

//Creating new SoapClient and setting path to the Shipping .wsdl
$path_to_wsdl = $_SERVER['DOCUMENT_ROOT']."/portal/API/FedEx/wsdl/ShipService_v17.wsdl";
$client = new SoapClient($path_to_wsdl, array('trace' => 1));

//This is the snippet where I set the credentials
$masterRequest['WebAuthenticationDetail'] = array(
    'ParentCredential' => array(
        'Key' => getProperty('parentkey'),
        'Password' => getProperty('parentpassword')
    ),
    'UserCredential' => array(
        'Key' => FEDEX_KEY, 
        'Password' => FEDEX_PASSWORD
    )
);
$masterRequest['ClientDetail'] = array(
    'AccountNumber' => FEDEX_ACCOUNT_NUMBER, 
    'MeterNumber' => FEDEX_METER_NUMBER
);

FedEx account number and meter number are different in test vs live mode - did you change them accordingly? You can't use the same values in test and live mode.

You can get the production meter number in the FedEx Developer Resource Center as well, in the "Move to Production" section.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM