JavaScript
import HenrySDK from '@henrylabs/sdk';
const client = new HenrySDK({
apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted
});
const orders = await client.orders.list();
console.log(orders.data);curl --request GET \
--url https://api.henrylabs.ai/v1/orders \
--header 'x-api-key: <api-key>'import requests
url = "https://api.henrylabs.ai/v1/orders"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.henrylabs.ai/v1/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.henrylabs.ai/v1/orders"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.henrylabs.ai/v1/orders")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.henrylabs.ai/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"status": "<string>",
"message": "<string>",
"data": [
{
"refId": "<string>",
"products": [
{
"link": "<string>",
"quantity": 123,
"merchant": "<string>",
"host": "<string>",
"affiliateProductLink": "<string>",
"selectedOptions": [
"<string>"
],
"selectedShipping": {
"id": "<string>",
"value": "<string>"
}
}
],
"details": {
"hasAccount": true,
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"card": {
"nameOnCard": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"details": {},
"billingAddress": {
"line1": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"countryCode": "<string>",
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"email": "jsmith@example.com",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"line2": "<string>"
}
},
"email": "<string>",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"shippingAddress": {
"line1": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"countryCode": "<string>",
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"email": "jsmith@example.com",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"line2": "<string>"
},
"settings": {
"collectEmail": true,
"collectAddress": true,
"collectPhone": true
}
},
"result": {
"items": [
{
"productLink": "<string>",
"confirmationNumber": "<string>",
"costs": {
"total": {
"value": 123
},
"subtotal": {
"value": 123
},
"tax": {
"value": 123
},
"shipping": {
"value": 123
},
"discount": {
"value": 123
}
},
"quantity": 4503599627370495,
"shipping": {
"id": "<string>",
"name": "<string>",
"cost": {
"value": 123
},
"timeEstimate": "<string>",
"minDate": "<string>",
"maxDate": "<string>"
},
"appliedCoupon": {
"code": "<string>",
"savedAmount": {
"value": 123
}
},
"metadata": {}
}
],
"costs": {
"subtotal": {
"value": 123
},
"serviceFee": {
"value": 123
},
"total": {
"value": 123
}
}
},
"error": {}
}
]
}{
"success": true,
"status": "<string>",
"message": "<string>"
}{
"success": true,
"status": "<string>",
"message": "<string>"
}Orders
Orders List
Fetch a list of orders with optional filtering and pagination.
GET
/
orders
JavaScript
import HenrySDK from '@henrylabs/sdk';
const client = new HenrySDK({
apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted
});
const orders = await client.orders.list();
console.log(orders.data);curl --request GET \
--url https://api.henrylabs.ai/v1/orders \
--header 'x-api-key: <api-key>'import requests
url = "https://api.henrylabs.ai/v1/orders"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.henrylabs.ai/v1/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.henrylabs.ai/v1/orders"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.henrylabs.ai/v1/orders")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.henrylabs.ai/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"status": "<string>",
"message": "<string>",
"data": [
{
"refId": "<string>",
"products": [
{
"link": "<string>",
"quantity": 123,
"merchant": "<string>",
"host": "<string>",
"affiliateProductLink": "<string>",
"selectedOptions": [
"<string>"
],
"selectedShipping": {
"id": "<string>",
"value": "<string>"
}
}
],
"details": {
"hasAccount": true,
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"card": {
"nameOnCard": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"details": {},
"billingAddress": {
"line1": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"countryCode": "<string>",
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"email": "jsmith@example.com",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"line2": "<string>"
}
},
"email": "<string>",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"shippingAddress": {
"line1": "<string>",
"city": "<string>",
"province": "<string>",
"postalCode": "<string>",
"countryCode": "<string>",
"name": {
"firstName": "<string>",
"lastName": "<string>",
"middleName": "<string>"
},
"email": "jsmith@example.com",
"phone": {
"countryCode": "<string>",
"nationalNumber": "<string>",
"e164": "<string>",
"country": "<string>"
},
"line2": "<string>"
},
"settings": {
"collectEmail": true,
"collectAddress": true,
"collectPhone": true
}
},
"result": {
"items": [
{
"productLink": "<string>",
"confirmationNumber": "<string>",
"costs": {
"total": {
"value": 123
},
"subtotal": {
"value": 123
},
"tax": {
"value": 123
},
"shipping": {
"value": 123
},
"discount": {
"value": 123
}
},
"quantity": 4503599627370495,
"shipping": {
"id": "<string>",
"name": "<string>",
"cost": {
"value": 123
},
"timeEstimate": "<string>",
"minDate": "<string>",
"maxDate": "<string>"
},
"appliedCoupon": {
"code": "<string>",
"savedAmount": {
"value": 123
}
},
"metadata": {}
}
],
"costs": {
"subtotal": {
"value": 123
},
"serviceFee": {
"value": 123
},
"total": {
"value": 123
}
}
},
"error": {}
}
]
}{
"success": true,
"status": "<string>",
"message": "<string>"
}{
"success": true,
"status": "<string>",
"message": "<string>"
}Authorizations
Query Parameters
Cursor returned from the previous response
Example:
"2023-01-01T00:00:00Z"
Limit the number of results
Required range:
1 <= x <= 100Example:
20
Filter orders by status
Available options:
pending, processing, complete, cancelled Example:
"complete"
Filter orders by cart ID
Example:
"sa2aEsCz9PRM"
Was this page helpful?
⌘I