FedEx Web Services is the next generation API for integrating software applications with FedEx Systems. Web services represent the future application integration because they offer the following:
- Inter-operability: Any Web service can interact with any other Web service and can be written in any language.
- Ubiquity: Web services communicate using HTTP and XML--So any connected device that supports these technologies can both host and access Web Services.
- Low Barrier to Entry: The concepts behind Web services are easy to understand, and developers can quickly create and deploy them using many tool-kits available on the web.
- Industry Support: Major content providers and vendors are supporting the Web services movement.
View the Demo
Fedex Shipping Integration For International priority
The international priority for FedEx Shipping Codes is given below:
Codings:
<?php // Copyright 2009, FedEx Corporation. All rights reserved. // Version 12.0.0 require_once('../../../library/fedex-common.php5'); //The WSDL is not included with the sample code. //Please include and reference in $path_to_wsdl variable. $path_to_wsdl = "../../../wsdl/ShipService_v12.wsdl"; // PDF label file. Change to file-extension .pdf for creating a PDF label define('SHIP_LABEL', 'shipexpresslabel.pdf'); ini_set("soap.wsdl_cache_enabled", "0"); // Refer to http://us3.php.net/manual/en/ref.soap.php for more information $client = new SoapClient($path_to_wsdl, array('trace' => 1)); $request['WebAuthenticationDetail'] = array( 'UserCredential' =>array( 'Key' => getProperty('key'), 'Password' => getProperty('password') ) ); $request['ClientDetail'] = array( 'AccountNumber' => getProperty('shipaccount'), 'MeterNumber' => getProperty('meter') ); $request['TransactionDetail'] = array('CustomerTransactionId' => ' *** Express International Shipping Request v12 using PHP ***'); $request['Version'] = array( 'ServiceId' => 'ship', 'Major' => '12', 'Intermediate' => '1', 'Minor' => '0' ); $request['RequestedShipment'] = array( 'ShipTimestamp' => date('c'), 'DropoffType' => 'REGULAR_PICKUP', 'ServiceType' => 'INTERNATIONAL_PRIORITY', 'PackagingType' => 'YOUR_PACKAGING', 'Shipper' => addShipper(), 'Recipient' => addRecipient(), 'ShippingChargesPayment' => addShippingChargesPayment(), 'CustomsClearanceDetail' => addCustomClearanceDetail(), 'LabelSpecification' => addLabelSpecification(), 'CustomerSpecifiedDetail' => array( 'MaskedData'=> 'SHIPPER_ACCOUNT_NUMBER' ), 'RateRequestTypes' => array('ACCOUNT'), // valid values ACCOUNT and LIST 'PackageCount' => 1, 'RequestedPackageLineItems' => array( '0' => addPackageLineItem1() ), 'CustomerReferences' => array( '0' => array( 'CustomerReferenceType' => 'CUSTOMER_REFERENCE', 'Value' => 'TC007_07_PT1_ST01_PK01_SNDUS_RCPCA_POS' ) ) ); try { if(setEndpoint('changeEndpoint')) { $newLocation = $client->__setLocation(setEndpoint('endpoint')); } // FedEx web service invocation $response = $client->processShipment($request); if($response->HighestSeverity != 'FAILURE' && $response->HighestSeverity != 'ERROR') { printSuccess($client, $response); // Create PNG or PDF label // Set LabelSpecification.ImageType to 'PDF' for generating a PDF label $fp = fopen(SHIP_LABEL, 'wb'); fwrite($fp, ($response->CompletedShipmentDetail->CompletedPackageDetails ->Label->Parts->Image)); fclose($fp); echo 'Label <a href="./'.SHIP_LABEL.'">'.SHIP_LABEL.'</a> was generated.'; } else { printError($client, $response); } writeToLog($client); // Write to log file } catch (SoapFault $exception) { printFault($exception, $client); } function addShipper(){ $shipper = array( 'Contact' => array( 'PersonName' => 'Sender Name', 'CompanyName' => 'Sender Company Name', 'PhoneNumber' => '1234567890' ), 'Address' => array( 'StreetLines' => array('Address Line 1'), 'City' => 'Austin', 'StateOrProvinceCode' => 'TX', 'PostalCode' => '73301', 'CountryCode' => 'US' ) ); return $shipper; } function addRecipient(){ $recipient = array( 'Contact' => array( 'PersonName' => 'Recipient Name', 'CompanyName' => 'Company Name', 'PhoneNumber' => '1234567890' ), 'Address' => array( 'StreetLines' => array('Address Line 1'), 'City' => 'Richmond', 'StateOrProvinceCode' => 'BC', 'PostalCode' => 'V7C4V4', 'CountryCode' => 'CA', 'Residential' => false ) ); return $recipient; } function addShippingChargesPayment(){ $shippingChargesPayment = array( 'PaymentType' => 'SENDER', 'Payor' => array( 'ResponsibleParty' => array( 'AccountNumber' => getProperty('billaccount'), 'Contact' => null, 'Address' => array('CountryCode' => 'US') ) ) ); return $shippingChargesPayment; } function addLabelSpecification(){ $labelSpecification = array( 'LabelFormatType' => 'COMMON2D', // valid values COMMON2D, LABEL_DATA_ONLY 'ImageType' => 'PDF', // valid values DPL, EPL2, PDF, ZPLII and PNG 'LabelStockType' => 'PAPER_7X4.75'); return $labelSpecification; } function addSpecialServices(){ $specialServices = array( 'SpecialServiceTypes' => array('COD'), 'CodDetail' => array( 'CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150), 'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS ); return $specialServices; } function addCustomClearanceDetail(){ $customerClearanceDetail = array( 'DutiesPayment' => array( 'PaymentType' => 'SENDER', //valid values RECIPIENT,SENDER and THIRD_PARTY 'Payor' => array( 'ResponsibleParty' => array( 'AccountNumber' => getProperty('dutyaccount'), 'Contact' => null, 'Address' => array('CountryCode' => 'US') ) ) ), 'DocumentContent' => 'NON_DOCUMENTS', 'CustomsValue' => array( 'Currency' => 'USD', 'Amount' => 100.0 ), 'Commodities' => array( '0' => array( 'NumberOfPieces' => 1, 'Description' => 'Books', 'CountryOfManufacture' => 'US', 'Weight' => array( 'Units' => 'LB', 'Value' => 1.0 ), 'Quantity' => 4, 'QuantityUnits' => 'EA', 'UnitPrice' => array( 'Currency' => 'USD', 'Amount' => 100.000000 ), 'CustomsValue' => array( 'Currency' => 'USD', 'Amount' => 400.000000 ) ) ), 'ExportDetail' => array( 'B13AFilingOption' => 'NOT_REQUIRED' ) ); return $customerClearanceDetail; } function addPackageLineItem1(){ $packageLineItem = array( 'SequenceNumber'=>1, 'GroupPackageCount'=>1, 'Weight' => array( 'Value' => 20.0, 'Units' => 'LB'), 'Dimensions' => array( 'Length' => 20, 'Width' => 20, 'Height' => 10, 'Units' => 'IN') ); return $packageLineItem; } ?>
Related Posts:
1. 413 “Request Entity Too Large” error with uploading a file
2. Difference between cookies and sessions in php
3. How to create a .webp image in PHP
4. How to expire PHP session after a period of time
5. How to resolved when Logged out sessions get restored by back button
6. why javascript contains property is not working in chrome browser
7. what are the differences between json and jsonp
8. Abstract Class in Php
1. 413 “Request Entity Too Large” error with uploading a file
2. Difference between cookies and sessions in php
3. How to create a .webp image in PHP
4. How to expire PHP session after a period of time
5. How to resolved when Logged out sessions get restored by back button
6. why javascript contains property is not working in chrome browser
7. what are the differences between json and jsonp
8. Abstract Class in Php
Yah I Have The Code How to use it....please tell me in detail imean step by step thanks in advance....
ReplyDeleteHi karteek,
ReplyDeletewe can easily develop the FedEx shipping in php.Initially we will create the shipments option in backend. It s like how many products u want to ship?Then u will passing the shipment products details,sender information about (like ur company name and address details),receiver information is Customer details.the following details u will send the FedEx through the Web service. They will send the response based on the ur request.For this we can generate the Awb no and barcode generations.then print the customize label.
I apply this code, but it returns error like:
ReplyDeleteWarning: require_once(../../../library/fedex-common.php5): failed to open stream: No such file or directory in C:\xampp\htdocs\fedex_demo.php on line 6
Fatal error: require_once(): Failed opening required '../../../library/fedex-common.php5' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\fedex_demo.php on line 6
How can i solve these errors? Please give some idea..
Thanks..
FedEx
ReplyDeletei want to print the sender and receipt shipping label code in fedex one is shipping label and one is COD(Collect on Delivery ) label so plz provide me the code one you have done the label for shipping but not for COD basis label.
ReplyDeleteHi,
ReplyDeleteI need to use fedex shipment request for multiple shipment request. Can you tell what should i change for it in this shipment request ?
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteError returned in processing transaction
ReplyDeleteSeverity: ERROR
Source: prof
Code: 1000
Message: Authentication Failed
HTML Pro Team is among the Top 10 NYC Best Agencies & Developers in 2017; got experience of working with a number of Sketch to HTML Projects. HTML Pro is counted among the best Sketch to HTML Company world-wide due to its immense focus on converting and sensibly layering your Sketch design files into fully mobile responsive HTML codes consisting of W3C valid HTML5/CSS3 codes, all manually generated & hand crafted by our experienced front-end developers. We excel at rendering high quality & well-structured Sketch to responsive HTML conversion service with our appropriate workforce.
ReplyDeleteNo other company in the world finds all possible measures just to get that pouch, envelope or box to its destination on time all the time. FedEx Saturday delivery hours
ReplyDeleteThis is very educational content and written well for a change. It's nice to see that some people still understand how to write a quality post.! furniture shipping quote
ReplyDeleteI gotta favorite this website it seems very helpful . antiques shipping service
ReplyDeletehttps://bayanlarsitesi.com/
ReplyDeleteYenibosna
Anadolu Kavağı
İçerenköy
Yeşilköy
JQ2
664B8
ReplyDeleteGümüşhane Evden Eve Nakliyat
Bayburt Şehirler Arası Nakliyat
Maraş Şehirler Arası Nakliyat
Isparta Lojistik
Bitget Güvenilir mi
Manisa Parça Eşya Taşıma
Huobi Güvenilir mi
Pursaklar Parke Ustası
Mercatox Güvenilir mi
6D27D
ReplyDeletebinance referans kodu
AF0A8
ReplyDeleteSweat Coin Hangi Borsada
Coin Kazma Siteleri
Twitter Trend Topic Hilesi
Twitter Beğeni Hilesi
Kripto Para Madenciliği Nedir
Apenft Coin Hangi Borsada
Alyattes Coin Hangi Borsada
Casper Coin Hangi Borsada
Binance Yaş Sınırı
7362A
ReplyDeleteThreads Yeniden Paylaş Hilesi
Görüntülü Sohbet
Linkedin Takipçi Hilesi
Tumblr Beğeni Satın Al
Kripto Para Madenciliği Nasıl Yapılır
Okex Borsası Güvenilir mi
Bitcoin Kazanma
Telegram Abone Satın Al
Pepecoin Coin Hangi Borsada
CN VHBMNH
ReplyDeleteشركة تسليك مجاري بالجبيل
شركة عزل اسطح بحائل EOZKUprl4s
ReplyDeleteشركة تنظيف فلل بالقطيف RvxcRDmLj8
ReplyDeleteشركة مكافحة النمل الابيض بالاحساء jY27Sh9Ecw
ReplyDeleteشركة مكافحة الحشرات بالاحساء bKo1mRA9aO
ReplyDeleteشركة تنظيف مجالس بالجبيل Pq5kGr71av
ReplyDeleteشركة عزل اسطح بالجبيل gbZCfQ6xW5
ReplyDeleteشركة تنظيف بالاحساء tNMTkOCvyK
ReplyDeleteشركة تسليك مجاري بالدمام StoCavKZqy
ReplyDeleteDDBF2CC83F
ReplyDeletetürk takipçi