Kajaria Ceramics

Dashboard  /  Internal API  /  v1

Product
Filter API

Returns active products matching any combination of colour, finish, series, size, surface, range and texture. Results are paginated. Every request needs an API key.

Method
POST
Format
JSON
Auth
API key header
Page size
20 default

Endpoint

Send a POST request with a JSON body. An empty body {} is valid and returns the first page unfiltered.

HTTP
POST https://dashboard.kajariaceramics.com/api/products/filter
Content-Type: application/json
X-API-KEY: kj_live_xxxxxxxxxxxxxxxx

Authentication

The key identifies which system is calling. Requests without a valid key are rejected before any database work happens.

Preferred — request header

Header
X-API-KEY: kj_live_xxxxxxxxxxxxxxxx

Fallback — inside the JSON body

Use this only where you cannot set custom headers. It works the same way, but the key ends up in request logs more often.

JSON
{
  "api_key": "kj_live_xxxxxxxxxxxxxxxx",
  "color": "Grey"
}
Getting a key. Keys are issued per integration, not per developer. Request one and say which system will use it — website, mobile app, dealer portal. Keys are never listed in this document.

Request body

All filter fields are optional. When several are supplied, a product must match every one of them.

FieldTypeRequiredDescriptionExample
colorstringOptionalProduct colour name"Grey"
finishstringOptionalFinish name"Matt"
seriesstringOptionalSeries name"Paris"
sizestringOptionalSize code"600x600"
surfacestringOptionalSurface type"Glossy"
rangestringOptionalProduct range"Luxury"
texturestringOptionalTexture / look and feel"Stone"
pageintegerOptionalPage number, 1-based. Defaults to 1.2
limitintegerOptionalProducts per page. Defaults to 20.50
api_keystringConditionalOnly if the key is not sent as a header"kj_live_…"

Filter values are matched exactly

Values are compared against the master tables as written — "Matt" matches, "matt " with a trailing space does not. Pull the options from your existing master lists rather than typing them by hand, and an unknown value returns an empty data array rather than an error.

Pagination

Cost of the count. Every request runs a second query to work out total. It is cheap at current catalogue size, but avoid calling the API in a tight loop just to read the count.

Response

Always Content-Type: application/json. The transport status is 200 on success; check the code and status fields in the body for the API's own result.

JSON
{
  "code": 200,
  "status": true,
  "user": "mobile_app",
  "page": 1,
  "limit": 20,
  "returned": 20,
  "total": 143,
  "total_pages": 8,
  "has_more": true,
  "data": [
    {
      "id": 123,
      "sku": "SKU001",
      "name": "Product Name",
      "description": "Product description",
      "status": 1,
      "images": [
        "https://www.kajariaceramics.com/storage/image1.jpg",
        "https://www.kajariaceramics.com/storage/image2.jpg"
      ]
    }
  ]
}
FieldTypeDescription
codeintegerResult code, mirrors HTTP conventions
statusbooleanTrue when the call succeeded
userstringName of the integration the key belongs to. Useful when debugging which key a request used.
pageintegerPage that was served
limitintegerPage size that was applied
returnedintegerNumber of products in data on this page
totalintegerAll active products matching the filters, ignoring pagination
total_pagesintegertotal divided by limit, rounded up
has_morebooleanTrue when at least one further page exists
dataarrayProduct objects

Product object

FieldTypeDescription
idintegerInternal product ID
skustringSKU code
namestringProduct name
descriptionstringProduct description
statusintegerAlways 1 — only active products are returned
imagesarrayAbsolute image URLs in display order. Empty array when a product has no images.
Additional columns from the products table may appear in each object and can be added over time. Read the fields you need by name and ignore the rest, so a new column never breaks your integration.

Errors

Errors return the same JSON shape with status: false and a message.

CodeMessageWhat it meansHow to fix it
400Invalid JSONBody missing or malformedSend valid JSON, and {} rather than an empty body
401API key missingNo key in the header or the bodyAdd the X-API-KEY header
401Invalid API keyKey not recognised or revokedCheck for stray whitespace, then request a fresh key
405Only POST allowedRequest used GET or another methodSwitch to POST
500Internal Server ErrorFailure on the server sideReport it with the timestamp and the request body
JSON
// 401 response
{
  "code": 401,
  "status": false,
  "message": "Invalid API key"
}
Getting "File not found"? That comes from the web server, not this API, and means the URL never reached the script. Check the path character by character, then try /api/filter-products.php directly to confirm the server is reachable — a 405 Only POST allowed from a browser is the expected healthy response there.

Examples

Same request in four clients. Replace the placeholder with the key issued to your integration.

cURL

bash
curl -X POST https://dashboard.kajariaceramics.com/api/products/filter \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: kj_live_xxxxxxxxxxxxxxxx" \
  -d '{"color":"Grey","finish":"Matt","page":1,"limit":20}'

JavaScript

js
const res = await fetch("https://dashboard.kajariaceramics.com/api/products/filter", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-KEY": process.env.KAJARIA_API_KEY
  },
  body: JSON.stringify({ color: "Grey", page: 1, limit: 20 })
});

const json = await res.json();
if (!json.status) throw new Error(json.message);
console.log(json.data);
Browser callers. Do not put a key in front-end JavaScript — anyone can read it. Call this API from your own server and pass the results down to the browser.

PHP

php
$ch = curl_init("https://dashboard.kajariaceramics.com/api/products/filter");
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        "Content-Type: application/json",
        "X-API-KEY: " . getenv("KAJARIA_API_KEY")
    ],
    CURLOPT_POSTFIELDS     => json_encode(["color" => "Grey", "limit" => 20])
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);

Python

python
import os, requests

r = requests.post(
    "https://dashboard.kajariaceramics.com/api/products/filter",
    headers={"X-API-KEY": os.environ["KAJARIA_API_KEY"]},
    json={"series": "Paris", "page": 1, "limit": 50},
    timeout=15,
)
payload = r.json()

Common request bodies

JSON
// first 20 products, no filters
{}

// one filter
{ "color": "White" }

// two filters combined
{ "color": "Grey", "finish": "Matt" }

// page 2, fifty per page
{ "page": 2, "limit": 50 }