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 response = await client.cart.checkout.pollDetails({
refId: 'ckd-ref_3fa85f64-5717-4562-b3fc',
});
console.log(response.refId);curl --request GET \
--url https://api.henrylabs.ai/v1/cart/checkout/status \
--header 'x-api-key: <api-key>'import requests
url = "https://api.henrylabs.ai/v1/cart/checkout/status"
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/cart/checkout/status",
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/cart/checkout/status"
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/cart/checkout/status")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.henrylabs.ai/v1/cart/checkout/status")
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{
"refId": "<string>",
"result": {
"items": [
{
"shippingOptions": [
{
"id": "<string>",
"name": "<string>",
"cost": {
"value": 123
},
"timeEstimate": "<string>",
"minDate": "<string>",
"maxDate": "<string>"
}
],
"costs": {
"subtotal": {
"value": 123
},
"total": {
"value": 123
},
"tax": {
"value": 123
},
"shipping": {
"value": 123
},
"discount": {
"value": 123
}
},
"coupons": [
{
"code": "<string>",
"available": true,
"savedAmount": {
"value": 123
}
}
]
}
],
"data": {
"shippingOptions": [
{
"id": "<string>",
"name": "<string>",
"cost": {
"value": 123
},
"timeEstimate": "<string>",
"minDate": "<string>",
"maxDate": "<string>"
}
],
"costs": {
"subtotal": {
"value": 123
},
"total": {
"value": 123
},
"tax": {
"value": 123
},
"shipping": {
"value": 123
},
"discount": {
"value": 123
}
},
"coupons": [
{
"code": "<string>",
"available": true,
"savedAmount": {
"value": 123
}
}
]
}
},
"error": {}
}{
"success": true,
"status": "<string>",
"message": "<string>"
}{
"success": true,
"status": "<string>",
"message": "<string>"
}Cart
Cart Details Status
Check the status of a cart details retrieval job and get results when ready.
GET
/
cart
/
checkout
/
status
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 response = await client.cart.checkout.pollDetails({
refId: 'ckd-ref_3fa85f64-5717-4562-b3fc',
});
console.log(response.refId);curl --request GET \
--url https://api.henrylabs.ai/v1/cart/checkout/status \
--header 'x-api-key: <api-key>'import requests
url = "https://api.henrylabs.ai/v1/cart/checkout/status"
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/cart/checkout/status",
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/cart/checkout/status"
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/cart/checkout/status")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.henrylabs.ai/v1/cart/checkout/status")
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{
"refId": "<string>",
"result": {
"items": [
{
"shippingOptions": [
{
"id": "<string>",
"name": "<string>",
"cost": {
"value": 123
},
"timeEstimate": "<string>",
"minDate": "<string>",
"maxDate": "<string>"
}
],
"costs": {
"subtotal": {
"value": 123
},
"total": {
"value": 123
},
"tax": {
"value": 123
},
"shipping": {
"value": 123
},
"discount": {
"value": 123
}
},
"coupons": [
{
"code": "<string>",
"available": true,
"savedAmount": {
"value": 123
}
}
]
}
],
"data": {
"shippingOptions": [
{
"id": "<string>",
"name": "<string>",
"cost": {
"value": 123
},
"timeEstimate": "<string>",
"minDate": "<string>",
"maxDate": "<string>"
}
],
"costs": {
"subtotal": {
"value": 123
},
"total": {
"value": 123
},
"tax": {
"value": 123
},
"shipping": {
"value": 123
},
"discount": {
"value": 123
}
},
"coupons": [
{
"code": "<string>",
"available": true,
"savedAmount": {
"value": 123
}
}
]
}
},
"error": {}
}{
"success": true,
"status": "<string>",
"message": "<string>"
}{
"success": true,
"status": "<string>",
"message": "<string>"
}Authorizations
Query Parameters
Reference ID used for checking status
Pattern:
^[a-zA-Z]{3}-ref_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}$Example:
"ckd-ref_3fa85f64-5717-4562-b3fc"
Was this page helpful?
⌘I