GET /v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1 HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
curl -iX GET 'https://api.shipengine.com/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1' \
-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/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1' -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__");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.shipengine.com/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1", 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/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1',
'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/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1",
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__"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.shipengine.com/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1"
payload = {}
headers = {
'Host': 'api.shipengine.com',
'API-Key': '__YOUR_API_KEY_HERE__'
}
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/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1")
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__"
response = https.request(request)
puts response.read_body
var client = new RestClient("https://api.shipengine.com/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
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();
Request request = new Request.Builder()
.url("https://api.shipengine.com/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1")
.method("GET", null)
.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/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1"
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__")
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/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Host": @"api.shipengine.com",
@"API-Key": @"__YOUR_API_KEY_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://api.shipengine.com/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1")!,timeoutInterval: Double.infinity)
request.addValue("api.shipengine.com", forHTTPHeaderField: "Host")
request.addValue("__YOUR_API_KEY_HERE__", forHTTPHeaderField: "API-Key")
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()
{
"sales_orders": [
{
"sales_order_id": "e5a64168-f8d5-5a30-9e93-57f3e61da87b",
"external_order_id": "1774",
"external_order_number": "#SH1801",
"order_source": {
"order_source_id": "0b6acb5a-430e-464d-a3f7-e7e0175a2a76",
"order_source_nickname": "My Shopify Shop",
"order_source_code": "shopify",
"order_source_friendly_name": "Shopify",
"refresh_info": {
"status": "idle",
"last_refresh_attempt": "2018-08-21T21:44:54.27Z",
"refresh_date": "2018-08-21T21:44:54.27Z"
},
"active": true
},
"sales_order_status": {
"payment_status": "unknown",
"fulfillment_status": "fulfilled",
"is_cancelled": false
},
"order_date": "2016-09-13T15:57:00Z",
"created_at": "2018-08-09T14:55:09.58Z",
"modified_at": "2018-08-09T14:55:09.58Z",
"payment_details": {
"subtotal": {
"currency": "usd",
"amount": 0
},
"estimated_shipping": {
"currency": "usd",
"amount": 22.38
},
"estimated_tax": {
"currency": "usd",
"amount": 1.85
},
"grand_total": {
"currency": "usd",
"amount": 24.23
}
},
"customer": {
"name": "Amanda Miller",
"phone": "555-555-5555",
"email": "[email protected]"
},
"bill_to": {
"email": "[email protected]",
"address": {
"name": null,
"phone": null,
"company_name": null,
"address_line1": "",
"address_line2": null,
"address_line3": null,
"city_locality": null,
"state_province": null,
"postal_code": null,
"country_code": null,
"address_residential_indicator": "no"
}
},
"ship_to": {
"name": "Amanda Miller",
"phone": "555-555-5555",
"address_line1": "525 S Winchester Blvd",
"city_locality": "San Jose",
"state_province": "CA",
"postal_code": "95128",
"country_code": "US",
"address_residential_indicator": "yes"
},
"sales_order_items": [
{
"sales_order_item_id": "eb8628f7-64ae-5df1-80c6-5e8f24099036",
"line_item_details": {
"name": "black hotdog shirt L (Default Title)",
"sku": "SHIRT-HD-BLK-L",
"weight": {
"value": 143.989,
"unit": "ounce"
}
},
"ship_to": {
"name": "Amanda Miller",
"phone": "555-555-5555",
"address_line1": "525 S Winchester Blvd",
"city_locality": "San Jose",
"state_province": "CA",
"postal_code": "95128",
"country_code": "US",
"address_residential_indicator": "yes"
},
"requested_shipping_options": {
"shipping_service": "Priority Express Mail",
"ship_date": null
},
"price_summary": {
"unit_price": {
"currency": "usd",
"amount": 0
},
"estimated_tax": {
"currency": "usd",
"amount": 0
},
"estimated_shipping": null,
"total": {
"currency": "usd",
"amount": 0
}
},
"quantity": 1,
"is_gift": false
}
]
}
],
"total": 36,
"page": 1,
"pages": 36,
"links": {
"first": {
"href": "https://api.shipengine.com/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1"
},
"last": {
"href": "https://api.shipengine.com/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=36&page_size=1"
},
"prev": {},
"next": {
"href": "https://api.shipengine.com/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=2&page_size=1"
}
}
}
{
"sales_orders": [
{
"sales_order_id": "e5a64168-f8d5-5a30-9e93-57f3e61da87b",
"external_order_id": "1774",
"external_order_number": "#SH1801",
"order_source": {
"order_source_id": "0b6acb5a-430e-464d-a3f7-e7e0175a2a76",
"order_source_nickname": "My Shopify Shop",
"order_source_code": "shopify",
"order_source_friendly_name": "Shopify",
"refresh_info": {
"status": "idle",
"last_refresh_attempt": "2018-08-21T21:44:54.27Z",
"refresh_date": "2018-08-21T21:44:54.27Z"
},
"active": true
},
"sales_order_status": {
"payment_status": "unknown",
"fulfillment_status": "fulfilled",
"is_cancelled": false
},
"order_date": "2016-09-13T15:57:00Z",
"created_at": "2018-08-09T14:55:09.58Z",
"modified_at": "2018-08-09T14:55:09.58Z",
"payment_details": {
"subtotal": {
"currency": "usd",
"amount": 0
},
"estimated_shipping": {
"currency": "usd",
"amount": 22.38
},
"estimated_tax": {
"currency": "usd",
"amount": 1.85
},
"grand_total": {
"currency": "usd",
"amount": 24.23
}
},
"customer": {
"name": "Amanda Miller",
"phone": "555-555-5555",
"email": "[email protected]"
},
"bill_to": {
"email": "[email protected]",
"address": {
"name": null,
"phone": null,
"company_name": null,
"address_line1": "",
"address_line2": null,
"address_line3": null,
"city_locality": null,
"state_province": null,
"postal_code": null,
"country_code": null,
"address_residential_indicator": "no"
}
},
"ship_to": {
"name": "Amanda Miller",
"phone": "555-555-5555",
"address_line1": "525 S Winchester Blvd",
"city_locality": "San Jose",
"state_province": "CA",
"postal_code": "95128",
"country_code": "US",
"address_residential_indicator": "yes"
},
"sales_order_items": [
{
"sales_order_item_id": "eb8628f7-64ae-5df1-80c6-5e8f24099036",
"line_item_details": {
"name": "black hotdog shirt L (Default Title)",
"sku": "SHIRT-HD-BLK-L",
"weight": {
"value": 143.989,
"unit": "ounce"
}
},
"ship_to": {
"name": "Amanda Miller",
"phone": "555-555-5555",
"address_line1": "525 S Winchester Blvd",
"city_locality": "San Jose",
"state_province": "CA",
"postal_code": "95128",
"country_code": "US",
"address_residential_indicator": "yes"
},
"requested_shipping_options": {
"shipping_service": "Priority Express Mail",
"ship_date": null
},
"price_summary": {
"unit_price": {
"currency": "usd",
"amount": 0
},
"estimated_tax": {
"currency": "usd",
"amount": 0
},
"estimated_shipping": null,
"total": {
"currency": "usd",
"amount": 0
}
},
"quantity": 1,
"is_gift": false
}
]
}
],
"total": 36,
"page": 1,
"pages": 36,
"links": {
"first": {
"href": "https://api.shipengine.com/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1"
},
"last": {
"href": "https://api.shipengine.com/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=36&page_size=1"
},
"prev": {},
"next": {
"href": "https://api.shipengine.com/v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=2&page_size=1"
}
}
}