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"],
"additional_information": [
{ "id": "gift_note", "label": "Gift Note", "type": "text", "required": false },
{ "id": "size", "label": "Size", "type": "select", "required": true, "options": ["S", "M", "L"] }
],
"attached_custom_form": null,
"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"],
"additional_information": [
{ "id": "gift_note", "label": "Gift Note", "type": "text", "required": false },
{ "id": "size", "label": "Size", "type": "select", "required": true, "options": ["S", "M", "L"] }
],
"attached_custom_form": null,
"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
3-letter ISO code to convert prices into (e.g.,
EUR). Any code from Get Currencies works. Omit it to get the product’s base currency.string
2-letter ISO code of the customer’s country, for regional pricing (e.g.,
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"],
"additional_information": [
{ "id": "gift_note", "label": "Gift Note", "type": "text", "required": false },
{ "id": "size", "label": "Size", "type": "select", "required": true, "options": ["S", "M", "L"] }
],
"attached_custom_form": null,
"currency_conversion_details": {
"currency": "USD",
"source_currency": "USD",
"exchange_rate": 1
}
}
}
Displaying prices in multiple currencies
To show a product in the customer’s currency, passcurrency. price, slash_price
and currency_conversion_details come back converted, still in the smallest unit of
that currency (kobo, pence, cents).
- Load the supported codes once from Get Currencies.
- Default to the customer’s local currency, detected from their IP, and let them change it. Get Currencies explains how.
- Send the chosen code on every product request.
curl "https://api.khaime.com/api/v1/product/12345?currency=NGN&country=NG" \
-H "X-API-Key: pk_live_your_api_key"
{
"data": {
"id": 12345,
"price": 2111444,
"currency": "NGN",
"currency_conversion_details": {
"price": 2111444,
"original_price": 1500,
"currency": "NGN",
"source_currency": "USD",
"exchange_rate": 1366.63
}
}
}
original_price and source_currency are the product’s base price. Rates move, so
fetch the price again when the customer changes currency rather than converting it
yourself.
Custom Fields
additional_information is the list of custom fields this product asks the customer
to fill in — which ones exist, what type each is, which are required, and the
allowed values for select and range fields.
This is where a checkout integration gets the form to render. Fetch the product
first, build inputs from this array, then send the customer’s answers back on the
cart line at /product-payment/intent keyed by each field’s id.
If the business has attached a shared custom form to this product, its fields are
merged into the same array and attached_custom_form names the form. Treat both
sources identically — they arrive in one list, already normalized.
An empty array (or an absent key) means the product has no custom fields, and any
answers submitted for it are discarded.
See Product Custom Fields for the
field schema, validation rules and how answers come back on the order.
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"
