title: Laravel FedEx Integration
body: <p>I was able to generate</p>
  <p>Api keys, passwords, url of fedex account and moved to production</p>
  <p>however I am receiving an error</p>
  <p><a href="https://i.stack.imgur.com/nAHsH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nAHsH.png" alt="enter image description here" /></a></p>
  <p>Here's my code</p>
  <pre><code>    // Production
      $key = '7*************I';
      $password = 'E******************x';
      $account_number = '5*******0';
      $meter_number = '2********2';
      $ws_link = &quot;https://ws.fedex.com:443/web-services&quot;;
  
      // Shipper
      $sender_name = 'John Doe';
      $sender_postal = '92121';
      $sender_company = 'Company, Inc';
      $sender_phone = '8586779931';
      $sender_streetline = '5755 Oberlin Dr. Suite #106';
      $sender_city = 'San Diego';
      $sender_state = 'CA';
      $sender_countrycode = 'US';
  
  
      // Recipient
      $receiver_name = 'Hi-Tech';
      $receiver_postal = '92126';
      $receiver_company = 'Tekcopia';
      $receiver_phone = '8382371231';
      $receiver_streetline = '9495 Candida Street';
      $receiver_city = 'San Diego';
      $receiver_state = 'CA';
      $receiver_countrycode = 'US';
  
      // Product
      $height = '12';
      $width = '12';
      $length = '12';
      $unit = 'IN';
  
      $weight_type = 'LB';
      $weight_value = '20';
  
     $xml = '&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
      &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:ns1=&quot;'.$ws_link.'&quot;&gt;&lt;SOAP-ENV:Body&gt;&lt;ns1:RateRequest&gt;
      &lt;ns1:WebAuthenticationDetail&gt;
      &lt;ns1:UserCredential&gt;
      &lt;ns1:Key&gt;'.$key.'&lt;/ns1:Key&gt;
      &lt;ns1:Password&gt;'.$password.'&lt;/ns1:Password&gt;
      &lt;/ns1:UserCredential&gt;&lt;/ns1:WebAuthenticationDetail&gt; 
      &lt;ns1:ClientDetail&gt;
      &lt;ns1:AccountNumber&gt;'.$account_number.'&lt;/ns1:AccountNumber&gt;
      &lt;ns1:MeterNumber&gt;'.$meter_number.'&lt;/ns1:MeterNumber&gt;
      &lt;/ns1:ClientDetail&gt;
      &lt;ns1:TransactionDetail&gt;
          &lt;ns1:CustomerTransactionId&gt; *** Rate Request v13 using PHP ***&lt;/ns1:CustomerTransactionId&gt;
      &lt;/ns1:TransactionDetail&gt;
      &lt;ns1:Version&gt;
          &lt;ns1:ServiceId&gt;crs&lt;/ns1:ServiceId&gt;
          &lt;ns1:Major&gt;13&lt;/ns1:Major&gt;
          &lt;ns1:Intermediate&gt;0&lt;/ns1:Intermediate&gt;
          &lt;ns1:Minor&gt;0&lt;/ns1:Minor&gt;
      &lt;/ns1:Version&gt;
      &lt;ns1:ReturnTransitAndCommit&gt;true&lt;/ns1:ReturnTransitAndCommit&gt;
      &lt;ns1:RequestedShipment&gt;
      
      &lt;ns1:DropoffType&gt;REGULAR_PICKUP&lt;/ns1:DropoffType&gt;
      &lt;ns1:ServiceType&gt;FEDEX_EXPRESS_SAVER&lt;/ns1:ServiceType&gt;
      
      &lt;ns1:PackagingType&gt;YOUR_PACKAGING&lt;/ns1:PackagingType&gt;
      &lt;ns1:TotalInsuredValue&gt;&lt;ns1:Currency&gt;USD&lt;/ns1:Currency&gt;&lt;/ns1:TotalInsuredValue&gt;
      
      
      &lt;ns1:Shipper&gt;&lt;ns1:Contact&gt;&lt;ns1:PersonName&gt;'.$sender_name.'&lt;/ns1:PersonName&gt;&lt;ns1:CompanyName&gt;'.$sender_company.'&lt;/ns1:CompanyName&gt;&lt;ns1:PhoneNumber&gt;'.$sender_phone.'&lt;/ns1:PhoneNumber&gt;&lt;/ns1:Contact&gt;&lt;ns1:Address&gt;&lt;ns1:StreetLines&gt;'.$sender_streetline.'&lt;/ns1:StreetLines&gt;&lt;ns1:City&gt;'.$sender_city.'&lt;/ns1:City&gt;&lt;ns1:StateOrProvinceCode&gt;'.$sender_state.'&lt;/ns1:StateOrProvinceCode&gt;
      &lt;ns1:PostalCode&gt;'.$sender_postal.'&lt;/ns1:PostalCode&gt;&lt;ns1:CountryCode&gt;'.$sender_countrycode.'&lt;/ns1:CountryCode&gt;&lt;/ns1:Address&gt;&lt;/ns1:Shipper&gt;
     
     
      &lt;ns1:Recipient&gt;&lt;ns1:Contact&gt;&lt;ns1:PersonName&gt;'.$receiver_name.'&lt;/ns1:PersonName&gt;&lt;ns1:CompanyName&gt;'.$receiver_company.'&lt;/ns1:CompanyName&gt;&lt;ns1:PhoneNumber&gt;'.$receiver_phone.'&lt;/ns1:PhoneNumber&gt;&lt;/ns1:Contact&gt;&lt;ns1:Address&gt;&lt;ns1:StreetLines&gt;'.$receiver_streetline.'&lt;/ns1:StreetLines&gt;&lt;ns1:City&gt;'.$receiver_city.'&lt;/ns1:City&gt;&lt;ns1:StateOrProvinceCode&gt;'.$receiver_state.'&lt;/ns1:StateOrProvinceCode&gt;
      &lt;ns1:PostalCode&gt;'.$receiver_postal.'&lt;/ns1:PostalCode&gt;
      
      
      &lt;ns1:CountryCode&gt;'.$receiver_countrycode.'&lt;/ns1:CountryCode&gt;&lt;ns1:Residential&gt;false&lt;/ns1:Residential&gt;&lt;/ns1:Address&gt;&lt;/ns1:Recipient&gt;&lt;ns1:ShippingChargesPayment&gt;&lt;ns1:PaymentType&gt;SENDER&lt;/ns1:PaymentType&gt;&lt;ns1:Payor&gt;
      &lt;ns1:ResponsibleParty&gt;
      
      &lt;ns1:AccountNumber&gt;'.$account_number.'&lt;/ns1:AccountNumber&gt;
      &lt;/ns1:ResponsibleParty&gt;
      &lt;/ns1:Payor&gt;&lt;/ns1:ShippingChargesPayment&gt;
      
      &lt;ns1:RateRequestTypes&gt;ACCOUNT&lt;/ns1:RateRequestTypes&gt;&lt;ns1:PackageCount&gt;1&lt;/ns1:PackageCount&gt;&lt;ns1:RequestedPackageLineItems&gt;&lt;ns1:SequenceNumber&gt;1&lt;/ns1:SequenceNumber&gt;
      &lt;ns1:GroupPackageCount&gt;1&lt;/ns1:GroupPackageCount&gt;
      
      &lt;ns1:Weight&gt;&lt;ns1:Units&gt;'.$weight_type.'&lt;/ns1:Units&gt;&lt;ns1:Value&gt;'.$weight_value.'&lt;/ns1:Value&gt;&lt;/ns1:Weight&gt;
      &lt;ns1:Dimensions&gt;
      
      &lt;ns1:Length&gt;'.$length.'&lt;/ns1:Length&gt;
      &lt;ns1:Width&gt;'.$width.'&lt;/ns1:Width&gt;
      &lt;ns1:Height&gt;'.$height.'&lt;/ns1:Height&gt;
      &lt;ns1:Units&gt;'.$unit.'&lt;/ns1:Units&gt;
      &lt;/ns1:Dimensions&gt;
      &lt;/ns1:RequestedPackageLineItems&gt;
      &lt;/ns1:RequestedShipment&gt;&lt;/ns1:RateRequest&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;';
  
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $ws_link );
      curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
      curl_setopt($ch, CURLOPT_VERBOSE, 1);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_POST, 1);
      $result_xml = curl_exec($ch);
  
      $result_xml = str_replace(array(':','-'), '', $result_xml);
      $result = @simplexml_load_string($result_xml);
      $array = array([
          'result'  =&gt; $result
      ]);
      return $array;
  </code></pre>