In my previous articles, I had explained the basic steps and requirements for integrating Fedex Web API into a website and discussed the implementation of the Rating API. We obtained the rates for different Fedex shipping services available from a source to destination using the Rating API.
Today I will discuss the Pickup Services, using which we can schedule a courier to pick up a shipment, cancel a pickup request, or check for pickup availability. Sometimes, after obtaining rates, we might want to further validate the availability of services in a location and the postal codes. In order to do that Fedex Web API standard services provides 2 more APIs, such as, Service Availability (under Validation Availability and Commitment) and Postal Code enquiry (under Country Service). As the names are self explanatory, here is a one line description about them.
Also Read: Importance Of Brand Positioning In Ecommerce
Postal Code Enquiry: This enables customers to validate postal codes and service commitment.
Service Availability: This determines which FedEx Express services are available between an origin and destination.
The basic file structure and implementation of these two and any other Fedex Web API is similar to the Rating API. However, I wont be going into the details of them today.
Getting back to the “Pickup Web Services”
It is one of the Advanced Services of the available Fedex Web API services. Go to the ‘Advanced Services’ tab of the Developer Resource Center once you have registered and logged into your account and followed the required steps to obtain the passwords and keys, as according to my previous articles.
Under the Advanced Services tab, you will find a header as ‘Pickup Services’ under which there are 3 APIs.
Fedex documentation explains as below:
The FedEx pickup web service allows you to schedule a courier to pick up a shipment, or to cancel a pickup request, or to check for pickup availability.
Pickup API: Use the Pickup Service to schedule courier pickup of a shipment at the location specified in the transaction.
Pickup Availability: Use Pickup Availability to obtain the cut-off and access the time required to request and schedule a pickup and pickup based on the specified area. You may check pickup availability for either FedEx Express or FedEx Ground shipments.
Once you have downloaded the API, unzip the files.
Note: Since I am not using PHP5, I have modified all the file extensions in PHP5 to PHP.
Note: Rather than using the file structure provided by the API, I have used the API code by implementing them into my functions for easier use and access as below. Though I had previously explained the Rating API as per the exact file structure given by Fedex Web API, I will be explaining implementation all the API codes through functions from now on. This makes them easier to implement, debug and use.
Soap request-response from server
The below function handles soap call requests and response to the Fedex server to obtain pickup availability data.
As you can see, it includes a ‘fedex-common.php’ file and a PickupService_v9.wsdl file. Both these files are present in the unzipped folder of the API.
Read more at http://blog.designs.codes/retain-customers/