logo P4D

The P4D API: PlaceBooking

 
This is the final function and is used to place a booking directly on our system. Before you can place a booking you must have already used the GetQuote function and have a QuoteID and ItemID that you would like to book.

Input Fields

Field Name Required? Description Example
ShipAction YES This tells our system which function you require PlaceBooking
Username YES You must specify your username joebloggs
APIKey YES This is available from your Shipping Manager account page HJ1E6DOTRDXAOLB
QuoteID YES The QuoteID obtained from GetQuote QUOTESSWIRHSIX6EXH
ItemID YES The OptionID obtained from GetQuote 950
CollectionDate   The date you would like the item to be collected
If specified, this date must have been returned by the CollectionTimes function.
2008-06-10
ReadyFrom   The time the item will be ready from on the above date. If specified, this time must have been returned by the CollectionTimes function.

N.B. If you leave either the CollectionDate or ReadyFrom blank then the earliest available collection date/time will be automatically used.

11:00
SpecialComments   Enter a message here that will be passed to the collecting driver. We can't guarantee that the driver will always follow these instructions though.

Please try and avoid calling between 3pm and 3.30pm

Output Fields
 

Field Name Description Example
ShipAction Confirmation of the function used PlaceBooking
Status Either Success or Error Success
RequestDate The date your request was received (yyyy-mm-dd hh:mm:ss) 2008-01-10 12:15:31
Username The username used to make the request joebloggs
OrderNumber A PSM order number for your booking PSM12345
OldBalance Your top-up balance before the booking 500.00
NewBalance Your top-up balance after the booking 492.96
TransactionID A 10 digit transaction reference API1234567

Example Input

Array
(
    [ShipAction] => PlaceBooking
    [Username] => joebloggs
    [APIKey] => HJ1E6DOTRDXAOL4LWAA
    [QuoteID] => QUOTESSWIRHSIX6EXH
    [ItemID] => 632
    [CollectionDate] => 2008-06-10
    [ReadyFrom] => 11:00
)


Example Output
 
Array
(
    [ShipAction] => PlaceBooking
    [Status] => Success
    [RequestDate] => 2008-07-06 02:24:16
    [Username] => joebloggs
    [OrderNumber] => PSM123456
    [OldBalance] => 500.00
    [NewBalance] => 492.96
    [TransactionID] => API1234567
)