Get Product
curl --request GET \
--url https://api.khaime.com/api/v1/product/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.khaime.com/api/v1/product/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.khaime.com/api/v1/product/{id}', 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://api.khaime.com/api/v1/product/{id}",
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.khaime.com/api/v1/product/{id}"
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.khaime.com/api/v1/product/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.khaime.com/api/v1/product/{id}")
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{
"status": true,
"message": "Product retrieved successfully",
"data": {
"id": 12345,
"title": "Premium T-Shirt",
"slug": "premium-t-shirt",
"description": "High-quality cotton t-shirt with custom print",
"type": "physical_product",
"price": 2999,
"slash_price": null,
"is_slash_price": false,
"currency": "USD",
"is_published": true,
"images": [
{
"url": "https://cdn.khaime.com/products/123/main.jpg",
"alt": "Premium T-Shirt - Front"
},
{
"url": "https://cdn.khaime.com/products/123/back.jpg",
"alt": "Premium T-Shirt - Back"
}
],
"variations": [
{
"id": "var_001",
"variant_label": "Size: Medium",
"variant_price": 0,
"variation_quantity": 50,
"sku": "TSH-M-001"
},
{
"id": "var_002",
"variant_label": "Size: Large",
"variant_price": 200,
"variation_quantity": 30,
"sku": "TSH-L-001"
}
],
"categories": [
{
"id": 5,
"name": "Apparel"
}
],
"subscription_settings": {
"subscription_available": false
},
"shipping_rule_destinations": ["US", "CA", "GB"],
"currency_conversion_details": {
"currency": "USD",
"source_currency": "USD",
"exchange_rate": 1
}
}
}
Commerce API
Get Product
Get a single product by ID
GET
/
product
/
{id}
Get Product
curl --request GET \
--url https://api.khaime.com/api/v1/product/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.khaime.com/api/v1/product/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.khaime.com/api/v1/product/{id}', 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://api.khaime.com/api/v1/product/{id}",
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.khaime.com/api/v1/product/{id}"
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.khaime.com/api/v1/product/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.khaime.com/api/v1/product/{id}")
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{
"status": true,
"message": "Product retrieved successfully",
"data": {
"id": 12345,
"title": "Premium T-Shirt",
"slug": "premium-t-shirt",
"description": "High-quality cotton t-shirt with custom print",
"type": "physical_product",
"price": 2999,
"slash_price": null,
"is_slash_price": false,
"currency": "USD",
"is_published": true,
"images": [
{
"url": "https://cdn.khaime.com/products/123/main.jpg",
"alt": "Premium T-Shirt - Front"
},
{
"url": "https://cdn.khaime.com/products/123/back.jpg",
"alt": "Premium T-Shirt - Back"
}
],
"variations": [
{
"id": "var_001",
"variant_label": "Size: Medium",
"variant_price": 0,
"variation_quantity": 50,
"sku": "TSH-M-001"
},
{
"id": "var_002",
"variant_label": "Size: Large",
"variant_price": 200,
"variation_quantity": 30,
"sku": "TSH-L-001"
}
],
"categories": [
{
"id": 5,
"name": "Apparel"
}
],
"subscription_settings": {
"subscription_available": false
},
"shipping_rule_destinations": ["US", "CA", "GB"],
"currency_conversion_details": {
"currency": "USD",
"source_currency": "USD",
"exchange_rate": 1
}
}
}
Get Product
Returns detailed information about a single product.Request
string
required
Your API key
integer
required
The product ID
Query Parameters
string
Currency code for price conversion (e.g., “USD”, “EUR”)
string
Country code for regional pricing (e.g., “US”, “GB”)
Response
{
"status": true,
"message": "Product retrieved successfully",
"data": {
"id": 12345,
"title": "Premium T-Shirt",
"slug": "premium-t-shirt",
"description": "High-quality cotton t-shirt with custom print",
"type": "physical_product",
"price": 2999,
"slash_price": null,
"is_slash_price": false,
"currency": "USD",
"is_published": true,
"images": [
{
"url": "https://cdn.khaime.com/products/123/main.jpg",
"alt": "Premium T-Shirt - Front"
},
{
"url": "https://cdn.khaime.com/products/123/back.jpg",
"alt": "Premium T-Shirt - Back"
}
],
"variations": [
{
"id": "var_001",
"variant_label": "Size: Medium",
"variant_price": 0,
"variation_quantity": 50,
"sku": "TSH-M-001"
},
{
"id": "var_002",
"variant_label": "Size: Large",
"variant_price": 200,
"variation_quantity": 30,
"sku": "TSH-L-001"
}
],
"categories": [
{
"id": 5,
"name": "Apparel"
}
],
"subscription_settings": {
"subscription_available": false
},
"shipping_rule_destinations": ["US", "CA", "GB"],
"currency_conversion_details": {
"currency": "USD",
"source_currency": "USD",
"exchange_rate": 1
}
}
}
Errors
| Error Code | Description |
|---|---|
PRODUCT_NOT_FOUND | Product doesn’t exist or is not published |
Example
curl "https://api.khaime.com/api/v1/product/12345?currency=EUR" \
-H "X-API-Key: pk_live_your_api_key"
⌘I
