Pickup Request
R+L Carriers's Pickup Request API is simple to implement on your end and critical to managing your pickup requests. We provide the pickup options you need to get your shipments moving.
Create a Pickup Request
HTTP Method: POST
URL: /PickupRequest
URL: /PickupRequest
Request Parameters
Name | Type | Cardinality | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Pickup | object | One | Required | The pickup request object to be created | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SendEmailConfirmation | boolean | One | Optional | The default value is true. |
Response Parameters
Name | Type | Cardinality | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PickupRequestId | integer | One | Newly created pickup request Id | ||||||||||||||||||||
Code | integer | One | HTTP status code | ||||||||||||||||||||
Errors | array | One | Returned errors | ||||||||||||||||||||
Properties
|
|||||||||||||||||||||||
Messages | array | One | Returned informational messages | ||||||||||||||||||||
Properties
|
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/PickupRequest');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key',
'Content-Type' => 'application/json'
));
$request->setBody('{
\n "Pickup": {
\n "Shipper": {
\n "CompanyName": "Shipper Test",
\n "AddressLine1": "123 ship test",
\n "PhoneNumber": "6145558888",
\n "City": "Ocala",
\n "StateOrProvince": "FL",
\n "ZipOrPostalCode": "34471",
\n "CountryCode": "USA"
\n },
\n "Destinations": [
\n {
\n "Weight": 200,
\n "Pieces": 1,
\n "PackageType": "SKD",
\n "City": "Wilmington",
\n "StateOrProvince": "OH",
\n "ZipOrPostalCode": "45177",
\n "CountryCode": "USA"
\n }
\n ],
\n "PickupDate": "08/14/2020",
\n "ReadyTime": "08:00 AM",
\n "CloseTime": "05:00 PM",
\n "ServiceLevel": "Standard"
\n }
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts.PickupRequest;
using CallAPI.DataContracts.PickupRequest.Request;
using CallAPI.DataContracts.PickupRequest.Response;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace CallAPI
{
class PickupSample
{
string apiKey = "Your API Key";
public CreatePickupResponse CreatePickup()
{
var request = new CreatePickupRequest()
{
Pickup = PopulateCreatePickupData()
};
var response = new CreatePickupResponse();
var url = "{baseurl}/PickupRequest/";
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var apiResponse = client.PostAsJsonAsync(url, request).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}
return response;
}
private AddPickup PopulateCreatePickupData()
{
var destination = new Destination()
{
CountryCode = "USA",
ZipOrPostalCode = "45177",
City = "Wilmington",
StateOrProvince = "OH",
Weight = 200,
Pieces = 1,
PackageType = "SKD"
};
var shipper = new Shipper()
{
CompanyName = "Shipper Test",
AddressLine1 = "123 ship test",
CountryCode = "USA",
ZipOrPostalCode = "34471",
City = "Ocala",
StateOrProvince = "FL",
PhoneNumber = "6145558888"
};
List destinations = new List();
destinations.Add(destination);
AddPickup addPickup = new AddPickup()
{
Shipper = shipper,
PickupDate = DateTime.Now.ToShortDateString(),
ReadyTime = "08:00 AM",
CloseTime = "05:00 PM",
AdditionalInstructions = "",
Destinations = destinations,
ServiceLevel = "Standard"
};
return addPickup;
}
}
}
package Samples;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URI;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import com.fasterxml.jackson.databind.ObjectMapper;
import DataContracts.Pickup.AddPickup;
import DataContracts.Pickup.Contact;
import DataContracts.Pickup.Destination;
import DataContracts.Pickup.Pickup;
import DataContracts.Pickup.Shipper;
import DataContracts.Pickup.Request.CancelPickupRequest;
import DataContracts.Pickup.Request.CreatePickupRequest;
import DataContracts.Pickup.Request.UpdatePickupRequest;
import DataContracts.Pickup.Response.CancelPickupResponse;
import DataContracts.Pickup.Response.CreatePickupResponse;
import DataContracts.Pickup.Response.GetPickupResponse;
public class PickupSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();
public CreatePickupResponse CreatePickup() throws Exception{
CreatePickupResponse response = new CreatePickupResponse();
CreatePickupRequest request = new CreatePickupRequest();
request.Pickup = PopulatePickupData();
String requestJSON = mapper.writeValueAsString(request);
String url = "{baseurl}/PickupRequest";
HttpClient httpClient = HttpClientBuilder.create().build();
HttpPost httpRequest = new HttpPost(url);
StringEntity params =new StringEntity(requestJSON);
httpRequest.addHeader("content-type", "application/json");
httpRequest.addHeader("apiKey", apiKey);
httpRequest.setEntity(params);
HttpResponse httpResponse = httpClient.execute(httpRequest);
BufferedReader rd = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
response = mapper.readValue(result.toString(), CreatePickupResponse.class);
return response;
}
private AddPickup PopulateCreatePickupData()
{
Contact contact = null;
Destination destination = new Destination();
destination.CountryCode = "USA";
destination.ZipOrPostalCode = "45177";
destination.City = "Wilmington";
destination.StateOrProvince = "OH";
destination.Weight = 200;
destination.Pieces = 1;
destination.PackageType = "SKD";
Shipper shipper = new Shipper();
shipper.CompanyName = "Shipper Test";
shipper.AddressLine1 = "123 ship test";
shipper.CountryCode = "USA";
shipper.ZipOrPostalCode = "34471";
shipper.City = "Ocala";
shipper.StateOrProvince = "FL";
shipper.PhoneNumber = "6145558888";
List destinations = new ArrayList();
destinations.add(destination);
AddPickup addPickup = new AddPickup();
addPickup.Shipper = shipper;
addPickup.PickupDate = LocalDate.now().format(DateTimeFormatter.ofPattern("MM/dd/yyyy"));
addPickup.ReadyTime = "08:00 AM";
addPickup.CloseTime = "05:00 PM";
addPickup.AdditionalInstructions = "";
addPickup.LoadAttributes = new ArrayList();
addPickup.Contact = contact;
addPickup.Destinations = destinations;
addPickup.ServiceLevel = "Standard";
addPickup.HourlyWindow = null;
addPickup.ExpeditedQuoteNumber = "";
return addPickup;
}
}
Get a previous Pickup Request
HTTP Method: GET
URL: /PickupRequest
URL: /PickupRequest
Request Parameters
Name | Type | Cardinality | Required | Description |
---|---|---|---|---|
PickupRequestId | integer | One | Required | The R+L Pickup Request Id |
Response Parameters
Name | Type | Cardinality | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Pickup | object | One | Returned pickup object | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PickupRequestId | integer | One | Returned pickup object Id | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Code | integer | One | HTTP status code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Errors | array | One | Returned errors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Messages | array | One | Returned informational messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
Example Request
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/PickupRequest?PickupRequestId=1111111');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts.Pickup;
using CallAPI.DataContracts.Pickup.Request;
using CallAPI.DataContracts.Pickup.Response;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
namespace CallAPI.Samples
{
class PickupSample
{
string apiKey = "Your API Key";
//GET
public GetPickupResponse GetPickup()
{
var pickupRequestID = 1111111;
var url = string.Format("{baseurl}/PickupRequest?PickupRequestId={0}", pickupRequestID);
var response = new GetPickupResponse();
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var apiResponse = client.GetAsync(url).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}
return response;
}
}
}
package Samples;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URI;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import com.fasterxml.jackson.databind.ObjectMapper;
import DataContracts.Pickup.AddPickup;
import DataContracts.Pickup.Contact;
import DataContracts.Pickup.Destination;
import DataContracts.Pickup.Pickup;
import DataContracts.Pickup.PickupBase;
import DataContracts.Pickup.Shipper;
import DataContracts.Pickup.Request.CancelPickupRequest;
import DataContracts.Pickup.Request.CreatePickupFromBOL;
import DataContracts.Pickup.Request.CreatePickupRequest;
import DataContracts.Pickup.Request.UpdatePickupRequest;
import DataContracts.Pickup.Response.CancelPickupResponse;
import DataContracts.Pickup.Response.CreatePickupResponse;
import DataContracts.Pickup.Response.GetPickupResponse;
public class PickupSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();
public GetPickupResponse GetPickup() throws Exception {
GetPickupResponse response = new GetPickupResponse();
String url = "{baseurl}/PickupRequest";
int pickupRequestID = 1111111;
url += "?PickupRequestId=" + pickupRequestID;
HttpClient httpClient = HttpClientBuilder.create().build();
HttpGet httprequest = new HttpGet(url);
httprequest.setHeader("apiKey", apiKey);
HttpResponse httpResponse = httpClient.execute(httprequest);
BufferedReader in = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
String inputLine;
StringBuffer result = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
result.append(inputLine);
}
in.close();
response = mapper.readValue(result.toString(), GetPickupResponse.class);
return response;
}
}
Update a Pickup Request
HTTP Method: PUT
URL: /PickupRequest
URL: /PickupRequest
Request Parameters
Name | Type | Cardinality | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PickupRequestId | integer | One | Required | The pickup request Id to be updated | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pickup | object | One | Required | The pickup request object to be inserted | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
Response Parameters
Name | Type | Cardinality | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PickupRequestId | integer | One | Newly created pickup request Id | ||||||||||||||||||||
Code | integer | One | HTTP status code | ||||||||||||||||||||
Errors | array | One | Returned errors | ||||||||||||||||||||
Properties
|
|||||||||||||||||||||||
Messages | array | One | Returned informational messages | ||||||||||||||||||||
Properties
|
Example Request
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/PickupRequest');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key',
'Content-Type' => 'application/json'
));
$request->setBody('{
\n "PickupRequestId": 1111111,
\n "Pickup": {
\n "Destinations": [
\n {
\n "Weight": 200,
\n "Pieces": 1,
\n "PackageType": "BAG",
\n "City": "Melvin",
\n "StateOrProvince": "OH",
\n "ZipOrPostalCode": "45177",
\n "CountryCode": "USA"
\n }
\n ],
\n "PickupDate": "08/18/2020",
\n "ReadyTime": "08:00 AM",
\n "CloseTime": "05:00 PM",
\n "ServiceLevel": "Standard"
\n }
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts.Pickup;
using CallAPI.DataContracts.Pickup.Request;
using CallAPI.DataContracts.Pickup.Response;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
namespace CallAPI.Samples
{
class PickupSample
{
string apiKey = "Your API Key";
//PUT
public CreatePickupResponse UpdatePickup()
{
var request = new UpdatePickupRequest()
{
PickupRequestId = 1111111,
Pickup = PopulateUpdatePickupData()
};
var response = new CreatePickupResponse();
var url = "{baseurl}/PickupRequest/";
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var apiResponse = client.PutAsJsonAsync(url, request).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}
return response;
}
private Pickup PopulateUpdatePickupData()
{
var destination = new Destination()
{
CountryCode = "USA",
ZipOrPostalCode = "45177",
City = "Melvin",
StateOrProvince = "OH",
Weight = 200,
Pieces = 1,
PackageType = "BAG"
};
List destinations = new List();
destinations.Add(destination);
Pickup addPickup = new Pickup()
{
PickupDate = DateTime.Now.AddDays(4).ToShortDateString(),
ReadyTime = "08:00 AM",
CloseTime = "05:00 PM",
AdditionalInstructions = "",
Destinations = destinations,
ServiceLevel = "Standard"
};
return addPickup;
}
}
}
package Samples;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URI;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import com.fasterxml.jackson.databind.ObjectMapper;
import DataContracts.Pickup.AddPickup;
import DataContracts.Pickup.Contact;
import DataContracts.Pickup.Destination;
import DataContracts.Pickup.Pickup;
import DataContracts.Pickup.Shipper;
import DataContracts.Pickup.Request.CancelPickupRequest;
import DataContracts.Pickup.Request.CreatePickupRequest;
import DataContracts.Pickup.Request.UpdatePickupRequest;
import DataContracts.Pickup.Response.CancelPickupResponse;
import DataContracts.Pickup.Response.CreatePickupResponse;
import DataContracts.Pickup.Response.GetPickupResponse;
public class PickupSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();
public CreatePickupResponse UpdatePickup() throws Exception{
CreatePickupResponse response = new CreatePickupResponse();
UpdatePickupRequest request = new UpdatePickupRequest();
request.Pickup = PopulateUpdatePickupData();
request.PickupRequestId = 1111111;
String requestJSON = mapper.writeValueAsString(request);
String url = "{baseurl}/PickupRequest";
HttpClient httpClient = HttpClientBuilder.create().build();
HttpPut httpRequest = new HttpPut(url);
StringEntity params =new StringEntity(requestJSON);
httpRequest.addHeader("content-type", "application/json");
httpRequest.addHeader("apiKey", apiKey);
httpRequest.setEntity(params);
HttpResponse httpResponse = httpClient.execute(httpRequest);
BufferedReader rd = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
response = mapper.readValue(result.toString(), CreatePickupResponse.class);
return response;
}
private Pickup PopulateUpdatePickupData()
{
Contact contact = null;
Destination destination = new Destination();
destination.CountryCode = "USA";
destination.ZipOrPostalCode = "45177";
destination.City = "Melvin";
destination.StateOrProvince = "OH";
destination.Weight = 200;
destination.Pieces = 1;
destination.PackageType = "BAG";
List destinations = new ArrayList();
destinations.add(destination);
Pickup pickup = new Pickup();
pickup.PickupDate = LocalDate.now().plusDays(4).format(DateTimeFormatter.ofPattern("MM/dd/yyyy"));
pickup.ReadyTime = "08:00 AM";
pickup.CloseTime = "05:00 PM";
pickup.AdditionalInstructions = "";
pickup.LoadAttributes = new ArrayList();
pickup.Contact = contact;
pickup.Destinations = destinations;
pickup.ServiceLevel = "Standard";
pickup.HourlyWindow = null;
pickup.ExpeditedQuoteNumber = "";
return pickup;
}
}
Cancel a Pickup Request
HTTP Method: DELETE
URL: /PickupRequest
URL: /PickupRequest
Request Parameters
Name | Type | Cardinality | Required | Description |
---|---|---|---|---|
PickupRequestId | integer | One | Required | The unique identifier for the pickup request being canceled |
Reason | string | One | Required | Reason for canceling the pickup request |
Response Parameters
Name | Type | Cardinality | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Code | integer | One | HTTP status code | ||||||||||||||||||||
Errors | array | One | Returned errors | ||||||||||||||||||||
Properties
|
|||||||||||||||||||||||
Messages | array | One | Returned informational messages | ||||||||||||||||||||
Properties
|
Example Request
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/PickupRequest');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key',
'Content-Type' => 'application/json'
));
$request->setBody('{
\n "PickupRequestId": 1111111,
\n "Reason": "Freight not ready"
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts.PickupRequest.Request;
using CallAPI.DataContracts.PickupRequest.Response;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Text;
namespace CallAPI
{
class PickupSample
{
string apiKey = "Your API Key";
public CancelPickupResponse CancelPickup()
{
var request = new CancelPickupRequest()
{
PickupRequestId = 1111111,
Reason = "Freight not ready"
};
var requestJSON = JsonConvert.SerializeObject(request);
HttpRequestMessage httpRequest = new HttpRequestMessage
{
Content = new StringContent(requestJSON, Encoding.UTF8, "application/json"),
Method = HttpMethod.Delete,
RequestUri = new Uri("{baseurl}/PickupRequest")
};
var response = new CancelPickupResponse();
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
var apiResponse = client.SendAsync(httpRequest).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}
return response;
}
}
}
package Samples;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URI;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import com.fasterxml.jackson.databind.ObjectMapper;
import DataContracts.Pickup.Contact;
import DataContracts.Pickup.Destination;
import DataContracts.Pickup.Pickup;
import DataContracts.Pickup.PickupInformation;
import DataContracts.Pickup.Shipper;
import DataContracts.Pickup.Request.CancelPickupRequest;
import DataContracts.Pickup.Response.CancelPickupResponse;
public class PickupSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();
public CancelPickupResponse CancelPickup() throws Exception{
CancelPickupResponse response = new CancelPickupResponse();
CancelPickupRequest request = new CancelPickupRequest();
request.PickupRequestId = 1111111;
request.Reason = "Freight not ready";
String requestJSON = mapper.writeValueAsString(request);
String url = "{baseurl}/PickupRequest";
HttpClient httpClient = HttpClientBuilder.create().build();
HttpDeleteWithBody httpDelete = new HttpDeleteWithBody(url);
StringEntity params =new StringEntity(requestJSON);
httpDelete.addHeader("content-type", "application/json");
httpDelete.addHeader("apiKey", apiKey);
httpDelete.setEntity(params);
HttpResponse httpResponse = httpClient.execute(httpDelete);
HttpEntity entity = httpResponse.getEntity();
String responseString = EntityUtils.toString(entity);
response = mapper.readValue(responseString, CancelPickupResponse.class);
return response;
}
}
class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase {
public static final String METHOD_NAME = "DELETE";
public String getMethod() {
return METHOD_NAME;
}
public HttpDeleteWithBody(final String uri) {
super();
setURI(URI.create(uri));
}
public HttpDeleteWithBody(final URI uri) {
super();
setURI(uri);
}
public HttpDeleteWithBody() {
super();
}
}
Create a Pickup Request from a BOL
HTTP Method: POST
URL: /PickupRequest/FromBOL
URL: /PickupRequest/FromBOL
Request Parameters
Name | Type | Cardinality | Required | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ProNumber | string | One | Required | The Pro Number for the R+L BOL you want to tie to this pickup request. | |||||||||||||||||||||||||||||||||||
PickupInformation | object | One | Required | ||||||||||||||||||||||||||||||||||||
Properties
|
|||||||||||||||||||||||||||||||||||||||
Contact | object | Zero or One | Optional | Contact information. Fill this out if the contact is different than the Shipper. Requester will be set to Third Party. |
|||||||||||||||||||||||||||||||||||
Properties
|
|||||||||||||||||||||||||||||||||||||||
SendEmailConfirmation | boolean | One | Optional | The default value is true. |
Response Parameters
Name | Type | Cardinality | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PickupRequestId | integer | One | Newly created pickup request Id | ||||||||||||||||||||
Code | integer | One | HTTP status code | ||||||||||||||||||||
Errors | array | One | Returned errors | ||||||||||||||||||||
Properties
|
|||||||||||||||||||||||
Messages | array | One | Returned informational messages | ||||||||||||||||||||
Properties
|
Example Request
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/PickupRequest/FromBOL');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key',
'Content-Type' => 'application/json'
));
$request->setBody('{
\n "ProNumber": "111111111",
\n "PickupInformation": {
\n "PickupDate": "08/18/2020",
\n "ReadyTime": "08:00 AM",
\n "CloseTime": "05:00 PM",
\n "AdditionalInstructions": ""
\n }
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts.PickupRequest;
using CallAPI.DataContracts.PickupRequest.Request;
using CallAPI.DataContracts.PickupRequest.Response;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace CallAPI
{
class PickupSample
{
string apiKey = "Your API Key";
public CreatePickupResponse CreatePickupFromBOL()
{
var request = PopulateCreatePickupFromBOLData();
var response = new CreatePickupResponse();
var url = "{baseurl}/PickupRequest/FromBOL";
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var apiResponse = client.PostAsJsonAsync(url, request).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}
return response;
}
private CreatePickupFromBOL PopulateCreatePickupFromBOLData()
{
var pickupInformation = new PickupBase()
{
PickupDate = DateTime.Now.AddDays(4).ToShortDateString(),
ReadyTime = "08:00 AM",
CloseTime = "05:00 PM",
AdditionalInstructions = ""
};
var request = new CreatePickupFromBOL
{
ProNumber = "111111111",
PickupInformation = pickupInformation,
Contact = null
};
return request;
}
}
}
package Samples;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URI;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import com.fasterxml.jackson.databind.ObjectMapper;
import DataContracts.Pickup.AddPickup;
import DataContracts.Pickup.Contact;
import DataContracts.Pickup.Destination;
import DataContracts.Pickup.Pickup;
import DataContracts.Pickup.PickupBase;
import DataContracts.Pickup.Shipper;
import DataContracts.Pickup.Request.CancelPickupRequest;
import DataContracts.Pickup.Request.CreatePickupFromBOL;
import DataContracts.Pickup.Request.CreatePickupRequest;
import DataContracts.Pickup.Request.UpdatePickupRequest;
import DataContracts.Pickup.Response.CancelPickupResponse;
import DataContracts.Pickup.Response.CreatePickupResponse;
import DataContracts.Pickup.Response.GetPickupResponse;
public class PickupSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();
public CreatePickupResponse CreatePickupFromBOL() throws Exception{
CreatePickupResponse response = new CreatePickupResponse();
CreatePickupFromBOL request = PopulateCreatePickupFromBOLData();
String requestJSON = mapper.writeValueAsString(request);
String url = "{baseurl}/PickupRequest/FromBOL";
HttpClient httpClient = HttpClientBuilder.create().build();
HttpPost httpRequest = new HttpPost(url);
StringEntity params =new StringEntity(requestJSON);
httpRequest.addHeader("content-type", "application/json");
httpRequest.addHeader("apiKey", apiKey);
httpRequest.setEntity(params);
HttpResponse httpResponse = httpClient.execute(httpRequest);
BufferedReader rd = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
response = mapper.readValue(result.toString(), CreatePickupResponse.class);
return response;
}
private CreatePickupFromBOL PopulateCreatePickupFromBOLData()
{
PickupBase pickupInformation = new PickupBase();
pickupInformation.PickupDate = LocalDate.now().plusDays(4).format(DateTimeFormatter.ofPattern("MM/dd/yyyy"));
pickupInformation.ReadyTime = "08:00 AM";
pickupInformation.CloseTime = "05:00 PM";
pickupInformation.AdditionalInstructions = "";
CreatePickupFromBOL request = new CreatePickupFromBOL();
request.ProNumber = "111111111";
request.PickupInformation = pickupInformation;
request.Contact = null;
return request;
}
}