Schedule a Carrier Pickup
With ShipEngine, you can request a carrier pickup at your office, warehouse, or other location. This allows the carrier to
come and get your packages so you don't have to drop them off in a drop box or store. Some carriers charge a fee for this
service depending on the pickup type and frequency, so check with your carrier to ensure you don't incur any unexpected charges.
You can take advantage of this via our v1/pickups
endpoint for our supported carriers.
Supported Carriers
Carrier Pickup Information
UPS
UPS pickup times can vary depending on service and pickup location. Please contact your UPS sales representative to get information specific to your account.
Examples
Schedule a Pickup
To schedule a pickup, you'll need to send us a list of the label ids that you would like picked up.
All the labels must be from the same carrier and have the same warehouse id. The pickup location will be the ship from
or warehouse id you used when you created the label.
Tip
Pickup Window
The pickup_window
range start_at
and end_at
values must be specified as valid ISO 8601 strings.
If only a date is specified with no time value, then the pickup time is the entire business day.
POST /v1/pickups HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
Content-Type: application/json
{
"label_ids": [
"se-28529731"
],
"contact_details": {
"name": "John Stuckey",
"email": "[email protected]",
"phone": "6625905259"
},
"pickup_notes": "Please knock, doorbell is broken.",
"pickup_window": {
"start_at": "2019-11-11T15:00:00.000Z",
"end_at": "2019-11-11T18:00:00.000Z"
}
}
curl -iX POST https://api.shipengine.com/v1/pickups \
-H 'API-Key: __YOUR_API_KEY_HERE__' \
-H 'Content-Type: application/json' \
-d '{
"label_ids": [
"se-28529731"
],
"contact_details": {
"name": "John Stuckey",
"email": "[email protected]",
"phone": "6625905259"
},
"pickup_notes": "Please knock, doorbell is broken.",
"pickup_window": {
"start_at": "2019-11-11T15:00:00.000Z",
"end_at": "2019-11-11T18:00:00.000Z"
}
}'
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Host", "api.shipengine.com")
$headers.Add("API-Key", "__YOUR_API_KEY_HERE__")
$headers.Add("Content-Type", "application/json")
$body = "{`n `"label_ids`": [`n `"se-28529731`"`n ],`n `"contact_details`": {`n `"name`": `"John Stuckey`",`n `"email`": `"[email protected]`",`n `"phone`": `"6625905259`"`n },`n `"pickup_notes`": `"Please knock, doorbell is broken.`",`n `"pickup_window`": {`n `"start_at`": `"2019-11-11T15:00:00.000Z`",`n `"end_at`": `"2019-11-11T18:00:00.000Z`"`n }`n}"
$response = Invoke-RestMethod 'https://api.shipengine.com/v1/pickups' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
var myHeaders = new Headers();
myHeaders.append("Host", "api.shipengine.com");
myHeaders.append("API-Key", "__YOUR_API_KEY_HERE__");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({"label_ids":["se-28529731"],"contact_details":{"name":"John Stuckey","email":"[email protected]","phone":"6625905259"},"pickup_notes":"Please knock, doorbell is broken.","pickup_window":{"start_at":"2019-11-11T15:00:00.000Z","end_at":"2019-11-11T18:00:00.000Z"}});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.shipengine.com/v1/pickups", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.shipengine.com/v1/pickups',
'headers': {
'Host': 'api.shipengine.com',
'API-Key': '__YOUR_API_KEY_HERE__',
'Content-Type': 'application/json'
},
body: JSON.stringify({"label_ids":["se-28529731"],"contact_details":{"name":"John Stuckey","email":"[email protected]","phone":"6625905259"},"pickup_notes":"Please knock, doorbell is broken.","pickup_window":{"start_at":"2019-11-11T15:00:00.000Z","end_at":"2019-11-11T18:00:00.000Z"}})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.shipengine.com/v1/pickups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS =>"{\n \"label_ids\": [\n \"se-28529731\"\n ],\n \"contact_details\": {\n \"name\": \"John Stuckey\",\n \"email\": \"[email protected]\",\n \"phone\": \"6625905259\"\n },\n \"pickup_notes\": \"Please knock, doorbell is broken.\",\n \"pickup_window\": {\n \"start_at\": \"2019-11-11T15:00:00.000Z\",\n \"end_at\": \"2019-11-11T18:00:00.000Z\"\n }\n}",
CURLOPT_HTTPHEADER => array(
"Host: api.shipengine.com",
"API-Key: __YOUR_API_KEY_HERE__",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.shipengine.com/v1/pickups"
payload = "{\n \"label_ids\": [\n \"se-28529731\"\n ],\n \"contact_details\": {\n \"name\": \"John Stuckey\",\n \"email\": \"[email protected]\",\n \"phone\": \"6625905259\"\n },\n \"pickup_notes\": \"Please knock, doorbell is broken.\",\n \"pickup_window\": {\n \"start_at\": \"2019-11-11T15:00:00.000Z\",\n \"end_at\": \"2019-11-11T18:00:00.000Z\"\n }\n}"
headers = {
'Host': 'api.shipengine.com',
'API-Key': '__YOUR_API_KEY_HERE__',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
require "uri"
require "net/http"
url = URI("https://api.shipengine.com/v1/pickups")
https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Host"] = "api.shipengine.com"
request["API-Key"] = "__YOUR_API_KEY_HERE__"
request["Content-Type"] = "application/json"
request.body = "{\n \"label_ids\": [\n \"se-28529731\"\n ],\n \"contact_details\": {\n \"name\": \"John Stuckey\",\n \"email\": \"[email protected]\",\n \"phone\": \"6625905259\"\n },\n \"pickup_notes\": \"Please knock, doorbell is broken.\",\n \"pickup_window\": {\n \"start_at\": \"2019-11-11T15:00:00.000Z\",\n \"end_at\": \"2019-11-11T18:00:00.000Z\"\n }\n}"
response = https.request(request)
puts response.read_body
var client = new RestClient("https://api.shipengine.com/v1/pickups");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Host", "api.shipengine.com");
request.AddHeader("API-Key", "__YOUR_API_KEY_HERE__");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"label_ids\": [\n \"se-28529731\"\n ],\n \"contact_details\": {\n \"name\": \"John Stuckey\",\n \"email\": \"[email protected]\",\n \"phone\": \"6625905259\"\n },\n \"pickup_notes\": \"Please knock, doorbell is broken.\",\n \"pickup_window\": {\n \"start_at\": \"2019-11-11T15:00:00.000Z\",\n \"end_at\": \"2019-11-11T18:00:00.000Z\"\n }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"label_ids\": [\n \"se-28529731\"\n ],\n \"contact_details\": {\n \"name\": \"John Stuckey\",\n \"email\": \"[email protected]\",\n \"phone\": \"6625905259\"\n },\n \"pickup_notes\": \"Please knock, doorbell is broken.\",\n \"pickup_window\": {\n \"start_at\": \"2019-11-11T15:00:00.000Z\",\n \"end_at\": \"2019-11-11T18:00:00.000Z\"\n }\n}");
Request request = new Request.Builder()
.url("https://api.shipengine.com/v1/pickups")
.method("POST", body)
.addHeader("Host", "api.shipengine.com")
.addHeader("API-Key", "__YOUR_API_KEY_HERE__")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.shipengine.com/v1/pickups"
method := "POST"
payload := strings.NewReader("{\n \"label_ids\": [\n \"se-28529731\"\n ],\n \"contact_details\": {\n \"name\": \"John Stuckey\",\n \"email\": \"[email protected]\",\n \"phone\": \"6625905259\"\n },\n \"pickup_notes\": \"Please knock, doorbell is broken.\",\n \"pickup_window\": {\n \"start_at\": \"2019-11-11T15:00:00.000Z\",\n \"end_at\": \"2019-11-11T18:00:00.000Z\"\n }\n}")
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
}
req.Header.Add("Host", "api.shipengine.com")
req.Header.Add("API-Key", "__YOUR_API_KEY_HERE__")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.shipengine.com/v1/pickups"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Host": @"api.shipengine.com",
@"API-Key": @"__YOUR_API_KEY_HERE__",
@"Content-Type": @"application/json"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\n \"label_ids\": [\n \"se-28529731\"\n ],\n \"contact_details\": {\n \"name\": \"John Stuckey\",\n \"email\": \"[email protected]\",\n \"phone\": \"6625905259\"\n },\n \"pickup_notes\": \"Please knock, doorbell is broken.\",\n \"pickup_window\": {\n \"start_at\": \"2019-11-11T15:00:00.000Z\",\n \"end_at\": \"2019-11-11T18:00:00.000Z\"\n }\n}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
import Foundation
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\n \"label_ids\": [\n \"se-28529731\"\n ],\n \"contact_details\": {\n \"name\": \"John Stuckey\",\n \"email\": \"[email protected]\",\n \"phone\": \"6625905259\"\n },\n \"pickup_notes\": \"Please knock, doorbell is broken.\",\n \"pickup_window\": {\n \"start_at\": \"2019-11-11T15:00:00.000Z\",\n \"end_at\": \"2019-11-11T18:00:00.000Z\"\n }\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.shipengine.com/v1/pickups")!,timeoutInterval: Double.infinity)
request.addValue("api.shipengine.com", forHTTPHeaderField: "Host")
request.addValue("__YOUR_API_KEY_HERE__", forHTTPHeaderField: "API-Key")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
{
"pickup_id": "pik_3YcKU5zdtJuCqoeNwyqqbW",
"label_ids": [
"se-28529731"
],
"created_at": "2018-09-23T15:00:00.000Z",
"cancelled_at": "2018-09-23T15:00:00.000Z",
"carrier_id": "se-28529731",
"warehouse_id": "se-28529731",
"confirmation_number": "292513CL4A3",
"contact_details": {
"name": "string",
"email": "[email protected]",
"phone": "strings"
},
"pickup_notes": "string",
"pickup_window": [{
"start_at": "2019-11-11T15:00:00.000Z",
"end_at": "2018-11-11T15:00:00.000Z"
}]
}
{
"pickup_id": "pik_3YcKU5zdtJuCqoeNwyqqbW",
"label_ids": [
"se-28529731"
],
"created_at": "2018-09-23T15:00:00.000Z",
"cancelled_at": "2018-09-23T15:00:00.000Z",
"carrier_id": "se-28529731",
"warehouse_id": "se-28529731",
"confirmation_number": "292513CL4A3",
"contact_details": {
"name": "string",
"email": "[email protected]",
"phone": "strings"
},
"pickup_notes": "string",
"pickup_window": [{
"start_at": "2019-11-11T15:00:00.000Z",
"end_at": "2018-11-11T15:00:00.000Z"
}]
}
Cancel a Pickup
If you would like to cancel a pickup that you've previously scheduled then call the /v1/pickups/:pickup_id
endpoint with
the id of the pickup you would like to cancel. Note that some carriers have rules around how close to the pickup window a
pickup can be cancelled.
DELETE /v1/pickups/pik_3YcKU5zdtJuCqoeNwyqqbW HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
curl -iX DELETE https://api.shipengine.com/v1/pickups/pik_3YcKU5zdtJuCqoeNwyqqbW \
-H 'API-Key: __YOUR_API_KEY_HERE__' \
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Host", "api.shipengine.com")
$headers.Add("API-Key", "__YOUR_API_KEY_HERE__")
$response = Invoke-RestMethod 'https://api.shipengine.com/v1/pickups/pik_3YcKU5zdtJuCqoeNwyqqbW' -Method 'DELETE' -Headers $headers -Body $body
$response | ConvertTo-Json
var myHeaders = new Headers();
myHeaders.append("Host", "api.shipengine.com");
myHeaders.append("API-Key", "__YOUR_API_KEY_HERE__");
var requestOptions = {
method: 'DELETE',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.shipengine.com/v1/pickups/pik_3YcKU5zdtJuCqoeNwyqqbW", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://api.shipengine.com/v1/pickups/pik_3YcKU5zdtJuCqoeNwyqqbW',
'headers': {
'Host': 'api.shipengine.com',
'API-Key': '__YOUR_API_KEY_HERE__'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.shipengine.com/v1/pickups/pik_3YcKU5zdtJuCqoeNwyqqbW",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => array(
"Host: api.shipengine.com",
"API-Key: __YOUR_API_KEY_HERE__"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.shipengine.com/v1/pickups/pik_3YcKU5zdtJuCqoeNwyqqbW"
payload = {}
headers = {
'Host': 'api.shipengine.com',
'API-Key': '__YOUR_API_KEY_HERE__'
}
response = requests.request("DELETE", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
require "uri"
require "net/http"
url = URI("https://api.shipengine.com/v1/pickups/pik_3YcKU5zdtJuCqoeNwyqqbW")
https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Host"] = "api.shipengine.com"
request["API-Key"] = "__YOUR_API_KEY_HERE__"
response = https.request(request)
puts response.read_body
var client = new RestClient("https://api.shipengine.com/v1/pickups/pik_3YcKU5zdtJuCqoeNwyqqbW");
client.Timeout = -1;
var request = new RestRequest(Method.DELETE);
request.AddHeader("Host", "api.shipengine.com");
request.AddHeader("API-Key", "__YOUR_API_KEY_HERE__");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.shipengine.com/v1/pickups/pik_3YcKU5zdtJuCqoeNwyqqbW")
.method("DELETE", body)
.addHeader("Host", "api.shipengine.com")
.addHeader("API-Key", "__YOUR_API_KEY_HERE__")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.shipengine.com/v1/pickups/pik_3YcKU5zdtJuCqoeNwyqqbW"
method := "DELETE"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
}
req.Header.Add("Host", "api.shipengine.com")
req.Header.Add("API-Key", "__YOUR_API_KEY_HERE__")
res, err := client.Do(req)
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.shipengine.com/v1/pickups/pik_3YcKU5zdtJuCqoeNwyqqbW"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Host": @"api.shipengine.com",
@"API-Key": @"__YOUR_API_KEY_HERE__"
};
[request setAllHTTPHeaderFields:headers];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
import Foundation
var semaphore = DispatchSemaphore (value: 0)
var request = URLRequest(url: URL(string: "https://api.shipengine.com/v1/pickups/pik_3YcKU5zdtJuCqoeNwyqqbW")!,timeoutInterval: Double.infinity)
request.addValue("api.shipengine.com", forHTTPHeaderField: "Host")
request.addValue("__YOUR_API_KEY_HERE__", forHTTPHeaderField: "API-Key")
request.httpMethod = "DELETE"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
The response includes the ID of the cancelled pickup.
{
"pickup_id": "pik_3YcKU5zdtJuCqoeNwyqqbW"
}
{
"pickup_id": "pik_3YcKU5zdtJuCqoeNwyqqbW"
}
List Your Pickups
You may also list all your pickups, including those that have been cancelled or have already been picked up, by using the /v1/pickups
endpoint. This is the same endpoint you used to schedule the pickups, but you will use an HTTP GET rather than an HTTP POST
to list your pickups.
GET /v1/pickups HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
Content-Type: application/json
curl -iX GET https://api.shipengine.com/v1/pickups \
-H 'API-Key: __YOUR_API_KEY_HERE__' \
-H 'Content-Type: application/json' \
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Host", "api.shipengine.com")
$headers.Add("API-Key", "__YOUR_API_KEY_HERE__")
$headers.Add("Content-Type", "application/json")
$response = Invoke-RestMethod 'https://api.shipengine.com/v1/pickups' -Method 'GET' -Headers $headers -Body $body
$response | ConvertTo-Json
var myHeaders = new Headers();
myHeaders.append("Host", "api.shipengine.com");
myHeaders.append("API-Key", "__YOUR_API_KEY_HERE__");
myHeaders.append("Content-Type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.shipengine.com/v1/pickups", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.shipengine.com/v1/pickups',
'headers': {
'Host': 'api.shipengine.com',
'API-Key': '__YOUR_API_KEY_HERE__',
'Content-Type': 'application/json'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.shipengine.com/v1/pickups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Host: api.shipengine.com",
"API-Key: __YOUR_API_KEY_HERE__",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.shipengine.com/v1/pickups"
payload = {}
headers = {
'Host': 'api.shipengine.com',
'API-Key': '__YOUR_API_KEY_HERE__',
'Content-Type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
require "uri"
require "net/http"
url = URI("https://api.shipengine.com/v1/pickups")
https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Host"] = "api.shipengine.com"
request["API-Key"] = "__YOUR_API_KEY_HERE__"
request["Content-Type"] = "application/json"
response = https.request(request)
puts response.read_body
var client = new RestClient("https://api.shipengine.com/v1/pickups");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Host", "api.shipengine.com");
request.AddHeader("API-Key", "__YOUR_API_KEY_HERE__");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.shipengine.com/v1/pickups")
.method("GET", null)
.addHeader("Host", "api.shipengine.com")
.addHeader("API-Key", "__YOUR_API_KEY_HERE__")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.shipengine.com/v1/pickups"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
}
req.Header.Add("Host", "api.shipengine.com")
req.Header.Add("API-Key", "__YOUR_API_KEY_HERE__")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.shipengine.com/v1/pickups"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Host": @"api.shipengine.com",
@"API-Key": @"__YOUR_API_KEY_HERE__",
@"Content-Type": @"application/json"
};
[request setAllHTTPHeaderFields:headers];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
import Foundation
var semaphore = DispatchSemaphore (value: 0)
var request = URLRequest(url: URL(string: "https://api.shipengine.com/v1/pickups")!,timeoutInterval: Double.infinity)
request.addValue("api.shipengine.com", forHTTPHeaderField: "Host")
request.addValue("__YOUR_API_KEY_HERE__", forHTTPHeaderField: "API-Key")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
{
"pickups": [
{
"pickup_id": "pik_EzSSBdj2bgrK8tfNAABP9v",
"carrier_id": "se-96770",
"warehouse_id": null,
"confirmation_number": "29J62276GH7",
"label_ids": [
"se-963397"
],
"contact_details": {
"name": "John Stuckey",
"email": "[email protected]",
"phone": "6625905259"
},
"pickup_notes": "Please knock, doorbell is broken.",
"pickup_windows": [
{
"start_at": "2020-06-26T11:00:00Z",
"end_at": "2020-06-26T17:00:00Z"
}
],
"pickup_address": {
"name": "John Doe",
"phone": "555-555-5555",
"company_name": "Example Corp",
"address_line1": "4009 Marathon Blvd",
"address_line2": null,
"address_line3": null,
"city_locality": "Austin",
"state_province": "TX",
"postal_code": "78756",
"country_code": "US",
"address_residential_indicator": "unknown"
},
"created_at": "2020-06-24T13:19:15.75Z",
"canceled_at": null
}
],
"total": 3,
"page": 3,
"pages": 3,
"links": {
"first": {
"href": "https://api.shipengine.com/v1/pickups?page=1&page_size=1"
},
"last": {
"href": "https://api.shipengine.com/v1/pickups?page=3&page_size=1"
},
"prev": {
"href": "https://api.shipengine.com/v1/pickups?page=2&page_size=1"
},
"next": {}
}
}
{
"pickups": [
{
"pickup_id": "pik_EzSSBdj2bgrK8tfNAABP9v",
"carrier_id": "se-96770",
"warehouse_id": null,
"confirmation_number": "29J62276GH7",
"label_ids": [
"se-963397"
],
"contact_details": {
"name": "John Stuckey",
"email": "[email protected]",
"phone": "6625905259"
},
"pickup_notes": "Please knock, doorbell is broken.",
"pickup_windows": [
{
"start_at": "2020-06-26T11:00:00Z",
"end_at": "2020-06-26T17:00:00Z"
}
],
"pickup_address": {
"name": "John Doe",
"phone": "555-555-5555",
"company_name": "Example Corp",
"address_line1": "4009 Marathon Blvd",
"address_line2": null,
"address_line3": null,
"city_locality": "Austin",
"state_province": "TX",
"postal_code": "78756",
"country_code": "US",
"address_residential_indicator": "unknown"
},
"created_at": "2020-06-24T13:19:15.75Z",
"canceled_at": null
}
],
"total": 3,
"page": 3,
"pages": 3,
"links": {
"first": {
"href": "https://api.shipengine.com/v1/pickups?page=1&page_size=1"
},
"last": {
"href": "https://api.shipengine.com/v1/pickups?page=3&page_size=1"
},
"prev": {
"href": "https://api.shipengine.com/v1/pickups?page=2&page_size=1"
},
"next": {}
}
}
View a Specific Pickup
You can get information about a specific pickup by calling /v1/pickups/:pickup_id
.
GET /v1/pickups/pik_EzSSBdj2bgrK8tfNAABP9v HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
Content-Type: application/json
curl -iX GET https://api.shipengine.com/v1/pickups/pik_EzSSBdj2bgrK8tfNAABP9v \
-H 'API-Key: __YOUR_API_KEY_HERE__' \
-H 'Content-Type: application/json' \
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Host", "api.shipengine.com")
$headers.Add("API-Key", "__YOUR_API_KEY_HERE__")
$headers.Add("Content-Type", "application/json")
$response = Invoke-RestMethod 'https://api.shipengine.com/v1/pickups/pik_EzSSBdj2bgrK8tfNAABP9v' -Method 'GET' -Headers $headers -Body $body
$response | ConvertTo-Json
var myHeaders = new Headers();
myHeaders.append("Host", "api.shipengine.com");
myHeaders.append("API-Key", "__YOUR_API_KEY_HERE__");
myHeaders.append("Content-Type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.shipengine.com/v1/pickups/pik_EzSSBdj2bgrK8tfNAABP9v", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.shipengine.com/v1/pickups/pik_EzSSBdj2bgrK8tfNAABP9v',
'headers': {
'Host': 'api.shipengine.com',
'API-Key': '__YOUR_API_KEY_HERE__',
'Content-Type': 'application/json'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.shipengine.com/v1/pickups/pik_EzSSBdj2bgrK8tfNAABP9v",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Host: api.shipengine.com",
"API-Key: __YOUR_API_KEY_HERE__",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.shipengine.com/v1/pickups/pik_EzSSBdj2bgrK8tfNAABP9v"
payload = {}
headers = {
'Host': 'api.shipengine.com',
'API-Key': '__YOUR_API_KEY_HERE__',
'Content-Type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
require "uri"
require "net/http"
url = URI("https://api.shipengine.com/v1/pickups/pik_EzSSBdj2bgrK8tfNAABP9v")
https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Host"] = "api.shipengine.com"
request["API-Key"] = "__YOUR_API_KEY_HERE__"
request["Content-Type"] = "application/json"
response = https.request(request)
puts response.read_body
var client = new RestClient("https://api.shipengine.com/v1/pickups/pik_EzSSBdj2bgrK8tfNAABP9v");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Host", "api.shipengine.com");
request.AddHeader("API-Key", "__YOUR_API_KEY_HERE__");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.shipengine.com/v1/pickups/pik_EzSSBdj2bgrK8tfNAABP9v")
.method("GET", null)
.addHeader("Host", "api.shipengine.com")
.addHeader("API-Key", "__YOUR_API_KEY_HERE__")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.shipengine.com/v1/pickups/pik_EzSSBdj2bgrK8tfNAABP9v"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
}
req.Header.Add("Host", "api.shipengine.com")
req.Header.Add("API-Key", "__YOUR_API_KEY_HERE__")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.shipengine.com/v1/pickups/pik_EzSSBdj2bgrK8tfNAABP9v"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Host": @"api.shipengine.com",
@"API-Key": @"__YOUR_API_KEY_HERE__",
@"Content-Type": @"application/json"
};
[request setAllHTTPHeaderFields:headers];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
import Foundation
var semaphore = DispatchSemaphore (value: 0)
var request = URLRequest(url: URL(string: "https://api.shipengine.com/v1/pickups/pik_EzSSBdj2bgrK8tfNAABP9v")!,timeoutInterval: Double.infinity)
request.addValue("api.shipengine.com", forHTTPHeaderField: "Host")
request.addValue("__YOUR_API_KEY_HERE__", forHTTPHeaderField: "API-Key")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
{
"pickup_id": "pik_EzSSBdj2bgrK8tfNAABP9v",
"carrier_id": "se-96770",
"warehouse_id": null,
"confirmation_number": "29J62276GH7",
"label_ids": [
"se-963397"
],
"contact_details": {
"name": "John Stuckey",
"email": "[email protected]",
"phone": "6625905259"
},
"pickup_notes": "Please knock, doorbell is broken.",
"pickup_windows": [
{
"start_at": "2020-06-26T11:00:00Z",
"end_at": "2020-06-26T17:00:00Z"
}
],
"pickup_address": {
"name": "John Doe",
"phone": "555-555-5555",
"company_name": "Example Corp",
"address_line1": "4009 Marathon Blvd",
"address_line2": null,
"address_line3": null,
"city_locality": "Austin",
"state_province": "TX",
"postal_code": "78756",
"country_code": "US",
"address_residential_indicator": "unknown"
},
"created_at": "2020-06-24T13:19:15.75Z",
"canceled_at": null
}
{
"pickup_id": "pik_EzSSBdj2bgrK8tfNAABP9v",
"carrier_id": "se-96770",
"warehouse_id": null,
"confirmation_number": "29J62276GH7",
"label_ids": [
"se-963397"
],
"contact_details": {
"name": "John Stuckey",
"email": "[email protected]",
"phone": "6625905259"
},
"pickup_notes": "Please knock, doorbell is broken.",
"pickup_windows": [
{
"start_at": "2020-06-26T11:00:00Z",
"end_at": "2020-06-26T17:00:00Z"
}
],
"pickup_address": {
"name": "John Doe",
"phone": "555-555-5555",
"company_name": "Example Corp",
"address_line1": "4009 Marathon Blvd",
"address_line2": null,
"address_line3": null,
"city_locality": "Austin",
"state_province": "TX",
"postal_code": "78756",
"country_code": "US",
"address_residential_indicator": "unknown"
},
"created_at": "2020-06-24T13:19:15.75Z",
"canceled_at": null
}