Pickup Request
Pickup Request
Endpoint
https://tms.targetfmi.com/index.php?p=api&r=json&c=pickupRequest&m=schedulePickup
Request Parameters
Parameter | Required | Available Options/Data Type | Description |
---|---|---|---|
test | No | 1 or 0 / int | When the test flag is provided in the request body, a successful mock response is returned without contacting the carrier. This flag can be used during development to avoid scheduling real pickup requests with carriers. |
schedulePickup | Yes | n/a | Schedule pickup container node. |
schedulePickup/pickupDateTime | Yes | date and time / string | Your local ready time. The time when your shipment can be ready for carrier to pickup. Restrictions may apply. Contact carrier for details. (Example: 'August 21, 2019 08:00 AM') |
schedulePickup/dockCloseTime | Yes | date and time / string | Your local close time. The time when your loading docks will close, the latest time a carrier will arrive. Restrictions may apply. Contact carrier for details. (Example: 'August 21, 2019 05:00 PM') |
general/saved_bol | Yes | bol date and id / string | Concatenation of the bill of lading date and id from the bill of lading execute endpoint. (Example '201908219999') |
Examples
Using an Array
<?php /** * Pickup Request Example (Using Array Format) */ require_once "../../restClient.class.php"; $resource = "https://tms.targetfmi.com/index.php"; $user = "your_api_key_goes_here"; $pass = ""; $separator = "?"; $rest = new restClient($resource, $user, $pass, $separator); // The request data is abbreviated here, but this demonstrates where to include the additional information. $request = array( 'schedulePickup' => array( 'pickupDateTime' => 'August 21, 2019 08:00 AM', 'dockCloseTime' => 'August 21, 2019 05:00 PM' ), 'carrier' => array( ), 'special' => array( ), 'general' => array( 'saved_bol' => '201908219999' ), 'location' => array( ), 'units' => array( ) ); $response = $rest->post("p=api&r=text&c=pickupRequest&m=schedulePickup", $request); ?>
Response Parameters
Parameter Name | Description |
---|---|
body | |
body/ProNumber | This may or may not be returned by a carrier. |
body/ConfirmationNumber | This may or may not be returned by a carrier. |
body/TransactionID | This may or may not be returned by a carrier. |
Example
Example Response (Success)
Array ( [body] => Array ( [ProNumber] => [ConfirmationNumber] => PIT-0327829 [TransactionID] => ) [message] => Array ( [0] => Array ( [type] => success [message] => Saved transit information. [stacktrace] => Array ( [0] => model [1] => saveTransitInfo [2] => ) ) ) )
Example Response (Error)
Array ( [body] => Array ( [ProNumber] => [ConfirmationNumber] => PIT-0327829 [TransactionID] => ) [message] => Array ( [0] => Array ( [type] => alert [message] => There was an error trying to update the Bill of Lading. [stacktrace] => Array ( [0] => model [1] => schedule_pickup [2] => 500.11 ) ) [1] => Array ( [type] => error [message] => An error occured saving the BoL. [stacktrace] => Array ( [0] => model [1] => save_new_bol [2] => 500.2 ) ) [2] => Array ( [type] => alert [message] => We could not update the BoL details with a PRO. Database Error! Contact IS Immediately! [stacktrace] => Array ( [0] => model [1] => schedule_pickup [2] => 500.9 ) ) ) )
Full Example
Example
<?php require_once('../../restClient.class.php'); $resource = 'https://tms.targetfmi.com/index.php'; // Response has been set to json for these endpoints so we can work with response data $lcc = 'p=api&r=json&c=rater&m=lcc'; $execute = 'p=api&r=json&c=billoflading&m=execute'; // Response has been set to text for this endpoint $pickupRequest = 'p=api&r=text&c=pickupRequest&m=schedulePickup'; $user = 'your_api_key_goes_here'; $pass = ''; $separator = '?'; $rest = new restClient($resource, $user, $pass, $separator); /** * LCC Example (Using Array Format) */ $request = array( 'general' => array( 'code' => 'CODE', 'shipper' => 15236, 'consignee' => 15236, 'shipment_type' => "Outbound/Prepaid", ), 'units' => array( array( 'num_of' => 1, 'type' => 'pallet', 'stack' => 'No', 'length' => 40, 'width' => 40, 'height' => 48, 'products' => array( array( 'pieces' => 1, 'weight' => 250, 'class' => 175, ), ), ), ), ); $response = $rest->post($lcc, $request); // Turn JSON into object $carriers = json_decode($response); // Very basic error handling if(empty($carriers->body->carriers)) { die('There are no carriers available.'); } $query_id = $carriers->body->query_id; $carrier = $carriers->body->carriers[0]->scac; /** * Bill of Lading Example (Using Array Format) */ $request = array( 'carrier' => array( 'query_id' => $query_id, 'carrier_scac' => $carrier, ), 'special' => array(), 'general' => array( 'pro' => '', 'saved_bol' => '', 'bol' => '', 'po' => '', 'so' => '', 'ref' => '', 'status' => '', 'warehouse' => 'CODE', 'direction' => 'Outbound/Prepaid', ), 'location' => array( 'shipper' => array( 'name' => 'Test Shipper Company Name', 'address1' => '123 Sesame St', 'address2' => '', 'city' => 'Pittsburgh', 'state' => 'PA', 'zip' => '15236', 'country' => '', 'contact_name' => 'Test Shipper Contact Name', 'contact_phone' => '000-000-0000', 'contact_fax' => '', 'contact_email' => 'contact@example.com', 'save' => FALSE, ), 'consignee' => array( 'name' => 'Test Consignee Company Name', 'address1' => '123 Sesame St', 'address2' => '', 'city' => 'Pittsburgh', 'state' => 'PA', 'zip' => '15236', 'country' => '', 'contact_name' => 'Test Consignee Contact Name', 'contact_phone' => '000-000-0000', 'contact_fax' => '', 'contact_email' => 'contact@example.com', 'save' => FALSE, ), 'billing' => array( 'name' => 'Test Billing Company Name', 'address1' => '123 Sesame St', 'address2' => '', 'city' => 'Pittsburgh', 'state' => 'PA', 'zip' => '15236', 'country' => '', 'contact_name' => 'Test Billing Contact Name', 'contact_phone' => '000-000-0000', 'contact_fax' => '', 'contact_email' => 'contact@example.com', 'save' => FALSE, ), ), 'units' => array( array( 'details' => array( 'pieces' => 1, 'stack' => 0, 'type' => 'Pallet', 'length' => 36, 'width' => 36, 'height' => 36, ), 'products' => array( array( 'product' => 'A Test Product', 'pieces' => 1, 'uom' => 'Piece', 'nmfc' => '', 'sub_nmfc' => '', 'class' => 50, 'weight' => 300, 'hazmat' => array(), ), ), ), ), ); $response = $rest->post($execute, $request); // Turn JSON into object $bolData = json_decode($response); // Very basic error handling if(empty($bolData->body->bolId)) { die('Bill of lading was not saved.'); } // Concatenate bill of lading date and id $bolId = $bolData->body->bolId; $bolDate = $bolData->body->date; $savedBOL = $bolDate . $bolId; $request = array( 'schedulePickup' => array( 'pickupDateTime' => 'August 30, 2019 08:00 AM', 'dockCloseTime' => 'August 30, 2019 05:00 PM' ), 'carrier' => array( 'query_id' => $query_id, 'carrier_scac' => $carrier, ), 'special' => array(), 'general' => array( 'pro' => '', 'saved_bol' => $savedBOL, 'bol' => '', 'po' => '', 'so' => '', 'ref' => '', 'status' => '', 'warehouse' => 'CODE', 'direction' => 'Outbound/Prepaid', ), 'location' => array( 'shipper' => array( 'name' => 'Test Shipper Company Name', 'address1' => '123 Sesame St', 'address2' => '', 'city' => 'Pittsburgh', 'state' => 'PA', 'zip' => '15236', 'country' => '', 'contact_name' => 'Test Shipper Contact Name', 'contact_phone' => '000-000-0000', 'contact_fax' => '', 'contact_email' => 'contact@example.com', 'save' => FALSE, ), 'consignee' => array( 'name' => 'Test Consignee Name', 'address1' => '123 Seseame St', 'address2' => '', 'city' => 'Pittsburgh', 'state' => 'PA', 'zip' => '15236', 'country' => '', 'contact_name' => 'Test Consignee Contact Name', 'contact_phone' => '000-000-0000', 'contact_fax' => '', 'contact_email' => 'contact@example.com', 'save' => FALSE, ), 'billing' => array( 'name' => 'Test Billing Company Name', 'address1' => '123 Sesame St', 'address2' => '', 'city' => 'Pittsburgh', 'state' => 'PA', 'zip' => '15236', 'country' => '', 'contact_name' => 'Test Billing Contact Name', 'contact_phone' => '000-000-0000', 'contact_fax' => '', 'contact_email' => 'contact@example.com', 'save' => FALSE, ), ), 'units' => array( array( 'details' => array( 'pieces' => 1, 'stack' => 0, 'type' => 'Pallet', 'length' => 36, 'width' => 36, 'height' => 36, ), 'products' => array( array( 'product' => 'A Test Product', 'pieces' => 1, 'uom' => 'Piece', 'nmfc' => '', 'sub_nmfc' => '', 'class' => 50, 'weight' => 300, 'hazmat' => array(), ), ), ), ), ); $response = $rest->post($pickupRequest, $request); ?>
, multiple selections available, Use left or right arrow keys to navigate selected items