title: Fedex PHP API Integration for indian address
body: <p>Does anyone integrated fedex API in PHP to generate tracking numbers and shipping label? I am submitting below XML to fedex -</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:m0="http://fedex.com/ws/ship/v19"&gt;
  
  &lt;SOAP-ENV:Body&gt;
  
  &lt;ProcessShipmentRequest xmlns="http://fedex.com/ws/ship/v19"&gt;
  
  &lt;WebAuthenticationDetail&gt;
  
  &lt;UserCredential&gt;
  
  &lt;Key&gt;avpSZAQRg9gu3zfm&lt;/Key&gt;
  
  &lt;Password&gt;gSmYLbjJwCYYVsoIwfp2ux2FY&lt;/Password&gt;
  
  &lt;/UserCredential&gt;
  
  &lt;/WebAuthenticationDetail&gt;
  
  &lt;ClientDetail&gt;
  
  &lt;AccountNumber&gt;604794161&lt;/AccountNumber&gt;
  
  &lt;MeterNumber&gt;100339204&lt;/MeterNumber&gt;
  
  &lt;/ClientDetail&gt;
  
  &lt;TransactionDetail&gt;
  
  &lt;CustomerTransactionId&gt;8787&lt;/CustomerTransactionId&gt;
  
  &lt;/TransactionDetail&gt;
  
  &lt;Version&gt;
  
  &lt;ServiceId&gt;ship&lt;/ServiceId&gt;
  
  &lt;Major&gt;19&lt;/Major&gt;
  
  &lt;Intermediate&gt;0&lt;/Intermediate&gt;
  
  &lt;Minor&gt;0&lt;/Minor&gt;
  
  &lt;/Version&gt;
  
  &lt;RequestedShipment&gt;
  
  &lt;ShipTimestamp&gt;2017-07-29T12:34:56-06:00&lt;/ShipTimestamp&gt;
  
  &lt;DropoffType&gt;REGULAR_PICKUP&lt;/DropoffType&gt;
  
  &lt;ServiceType&gt;STANDARD_OVERNIGHT&lt;/ServiceType&gt;
  
  &lt;PackagingType&gt;YOUR_PACKAGING&lt;/PackagingType&gt;
  
  &lt;Shipper&gt;
  
  &lt;Contact&gt;
  
  &lt;PersonName&gt;Piyush Rana&lt;/PersonName&gt;
  
  &lt;CompanyName&gt;Eclators&lt;/CompanyName&gt;
  
  &lt;PhoneNumber&gt;9925383633&lt;/PhoneNumber&gt;
  
  &lt;EMailAddress&gt;rana@gmail.com&lt;/EMailAddress&gt;
  
  &lt;/Contact&gt;
  
  &lt;Address&gt;
  
  &lt;StreetLines&gt;14-B-5&lt;/StreetLines&gt;
  
  &lt;StreetLines&gt;DkPark&lt;/StreetLines&gt;
  
  &lt;City&gt;Surat&lt;/City&gt;
  
  &lt;StateOrProvinceCode&gt;Gujarat&lt;/StateOrProvinceCode&gt;
  
  &lt;PostalCode&gt;395007&lt;/PostalCode&gt;
  
  &lt;CountryCode&gt;IN&lt;/CountryCode&gt;
  
  &lt;/Address&gt;
  
  &lt;/Shipper&gt;
  
  &lt;Recipient&gt;
  
  &lt;Contact&gt;
  
  &lt;PersonName&gt;Panakj Rana&lt;/PersonName&gt;
  
  &lt;CompanyName&gt;pp&lt;/CompanyName&gt;
  
  &lt;PhoneNumber&gt;9252905058&lt;/PhoneNumber&gt;
  
  &lt;EMailAddress&gt;php.pankaj@gmail.com&lt;/EMailAddress&gt;
  
  &lt;/Contact&gt;
  
  &lt;Address&gt;
  
  &lt;StreetLines&gt;Near yadav floor mill&lt;/StreetLines&gt;
  
  &lt;StreetLines&gt;sarvodaya basti&lt;/StreetLines&gt;
  
  &lt;City&gt;Bikaner&lt;/City&gt;
  
  &lt;StateOrProvinceCode&gt;rajasthan&lt;/StateOrProvinceCode&gt;
  
  &lt;PostalCode&gt;334004&lt;/PostalCode&gt;
  
  &lt;CountryCode&gt;IN&lt;/CountryCode&gt;
  
  &lt;/Address&gt;
  
  &lt;/Recipient&gt;
  
  &lt;ShippingChargesPayment&gt;
  
  &lt;PaymentType&gt;SENDER&lt;/PaymentType&gt;
  
  &lt;Payor&gt;
  
  &lt;ResponsibleParty&gt;
  
  &lt;AccountNumber&gt;604794161&lt;/AccountNumber&gt;
  
  &lt;Contact&gt;
  
  &lt;ContactId&gt;12345&lt;/ContactId&gt;
  
  &lt;PersonName&gt;shanu rana&lt;/PersonName&gt;
  
  &lt;/Contact&gt;
  
  &lt;/ResponsibleParty&gt;
  
  &lt;/Payor&gt;
  
  &lt;/ShippingChargesPayment&gt;
  
  &lt;SpecialServicesRequested&gt;
  
  &lt;SpecialServiceTypes&gt;ELECTRONIC_TRADE_DOCUMENTS&lt;/SpecialServiceTypes&gt;
  
  &lt;/SpecialServicesRequested&gt;
  
  &lt;CustomsClearanceDetail&gt;
  
  &lt;DutiesPayment&gt;
  
  &lt;PaymentType&gt;SENDER&lt;/PaymentType&gt;
  
  &lt;Payor&gt;
  
  &lt;ResponsibleParty&gt;
  
  &lt;AccountNumber&gt;604794161&lt;/AccountNumber&gt;
  
  &lt;Contact&gt;
  
  &lt;ContactId&gt;12345&lt;/ContactId&gt;
  
  &lt;PersonName&gt;Input Your Information&lt;/PersonName&gt;
  
  &lt;/Contact&gt;
  
  &lt;/ResponsibleParty&gt;
  
  &lt;/Payor&gt;
  
  &lt;/DutiesPayment&gt;
  
  &lt;DocumentContent&gt;DOCUMENTS_ONLY&lt;/DocumentContent&gt;
  
  &lt;CustomsValue&gt;
  
  &lt;Currency&gt;INR&lt;/Currency&gt;
  
  &lt;Amount&gt;100.00&lt;/Amount&gt;
  
  &lt;/CustomsValue&gt;
  
  &lt;Commodities&gt;
  
  &lt;NumberOfPieces&gt;1&lt;/NumberOfPieces&gt;
  
  &lt;Description&gt;ABCD&lt;/Description&gt;
  
  &lt;CountryOfManufacture&gt;US&lt;/CountryOfManufacture&gt;
  
  &lt;Weight&gt;
  
  &lt;Units&gt;LB&lt;/Units&gt;
  
  &lt;Value&gt;1.0&lt;/Value&gt;
  
  &lt;/Weight&gt;
  
  &lt;Quantity&gt;1&lt;/Quantity&gt;
  
  &lt;QuantityUnits&gt;cm&lt;/QuantityUnits&gt;
  
  &lt;UnitPrice&gt;
  
  &lt;Currency&gt;INR&lt;/Currency&gt;
  
  &lt;Amount&gt;1.000000&lt;/Amount&gt;
  
  &lt;/UnitPrice&gt;
  
  &lt;CustomsValue&gt;
  
  &lt;Currency&gt;INR&lt;/Currency&gt;
  
  &lt;Amount&gt;100.000000&lt;/Amount&gt;
  
  &lt;/CustomsValue&gt;
  
  &lt;/Commodities&gt;
  
  &lt;ExportDetail&gt;
  
  &lt;ExportComplianceStatement&gt;30.37(f)&lt;/ExportComplianceStatement&gt;
  
  &lt;/ExportDetail&gt;
  
  &lt;/CustomsClearanceDetail&gt;
  
  &lt;LabelSpecification&gt;
  
  &lt;LabelFormatType&gt;COMMON2D&lt;/LabelFormatType&gt;
  
  &lt;ImageType&gt;PNG&lt;/ImageType&gt;
  
  &lt;LabelStockType&gt;PAPER_7X4.75&lt;/LabelStockType&gt;
  
  &lt;/LabelSpecification&gt;
  
  &lt;ShippingDocumentSpecification&gt;
  
  &lt;ShippingDocumentTypes&gt;COMMERCIAL_INVOICE&lt;/ShippingDocumentTypes&gt;
  
  &lt;CommercialInvoiceDetail&gt;
  
  &lt;Format&gt;
  
  &lt;ImageType&gt;PDF&lt;/ImageType&gt;
  
  &lt;StockType&gt;PAPER_LETTER&lt;/StockType&gt;
  
  &lt;ProvideInstructions&gt;1&lt;/ProvideInstructions&gt;
  
  &lt;/Format&gt;
  
  &lt;/CommercialInvoiceDetail&gt;
  
  &lt;/ShippingDocumentSpecification&gt;
  
  &lt;RateRequestTypes&gt;LIST&lt;/RateRequestTypes&gt;
  
  &lt;PackageCount&gt;1&lt;/PackageCount&gt;
  
  &lt;RequestedPackageLineItems&gt;
  
  &lt;SequenceNumber&gt;1&lt;/SequenceNumber&gt;
  
  &lt;Weight&gt;
  
  &lt;Units&gt;LB&lt;/Units&gt;
  
  &lt;Value&gt;20.0&lt;/Value&gt;
  
  &lt;/Weight&gt;
  
  &lt;Dimensions&gt;
  
  &lt;Length&gt;12&lt;/Length&gt;
  
  &lt;Width&gt;12&lt;/Width&gt;
  
  &lt;Height&gt;12&lt;/Height&gt;
  
  &lt;Units&gt;IN&lt;/Units&gt;
  
  &lt;/Dimensions&gt;
  
  &lt;CustomerReferences&gt;
  
  &lt;CustomerReferenceType&gt;CUSTOMER_REFERENCE&lt;/CustomerReferenceType&gt;
  
  &lt;Value&gt;TC001_01_PT1_ST01_PK01_SNDUS_RCPCA_POS&lt;/Value&gt;
  
  &lt;/CustomerReferences&gt;
  
  &lt;/RequestedPackageLineItems&gt;
  
  &lt;/RequestedShipment&gt;
  
  &lt;/ProcessShipmentRequest&gt;
  
  &lt;/SOAP-ENV:Body&gt;
  
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>But getting below output -</p>
  
  <p>SimpleXMLElement Object
  (
      [@attributes] => Array
          (
              [xmlnsSOAPENV] => http//schemas.xmlsoap.org/soap/envelope/
          )</p>
  
  <pre><code>[SOAPENVHeader] =&gt; SimpleXMLElement Object
      (
      )
  
  [SOAPENVBody] =&gt; SimpleXMLElement Object
      (
          [ProcessShipmentReply] =&gt; SimpleXMLElement Object
              (
                  [HighestSeverity] =&gt; ERROR
                  [Notifications] =&gt; SimpleXMLElement Object
                      (
                          [Severity] =&gt; ERROR
                          [Source] =&gt; ship
                          [Code] =&gt; 2200
                          [Message] =&gt; Missing or Invalid Shipment purpose for Commercial Invoice
                          [LocalizedMessage] =&gt; Missing or Invalid Shipment purpose for Commercial Invoice
                      )
  
                  [TransactionDetail] =&gt; SimpleXMLElement Object
                      (
                          [CustomerTransactionId] =&gt; 8787
                      )
  
                  [Version] =&gt; SimpleXMLElement Object
                      (
                          [ServiceId] =&gt; ship
                          [Major] =&gt; 19
                          [Intermediate] =&gt; 0
                          [Minor] =&gt; 0
                      )
  
              )
  
      )
  </code></pre>
  
  <p>)</p>
  
  <p>What is the issue with this api? Please suggest. Or if anyone already integrated then please provide us the code snippet which i can use to generate fedex tracking number and shipping label.</p>