Retrieve a single order from the database.
GET /orders/orderId HTTP/1.1
Host: ssapi.shipstation.com
Authorization: __YOUR_AUTH_HERE__
curl -iX GET https://ssapi.shipstation.com/orders/orderId \
-H 'Authorization: __YOUR_AUTH_HERE__' \
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Host", "ssapi.shipstation.com")
$headers.Add("Authorization", "__YOUR_AUTH_HERE__")
$response = Invoke-RestMethod 'https://ssapi.shipstation.com/orders/orderId' -Method 'GET' -Headers $headers -Body $body
$response | ConvertTo-Json
var myHeaders = new Headers();
myHeaders.append("Host", "ssapi.shipstation.com");
myHeaders.append("Authorization", "__YOUR_AUTH_HERE__");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://ssapi.shipstation.com/orders/orderId", 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://ssapi.shipstation.com/orders/orderId',
'headers': {
'Host': 'ssapi.shipstation.com',
'Authorization': '__YOUR_AUTH_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://ssapi.shipstation.com/orders/orderId",
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: ssapi.shipstation.com",
"Authorization: __YOUR_AUTH_HERE__"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://ssapi.shipstation.com/orders/orderId"
payload = {}
headers = {
'Host': 'ssapi.shipstation.com',
'Authorization': '__YOUR_AUTH_HERE__'
}
response = requests.request("GET", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
require "uri"
require "net/http"
url = URI("https://ssapi.shipstation.com/orders/orderId")
https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Host"] = "ssapi.shipstation.com"
request["Authorization"] = "__YOUR_AUTH_HERE__"
response = https.request(request)
puts response.read_body
var client = new RestClient("https://ssapi.shipstation.com/orders/orderId");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Host", "ssapi.shipstation.com");
request.AddHeader("Authorization", "__YOUR_AUTH_HERE__");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://ssapi.shipstation.com/orders/orderId")
.method("GET", null)
.addHeader("Host", "ssapi.shipstation.com")
.addHeader("Authorization", "__YOUR_AUTH_HERE__")
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://ssapi.shipstation.com/orders/orderId"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
}
req.Header.Add("Host", "ssapi.shipstation.com")
req.Header.Add("Authorization", "__YOUR_AUTH_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://ssapi.shipstation.com/orders/orderId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Host": @"ssapi.shipstation.com",
@"Authorization": @"__YOUR_AUTH_HERE__"
};
[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://ssapi.shipstation.com/orders/orderId")!,timeoutInterval: Double.infinity)
request.addValue("ssapi.shipstation.com", forHTTPHeaderField: "Host")
request.addValue("__YOUR_AUTH_HERE__", forHTTPHeaderField: "Authorization")
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()
{
"orderId": 94113592,
"orderNumber": "TEST-ORDER-API-DOCS",
"orderKey": "0f6bec18-9-4771-83aa-f392d84f4c74",
"orderDate": "2015-06-29T08:46:27.0000000",
"createDate": "2015-07-16T14:00:34.8230000",
"modifyDate": "2015-09-08T11:03:12.3800000",
"paymentDate": "2015-06-29T08:46:27.0000000",
"shipByDate": "2015-07-05T00:00:00.0000000",
"orderStatus": "awaiting_shipment",
"customerId": 37701499,
"customerUsername": "[email protected]",
"customerEmail": "[email protected]",
"billTo": {
"name": "The President",
"company": null,
"street1": null,
"street2": null,
"street3": null,
"city": null,
"state": null,
"postalCode": null,
"country": null,
"phone": null,
"residential": null,
"addressVerified": null
},
"shipTo": {
"name": "The President",
"company": "US Govt",
"street1": "1600 Pennsylvania Ave",
"street2": "Oval Office",
"street3": null,
"city": "Washington",
"state": "DC",
"postalCode": "20500",
"country": "US",
"phone": "555-555-5555",
"residential": false,
"addressVerified": "Address validation warning"
},
"items": [
{
"orderItemId": 128836912,
"lineItemKey": "vd08-MSLbtx",
"sku": "ABC123",
"name": "Test item #1",
"imageUrl": null,
"weight": {
"value": 24,
"units": "ounces"
},
"quantity": 2,
"unitPrice": 99.99,
"taxAmount": null,
"shippingAmount": null,
"warehouseLocation": "Aisle 1, Bin 7",
"options": [
{
"name": "Size",
"value": "Large"
}
],
"productId": 7239919,
"fulfillmentSku": null,
"adjustment": false,
"upc": null,
"createDate": "2015-07-16T14:00:34.823",
"modifyDate": "2015-07-16T14:00:34.823"
},
{
"orderItemId": 128836913,
"lineItemKey": null,
"sku": "DISCOUNT CODE",
"name": "10% OFF",
"imageUrl": null,
"weight": {
"value": 0,
"units": "ounces"
},
"quantity": 1,
"unitPrice": -20.55,
"taxAmount": null,
"shippingAmount": null,
"warehouseLocation": null,
"options": [],
"productId": null,
"fulfillmentSku": null,
"adjustment": true,
"upc": null,
"createDate": "2015-07-16T14:00:34.823",
"modifyDate": "2015-07-16T14:00:34.823"
}
],
"orderTotal": 194.43,
"amountPaid": 218.73,
"taxAmount": 5,
"shippingAmount": 10,
"customerNotes": "Please ship as soon as possible!",
"internalNotes": "Customer called and would like to upgrade shipping",
"gift": true,
"giftMessage": "Thank you!",
"paymentMethod": "Credit Card",
"requestedShippingService": "Priority Mail",
"carrierCode": "fedex",
"serviceCode": "fedex_home_delivery",
"packageCode": "package",
"confirmation": "delivery",
"shipDate": "2015-07-02",
"holdUntilDate": null,
"weight": {
"value": 48,
"units": "ounces"
},
"dimensions": {
"units": "inches",
"length": 7,
"width": 5,
"height": 6
},
"insuranceOptions": {
"provider": "carrier",
"insureShipment": true,
"insuredValue": 200
},
"internationalOptions": {
"contents": null,
"customsItems": null,
"nonDelivery": null
},
"advancedOptions": {
"warehouseId": 24079,
"nonMachinable": false,
"saturdayDelivery": false,
"containsAlcohol": false,
"mergedOrSplit": false,
"mergedIds": [],
"parentId": null,
"storeId": 26815,
"customField1": "Custom data that you can add to an order. See Custom Field #2 & #3 for more info!",
"customField2": "Per UI settings, this information can appear on some carrier's shipping labels. See link below",
"customField3": "https://help.shipstation.com/hc/en-us/articles/206639957",
"source": "Webstore",
"billToParty": null,
"billToAccount": null,
"billToPostalCode": null,
"billToCountryCode": null
},
"tagIds": null,
"userId": null,
"externallyFulfilled": false,
"externallyFulfilledBy": null,
"externallyFulfilledById": 12345,
"externallyFulfilledByName": "Example Fulfillment Provider Name"
}