Oak Harbor Web Services

Request Rate Quote documentation and example
Explanation
The requestRateQuote() web service provides you with the ability to request a rate quote and specify pickup location, and freight details like weight or pieces, class types, and a delivery point.
You can use the WSDL located at HTTP://www.oakh.com/services/soap?wsdl as the basis for programming or configuring your own SOAP client.

Below is a PHP example of a SOAP client configuration that can access this web service.
The code example shows the requisite values for requesting a rate quote that will:
	- pick up in Portland, OR 97203
	- deliver in Little Rock, AR 72202
	- have two ShipmentDetails of:
		class 50 with a weight of 350 pounds
		class 175 with a weight of 1025 pounds
		with a total piece count of 25
	- have Enhanced Services of:
		Notification Prior to Delivery
		Saturday Delivery

Requestor Types are as follows:
	S=Shipper
	C=Consignee
	B=3rd Party Bill-To

Payment Types are as follows:
	C=Collect
	P=Prepaid

Allowed codes for the type of Class are as follows:
	50, 55 ,60 ,65 ,70 ,77.5 ,85 ,92.5 ,100 ,110 ,125 ,150 ,175 ,200 ,250 ,300 ,400 ,500

Codes for Enhanced Services are as follows:
	AIRDE=Airport Delivery
	AIRPU=Airport Pickup
	APPT=Appointment
	COD=COD 	(amount is also required)
	EXCVAL=Excess Value (amount is also required)
	GH=Guaranteed Hour Specific 	(if GH is specified, GS can not be specified)
	GS=Guaranteed Standard 			(if GS is specified, GH can not be specified)
	HAZMAT=Hazardous Materials Fee
	INSIDE=Inside Delivery
	INSPU=Inside Pickup
	LIFTDC=Liftgate Delivery Collect (if LIFTDC is specified, LIFTDP can not be specified)
	LIFTDP=Liftgate Delivery Prepaid (if LIFTDP is specified, LIFTDC can not be specified)
	LIFTPP=Liftgate Pickup Prepaid
	LADE=Limited Access
	LONG15=Long Freight - Exceeds 15'
	LONG=Long Freight - Exceeds 27'
	NOTIFY=Notification Prior to Delivery
	RES=Residential Delivery
	RESLG=Residential Liftgate
	SADE=Saturday Delivery
	SEG=Sort & Segregate Charges

For SingleShipment:
	- This is a boolean value.  0=not a single shipment, 1=single shipment

For the Origin and Destination:
	- If you are not an OAKH customer or are an OAKH customer but not using the account/key parameters:
		You must specify the City, State and Zip.
	- If you are an OAKH customer and are using the account/key parameters:
		You can use the 'Code' parameter rather than City/State,Zip.
		(Using the Code parameter automatically applies rate discounts ,if any, for that customer location)
	- If you use a location Code, you can not specify City/State/Zip.  Similarly, if you use City/State/Zip, you can not specify a Code.

For ItemDetails:
	- You can specify up to five classes
	- Both Class and Weight must be present for each Item Detail line
	- You can optionally specify a total number of pieces

For Enhanced Services:
	- COD and Excess Value service types require an amount also be specified
	- If Guaranteed Hour Specific is specified, Guaranteed Standard can not alos be specified
	- If Guaranteed Standard is specified, Guaranteed Hour Specific can not also be specified


This is provided as an example only and only intended to guide you on how you may want to go about creating your own client to request a pickup using web service.
$soapClient = new SoapClient("http://www.oakh.com/services/soap?wsdl"); $requestRateQuoteData = array( 'account' => 'The account email associated with your key', 'key' => 'The key provided to you by Oak Harbor Freight', 'CompanyName'=>'Ace Widgets', 'ContactName'=>'John Doe', 'ContactPhone'=>5155551212, 'ContactEmail'=>'someone@domain.com', 'RequestorType'=>'S', 'PaymentType'=>'P', 'ShipmentDate'=>'07/04/2013', 'SingleShipment'=>'1', 'Origin'=>array( 'Code'=>null, 'Zip'=>97203, 'City'=>'portland', 'State'=>'OR', ), 'Destination'=>array( 'Code'=>null, 'Zip'=>72202, 'City'=>'Little Rock', 'State'=>'AR', ), 'ItemDetails'=>array( array( 'class'=>50, 'weight'=>350,), array( 'class'=>175, 'weight'=>1025,), ), 'Pieces'=>1, 'EnhancedServices'=>array( array('service'=>'NOTIFY'), array('service'=>'SADE'), ), ); $result = $soapClient->requestRateQuote($requestRateQuoteData);
Following the example, you will call the requestRateQuote(RateQuoteRequest) method with the input parameter being a structure conforming to the RateQuoteRequest definition from the WSDL and containing all of the pertinent information regarding your request. If an invalid rate quote parameters are requested or if any other error exists, a standard Soap Fault will be returned indicating the nature of the error. If successful, the response data will be a RateQuoteRequestResult structure as indicated in the WSDL, or a Soap Fault if unsuccessful: RateQuoteNumber QuoteDate QuoteValidUntil Origin (type of GeneralLocationResult) City State Zip DirectOrIndirect ServicedBy (type of Servicer) Carrier Phone Destination (type of GeneralLocationResult) City State Zip DirectOrIndirect ServicedBy (type of Servicer) Carrier Phone ShipDate Terms BillTo (type of BillTo) CompanyName Address1 Address2 City State Zip SingleShipment ShipmentDetails (type of ShipmentDetail, can be multiple) class weight rate amount Pieces Charges (type of ChargesResult) GrossWeight FreightCharge FuelSurcharge Accessorials (type of Accessorial, can be multiple) code description amount Net Tariff Likely errors described in the SOAP FAULT may be among the following: Invalid key specified for account Invalid Requestor Type Bill-To is an invalid Requestor Type when not authenticated Invalid Payment Type Payment Type of Collect is required for 'Consignee' Requestor Payment Type of Prepaid is required for '3rd Party Bill-To Only' Requestor Shipment Date is not a valid date Shipment Date can not be in the past Single Shipment value must be boolean #TYPE#(Origin/Destination) must be specified Missing #TYPE#(Origin/Destination) Parts. Either Code or Location must be specified. #TYPE#(Origin/Destination) parts must be either Code or Location, but not both Not authorized to the #TYPE#(Origin/Destination) Code Invalid #TYPE#(Origin/Destination) State/Province Origin State/Province is excluded from rate requests Invalid #TYPE#(Origin/Destination) location. Could not find the City/State/Zip combination. Company and all Contact Information is required when account validation is not used. Item Details are Required Class and Weight are required for each Item Detail line Invalid Item Class Invalid Item Weight. Weight must be greater than zero Invalid Pieces Service is required for each Enhanced Service Line Invalid Enhanced Service Amount Required for COD Amount Required for Excess Value Amount only valid for COD or Excess Value Guaranteed Standard OR Guaranteed Hour Specific can be specified, but not both Liftgate delivery Prepaid OR Liftgate delivery Collect can be specified, but not both Below is an example of a well-formed request with a successful result.

