Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fedex Web Services (SOAP): Pickup Service

Tags:

php

soap

fedex

I'm trying to schedule pickup using Pickup Service. First I send Pickup Availability request to get cutoff time, then use the result I get in Pickup Request. But after that I get error "Ready Time after Cutoff Time" for the time that is obviously before the cutoff time. In my example cutoff time returned is 16:00 but the latest time I can schedule pickup for is 11:00. Part of pickup availability response:

<v3:ScheduleDay>SAME_DAY</v3:ScheduleDay>
<v3:Available>true</v3:Available>
<v3:PickupDate>2013-04-02</v3:PickupDate>
<v3:CutOffTime>16:00:00</v3:CutOffTime>

Part of schedule pickup request that produces error:

<ns1:ReadyTimestamp>2013-04-02T13:00:00</ns1:ReadyTimestamp>
<ns1:CompanyCloseTime>20:00:00</ns1:CompanyCloseTime>

Here's full request/response code for two requests: http://pastebin.com/jqtfsRFc

UPD: More details according to the discussion in comments

That's what written about ReadyTimestamp The time must be no later than the CutOffTime, which can be discovered with the PickupAvailabilityRequest.

So I make a pickup availability request and see the reply:

<v3:ScheduleDay>SAME_DAY</v3:ScheduleDay>
<v3:Available>true</v3:Available>
<v3:PickupDate>2013-04-09</v3:PickupDate>
<v3:CutOffTime>16:00:00</v3:CutOffTime>

Documentation says that timestamps for Pickup Availability are used according to the local TZ (taken from zip code). Out local TZ is PST which has -07:00 offset from UTC. There's also a line in Pickup Availability reply that indicates the time when my Pickup Availability request was processed. I checked and see that it is also in PST so this step looks working fine: <v3:RequestTimestamp>2013-03-26T11:58:37</v3:RequestTimestamp>

So I got cutoff time 16:00 PST and the next step is to schedule actual pickup for the time that will not be later than cutoff time using Create Pickup request. For this request ReadyTimestamp should contain TZ info so I tried different date/time formats. So if I want to create pickup for 14:00 PST I try 2013-04-09T21:00:00, 2013-04-09T21:00:00.000Z, 2013-04-09T21:00:00+00:00, and 2013-04-09T14:00:00-07:00. In all of these cases I get error Ready Time after Cutoff Time. I tried many different values and discovered that the latest time it works for is 04:00 PST (same as 11:00 UTC). So 04:00 gives me success and 04:01 gives Ready Time after Cutoff Time and it works this way with any date/time format.

like image 865
yefrem Avatar asked Mar 27 '13 21:03

yefrem


People also ask

What is FedEx Web services?

Welcome to FedEx Web Services, your convenient source for developer guides, sample code, certification, production keys, and other information you will need to integrate FedEx into a website or application you're developing. Available Services.

How do I contact FedEx API?

CALL 1.866.393.4585 instructions on how to use FedEx API Portal. Are you an existing FedEx Web Services customer? If you're not ready to try out our new FedEx APIs, you can still access documentation and WSDLs for FedEx Web Services within the Developer Resource Center.

How do I get a FedEx developer account?

Get FedEx Developer Test CredentialsLog into your FedEx profile and visit the Developer Section. Visit the Develop and Test section, as shown in the image below and click on Get Your Test Key. Fill in the registration form for the Test Credentials, as shown in the image below.


1 Answers

Have you noticed that the ReadyTimestamp in the Example CreatePickupRequest on page 76

<q0:ReadyTimestamp>2011-08-02T08:00:18.282Z</q0:ReadyTimestamp>
<q0:CompanyCloseTime>17:00:00</q0:CompanyCloseTime>

Is given with the timezone code.

UPD. You can check php fedex api wrapper from github or fedex api wrapper from phpclasses.

like image 105
fitheflow Avatar answered Sep 17 '22 15:09

fitheflow