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.