Request Header
POST /services/soap HTTP/1.1
Host: www.oakh.com
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.3.8-ZS5.5.0
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.oakh.com/services/soap#requestRateQuote"
Content-Length: 1416

Request Data
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.oakh.com/services/soap?wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<SOAP-ENV:Body>
		<ns1:requestRateQuote>
			<RateQuoteRequest>
				<account>##YOUR ACCOUNT EMAIL##</account>
				<key>##YOUR ACCOUNT KEY##</key>
				<CompanyName>Ace Widgets</CompanyName>
				<ContactName>John Does</ContactName>
				<ContactPhone>5155551212</ContactPhone>
				<ContactEmail>someone@domain.com</ContactEmail>
				<RequestorType>S</RequestorType>
				<PaymentType>P</PaymentType>
				<ShipmentDate>07/04/2013</ShipmentDate>
				<SingleShipment>1</SingleShipment>
				<Origin>
					<Code xsi:nil="true"/>
					<City>portland</City>
					<State>OR</State>
					<Zip>97203</Zip>
				</Origin>
				<Destination>
					<Code xsi:nil="true"/>
					<City>little rock</City>
					<State>AR</State>
					<Zip>72202</Zip>
				</Destination>
				<ItemDetails>
					<class>50</class>
					<weight>350</weight>
				</ItemDetails>
				<ItemDetails>
					<class>175</class>
					<weight>1025</weight>
				</ItemDetails>
				<Pieces>1</Pieces>
				<EnhancedServices>
					<service>NOTIFY</service>
					<amount xsi:nil="true"/>
				</EnhancedServices>
				<EnhancedServices>
					<service>SADE</service>
					<amount xsi:nil="true"/>
				</EnhancedServices>
			</RateQuoteRequest>
		</ns1:requestRateQuote>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response Header
"HTTP/1.1 200 OK
Date: Sat, 08 Jun 2013 17:27:50 GMT
Server: Apache
Content-Length: 1671
Connection: close
Content-Type: text/xml

Response Data
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.oakh.com/services/soap?wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<SOAP-ENV:Body>
		<ns1:requestRateQuoteResponse>
			<requestRateQuoteResponse>
				<RateQuoteNumber>2508519</RateQuoteNumber>
				<QuoteDate>06/08/13</QuoteDate>
				<QuoteValidUntil>07/08/13</QuoteValidUntil>
				<Origin>
					<City>PORTLAND</City>
					<State>OR</State>
					<Zip>97203</Zip>
					<DirectOrIndirect>Direct Point</DirectOrIndirect>
					<ServicedBy xsi:nil="true"/>
				</Origin>
				<Destination>
					<City>LITTLE ROCK</City>
					<State>AR</State>
					<Zip>72202</Zip>
					<DirectOrIndirect>Partner Direct</DirectOrIndirect>
					<ServicedBy>
						<Carrier>Southeastern Freight Lines</Carrier>
						<Phone>8006377335</Phone>
					</ServicedBy>
				</Destination>
				<ShipDate>06/08/13</ShipDate>
				<Terms>PrePaid</Terms>
				<BillTo>
					<CompanyName></CompanyName>
					<Address1></Address1>
					<Address2></Address2>
					<City></City>
					<State></State>
					<Zip></Zip>
				</BillTo>	
				<SingleShipment>1</SingleShipment>
				<ShipmentDetails>
					<class>50</class>
					<weight>350</weight>
					<rate>105.87</rate>
					<amount>370.55</amount>
				</ShipmentDetails>
				<ShipmentDetails>
					<class>175</class>
					<weight>1025</weight>
					<rate>316.11</rate>
					<amount>3240.13</amount>
				</ShipmentDetails>
				<Pieces>1</Pieces>
				<Charges>
					<GrossWeight>1375</GrossWeight>
					<FreightCharge>4,272.37</FreightCharge>
					<FuelSurcharge>833.11</FuelSurcharge>
					<Accessorials>
						<code>NOTIFY</code>
						<description>NOTIFY CHARGES</description>
						<amount>25.00</amount>
					</Accessorials>
					<Accessorials>
						<code>SADE</code>
						<description>SATURDAY DELIVERY</description>
						<amount>384.00</amount>
					</Accessorials>
					<Net>4019.15</Net>
				</Charges>
				<Tariff>OAKH500A.120702.010905</Tariff>
			</requestRateQuoteResponse>
		</ns1:requestRateQuoteResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>