curl --request GET \
--url https://fit.kleep.ai/v1/products/{product_id}/sizing \
--header 'Authorization: Bearer <token>' \
--header 'Kleep-Retailer: <kleep-retailer>'import requests
url = "https://fit.kleep.ai/v1/products/{product_id}/sizing"
headers = {
"Kleep-Retailer": "<kleep-retailer>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Kleep-Retailer': '<kleep-retailer>', Authorization: 'Bearer <token>'}
};
fetch('https://fit.kleep.ai/v1/products/{product_id}/sizing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://fit.kleep.ai/v1/products/{product_id}/sizing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Kleep-Retailer: <kleep-retailer>"
],
]);
$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://fit.kleep.ai/v1/products/{product_id}/sizing"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Kleep-Retailer", "<kleep-retailer>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://fit.kleep.ai/v1/products/{product_id}/sizing")
.header("Kleep-Retailer", "<kleep-retailer>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://fit.kleep.ai/v1/products/{product_id}/sizing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Kleep-Retailer"] = '<kleep-retailer>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"product_id": "JEAN-0142",
"supported": true,
"category": "clothing",
"sizes": [
{
"label": "S",
"variant_id": "JEAN-0142-S",
"available": true
},
{
"label": "M",
"variant_id": "JEAN-0142-M",
"available": true
},
{
"label": "L",
"variant_id": "JEAN-0142-L",
"available": false
}
],
"product_fit": {
"tendency": "runs_small",
"score": -0.4,
"summary": "This style runs slightly small: most shoppers take one size up."
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "retailer_not_enabled",
"message": "Retailer 9b1f… has not enabled this partner"
}
}{
"error": {
"code": "product_not_found",
"message": "No product JEAN-9999 for this retailer"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests"
}
}Get product sizing
Whether Kleep can size the product, its sizes, how it fits (“does it run small?”) and, with include=questions, the questions to ask. No shopper data needed. Call it when the conversation turns to a product.
curl --request GET \
--url https://fit.kleep.ai/v1/products/{product_id}/sizing \
--header 'Authorization: Bearer <token>' \
--header 'Kleep-Retailer: <kleep-retailer>'import requests
url = "https://fit.kleep.ai/v1/products/{product_id}/sizing"
headers = {
"Kleep-Retailer": "<kleep-retailer>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Kleep-Retailer': '<kleep-retailer>', Authorization: 'Bearer <token>'}
};
fetch('https://fit.kleep.ai/v1/products/{product_id}/sizing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://fit.kleep.ai/v1/products/{product_id}/sizing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Kleep-Retailer: <kleep-retailer>"
],
]);
$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://fit.kleep.ai/v1/products/{product_id}/sizing"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Kleep-Retailer", "<kleep-retailer>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://fit.kleep.ai/v1/products/{product_id}/sizing")
.header("Kleep-Retailer", "<kleep-retailer>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://fit.kleep.ai/v1/products/{product_id}/sizing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Kleep-Retailer"] = '<kleep-retailer>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"product_id": "JEAN-0142",
"supported": true,
"category": "clothing",
"sizes": [
{
"label": "S",
"variant_id": "JEAN-0142-S",
"available": true
},
{
"label": "M",
"variant_id": "JEAN-0142-M",
"available": true
},
{
"label": "L",
"variant_id": "JEAN-0142-L",
"available": false
}
],
"product_fit": {
"tendency": "runs_small",
"score": -0.4,
"summary": "This style runs slightly small: most shoppers take one size up."
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "retailer_not_enabled",
"message": "Retailer 9b1f… has not enabled this partner"
}
}{
"error": {
"code": "product_not_found",
"message": "No product JEAN-9999 for this retailer"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests"
}
}Authorizations
Your partner API key: kp_live_… in production, kp_test_… on the sandbox retailer.
Headers
The retailer's Kleep public_id. Every call is scoped to one retailer.
Path Parameters
The retailer's product ID, as in its catalog.
Query Parameters
Add the questions that apply to this product.
questions BCP 47 language tag for prompts and sentences, for example fr-FR.
ISO 3166-1 alpha-2 country, for market-specific size labels.
Response
Product sizing.
true when Kleep can recommend a size for this product. Offer size help only then.
Sizing category of the product. It decides which questions apply.
clothing, lingerie, footwear, kids The product's sizes, in size order.
Show child attributes
Show child attributes
How the product fits compared to its size chart, from Kleep's purchase and return data. null when there isn't enough data.
Show child attributes
Show child attributes
Questions that apply to this product, when include=questions is set.
Show child attributes
Show child attributes
