KnalpotRacing Catalog API · v1.5.4

API documentation

The KnalpotRacing Catalog API is a read-only catalog service for marketplace and commerce applications.

Base URLhttps://api.knalpotracing.com
API status…
ProtocolHTTPS · JSON · UTF-8

Endpoints

Public catalog

GET/v1/catalog/public/

No authentication required. HET, stock, product media, brand and category fields are safe for storefront use.

Private catalog

GET/v1/catalog/private/

Server-to-server only. Public responses expose HET only. Private responses may expose the internal tiers authorized by the client scope.

Private pricingModal · Distributor · Reseller · Admin · Bengkel · HET

Health

GET/health/

Authentication

Private requests use HMAC-SHA256 signatures. Never expose a Client Secret in browser JavaScript, mobile bundles or public repositories.

Private credentials are not generated from the public website.KnalpotRacing administrators create, scope, rotate and revoke private credentials from the protected admin console.

Required headers

HeaderValue
X-KR-Client-IdClient ID
X-KR-TimestampUnix timestamp
X-KR-NonceUnique 16–160 character nonce
X-KR-Signature-Versionv1
X-KR-Signature64-character lowercase SHA-256 HMAC

Canonical request

Build the signing payload in exactly this order:

canonical-request.txt
HTTP_METHOD
PATH_WITH_SORTED_QUERY
TIMESTAMP
NONCE
SHA256(REQUEST_BODY)
  • Request method must be uppercase.
  • Request path with sorted query parameters must match the actual request.
  • Unix timestamp must stay inside the allowed clock skew.
  • Unique nonce may only be used once.
  • SHA-256 request body hash uses the exact raw body bytes.

Available scopes

ScopeDescription
catalog.readRead public/private catalog records.
pricing.internal.readRead restricted pricing tiers.
stock.readRead stock quantities and status.
orders.read / orders.writeReserved for commerce integration.
inventory.reserve / inventory.releaseReserved for commerce inventory flows.

Response schema

Public responses expose HET only. Private responses may expose the internal tiers authorized by the client scope.

private-product.json
{
  "id": 123,
  "barcode": "ABC-123",
  "name": "Product name",
  "prices": {
    "modal": 100000,
    "distributor": 110000,
    "reseller": 120000,
    "admin": 125000,
    "bengkel": 130000,
    "het": 150000
  },
  "stock": { "qty": 10, "status": "IN_STOCK" }
}

Common errors

CodeHTTPDescription
INVALID_SIGNATURE401Invalid or missing HMAC credentials.
REQUEST_EXPIRED401Timestamp is outside the allowed time window.
REPLAY_DETECTED409Nonce has already been used.
INSUFFICIENT_SCOPE403Client does not have the required scope.
RATE_LIMITED429Client request quota exceeded.

Code examples

Node.js
import crypto from "node:crypto";

const baseUrl = "https://api.knalpotracing.com";
const path = "/v1/catalog/private/";
const timestamp = Math.floor(Date.now() / 1000).toString();
const nonce = crypto.randomBytes(18).toString("hex");
const bodyHash = crypto.createHash("sha256").update("").digest("hex");
const canonical = ["GET", path, timestamp, nonce, bodyHash].join("\n");
const signature = crypto.createHmac("sha256", process.env.KR_CLIENT_SECRET)
  .update(canonical).digest("hex");

const response = await fetch(baseUrl + path, {
  headers: {
    "X-KR-Client-Id": process.env.KR_CLIENT_ID,
    "X-KR-Timestamp": timestamp,
    "X-KR-Nonce": nonce,
    "X-KR-Signature-Version": "v1",
    "X-KR-Signature": signature
  }
});
PHP
$clientId = getenv('KR_CLIENT_ID');
$secret = getenv('KR_CLIENT_SECRET');
$path = '/v1/catalog/private/';
$timestamp = (string) time();
$nonce = bin2hex(random_bytes(18));
$bodyHash = hash('sha256', '');
$canonical = implode("\n", ['GET', $path, $timestamp, $nonce, $bodyHash]);
$signature = hash_hmac('sha256', $canonical, $secret);

Request private API access

Private API access is issued manually after verification.

To request Client ID and Client Secret, contact the KnalpotRacing API administrator through WhatsApp. Credentials are created only after the intended use, environment and required scopes are reviewed.

Private credentials are not generated from the public website.KnalpotRacing administrators create, scope, rotate and revoke private credentials from the protected admin console.
Request access via WhatsApp →

Security notes

Client SecretDo not put this value in frontend code.
  • Store production secrets in server environment variables or a secret manager.
  • Use separate credentials for development, staging and production.
  • Enable IP restrictions when the production egress IP is stable.
  • Rotate credentials immediately if exposure is suspected.
  • Never log raw Client Secrets or canonical signing secrets.