API Documentation External

Kloopify API

v1.0.0 External

Unified API for the Kloopify platform. All endpoints require a valid JWT bearer token. Tenant isolation is enforced via the x-tenant-id header extracted from the token.

Getting Started

Welcome to the Kloopify API. This guide covers the basics of making requests and understanding responses.

Base URL

All API requests are made to:

https://api.kloopify.com

Request Format

The API accepts JSON request bodies and returns JSON responses. Set the following headers on every request:

Content-Type: application/json
Authorization: Bearer <your-token>

Response Format

Successful responses return a 2xx status code with a JSON body. Error responses include a message describing the issue:

{
  "statusCode": 400,
  "message": "Validation failed",
  "error": "Bad Request"
}

Pagination

List endpoints support pagination via offset and limit query parameters:

Parameter Default Description
offset 0 Number of records to skip
limit 100 Number of records to return (max 100)

Rate Limiting

API requests are rate-limited per account. If you exceed the limit, you'll receive a 429 Too Many Requests response. Back off and retry after the duration indicated in the Retry-After header.

Authentication

The Kloopify API uses JWT Bearer tokens for authentication. Every request must include a valid token in the Authorization header.

Obtaining a Token

Tokens are issued by our identity provider. Authenticate with your credentials to receive an access token:

POST https://auth.kloopify.com/oauth/token
Content-Type: application/json

{
  "client_id": "<your-client-id>",
  "client_secret": "<your-client-secret>",
  "audience": "https://api.kloopify.com",
  "grant_type": "client_credentials"
}

The response includes an access_token and its expiry:

{
  "access_token": "eyJhbGciOiJSUzI1NiIs...",
  "token_type": "Bearer",
  "expires_in": 86400
}

Using the Token

Include the token in the Authorization header of every API request:

Authorization: Bearer eyJhbGciOiJSUzI1NiIs...

Token Expiry

Tokens expire after the duration specified in expires_in (in seconds). When a token expires, the API returns 401 Unauthorized. Request a new token and retry.

Scopes

Access is controlled by scopes embedded in the token. If your token lacks the required scope for an endpoint, the API returns 403 Forbidden.

Running a Cost Analysis

This guide walks through submitting a cost analysis job, tracking its progress, and retrieving the results.

Overview

A cost analysis is an asynchronous operation. You submit a request describing a product and its manufacturer, the system processes it in the background, and you poll for the result. Once complete, the result contains IDs you can use to fetch the full cost analysis, bill of materials, product, and manufacturer records.

Step 1: Submit the Job

Create a cost analysis by posting to the pipeline endpoint:

POST /pipeline/cost-analysis
Content-Type: application/json
Authorization: Bearer <your-token>
{
  "productName": "EcoBottle 500ml",
  "manufacturerName": "GreenPack Industries",
  "countryOfOrigin": "DE",
  "productContext": "Reusable water bottle made from recycled stainless steel",
  "pricesPaid": [
    { "price": 1250, "currency": "USD", "date": "2025-01-15" }
  ]
}

The only required fields are productName and manufacturerName. Providing additional context improves the accuracy of the analysis:

Field Type Description
productName string Required. Name of the product
manufacturerName string Required. Name of the manufacturer
supplierNames string[] Supplier name(s)
productWebsite string URL for the product page
manufacturerWebsite string URL for the manufacturer
productContext string Free-text description of the product
manufacturerContext string Free-text description of the manufacturer
supplierContext string Free-text description of the supplier(s)
purchaserContext string Context about the purchaser
countryOfOrigin string ISO country code (defaults to US)
pricesPaid object[] Historical prices — each with price (number, required), currency (string, required), and date (string, optional)

The response is 201 Created with a job object:

{
  "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
  "type": "cost-analysis",
  "status": "pending",
  "step": null,
  "result": null,
  "started": null,
  "completed": null
}

Save the id — you'll use it to check on the job.

Step 2: Poll for Completion

Check the status of your job by its ID:

GET /pipeline/cost-analysis/{id}
Authorization: Bearer <your-token>

The status field progresses through these values:

Status Meaning
pending Job is queued
in_progress Job is actively processing
completed Job finished successfully
failed Job encountered an error

Poll every 5–10 seconds until status is completed or failed. The step field provides a human-readable description of what the system is currently working on.

When the job completes, the response includes a result object with IDs for all generated records:

{
  "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
  "type": "cost-analysis",
  "status": "completed",
  "step": "done",
  "result": {
    "costAnalysisId": "ca-uuid-here",
    "bomId": "bom-uuid-here",
    "productId": "product-uuid-here",
    "manufacturerId": "manufacturer-uuid-here"
  },
  "started": "2025-06-01T12:00:00.000Z",
  "completed": "2025-06-01T12:01:30.000Z"
}

If the job fails, errorMessage describes what went wrong.

Step 3: Retrieve the Results

Use the IDs from the result to fetch the generated records.

Cost Analysis

GET /cost-analysis/{costAnalysisId}
Authorization: Bearer <your-token>

Returns the cost analysis record including the shouldCostAmount and shouldCostStdErr (both in minor currency units, e.g. cents), the currency, and the analysisDate.

Bill of Materials

GET /bom/{bomId}
Authorization: Bearer <your-token>

Returns the bill of materials with a components list. Each component includes its name, type, cost, quantity, unitType, and countryOfOrigin.

To retrieve the full component details separately:

GET /bom/{bomId}/components
Authorization: Bearer <your-token>

Product and Manufacturer

The productId and manufacturerId can be used to retrieve the product and manufacturer (company) records:

GET /product/{productId}
GET /company/{manufacturerId}

Error Handling

  • 404 Not Found — The job or record ID does not exist.
  • 401 Unauthorized — Token is missing or expired. See the Authentication guide.
  • status: "failed" — The job did not complete. Check errorMessage on the job for details and resubmit if appropriate.

Bill of Materials

Retrieve bills of materials and their component breakdowns.

GET /bom/{id}

Get bom by ID

Parameters

NameInTypeRequiredDescription
id path string<uuid> required
related query string[] optional Include related entities. Omit for all, "false" for none, or specify field names (repeatable, supports dot notation)

Responses

200 Found
BomDto
FieldTypeDescription
id* string Unique identifier for the bill of materials record
version* string The version of BOM generation process.
generationDate* string Date and time when the BOM was generated
status string Status of the BOM generation process (e.g., "pending", "completed", "failed")
components BomComponentDto[] List of components and their costs that make up the product - accepts array of full objects, id strings, or id numbers
id* string Unique identifier for the BOM component
bom any The parent BOM - accepts full object, id string, or id number
name* string Name of the component in the bill of materials
type* string The type of the component (e.g., raw material, sub-assembly). If it is a sub-assembly, there should be information about the related product in the product object.
cost* number Cost of the component in minor currency units (e.g., cents)
quantity* number Quantity of the component used in the product
unitType* string Unit of measurement for the component (e.g., piece, kilogram, liter)
estimatedGramsPerUnit number Estimated grams of this component per unit.
estimatedCostPerUnit number Estimated cost in minor currency units (e.g., cents) of this component per unit.
estimatedCostPerUnitStdErr number Approximation of the standard error of the estimated cost in minor currency units (e.g., cents) of this component per unit.
countryOfOrigin string Country where the component is most likely manufactured (two digit ISO country code, e.g., US, CN).
isPackaging boolean Indicates if the component is packaging material
isWaste boolean Indicates if the component is waste material
sources string[] List of URIs to sources or references for the component information. This can be spec sheets, manufacturer websites, datasheets, etc.
confidence any Detailed confidence information about various aspects of the component data
justification string Explanation of the reasoning behind all of the mappings made in this component (e.g., sources, justification for assumptions, confidence, etc.). Keep this to less than 5000 characters. Can also include other considerations about this product.
materials RawMaterialEntryDto[] Estimated raw materials that make up this component. In the case that this component is just a single @raw-material-entry, this is just the one raw material itself in the array. In the case of a sub-assembly, this is the list of @raw-material-entries that make up the sub-assembly. - accepts array of full objects, id strings, or id numbers
id* string Unique identifier for the raw material
name* string The industrial or chemical name of the raw material (e.g., Poly ethylene, Stainless Steel, Copper, etc.). Be specific (e.g., not just plastic), without being overly niche. This should be just the raw material name. Use the purpose field for other descriptors.
bomComponent any The parent BOM component that this raw material entry is part of. - accepts full object, id string, or id number
htsusCode string Harmonized Tariff Schedule of the United States code for the material.
standard string The name of the standard used to classify this material (e.g. CAS, UNS, ISO 472, etc.).
standardId string The identifier value within that standard. (e.g., "7782-50-5" for CAS)
standardName string The text label of the value within that standard. (e.g., "Chlorine (elemental)" for CAS)
quantity* number Estimated quantity of this raw material in the sub-assembly.
unitType* string Unit of measurement for the raw material (e.g., ml, kgs, liters).
estimatedGramsPerUnit* number Estimated grams of this raw material per unit of the component.
estimatedCostPerUnit* number Estimated cost in minor currency units (e.g., cents) of this raw material per unit of the component.
estimatedCostPerUnitStdErr number Approximation of the standard error of the estimated cost in minor currency units (e.g., cents) of this raw material per unit of the component.
form string Physical form of the raw material (e.g., sheet, pellet, liquid, powder, etc.).
purpose* string Description of the purpose.
grade string Grade or quality of the raw material (e.g., food-grade, industrial-grade, etc.).
product any Information about the @product if the component is a sub-assembly. If the component is a raw material, this can be omitted. If the product is a sub-assembly, but the manufacturer of the sub-assembly is unknown or the sub-assembly is a commodity, you can leave the manufacturer as GENERIC.
404 Not found

Company

Look up company profiles and related information.

GET /company/{id}

Get company by ID

Parameters

NameInTypeRequiredDescription
id path string<uuid> required
related query string[] optional Include related entities. Omit for all, "false" for none, or specify field names (repeatable, supports dot notation)

Responses

200 Found
CompanyDto
FieldTypeDescription
id string id
name* string name
accountId string The account id that owns this company record. When null, the company record is considered public.
legalStructure string e.g., llc, inc, gmbh, pty
identifiers any Official business registration identifier. Key value pair. identifier: value identifiers include "ein", "vat", "duns", "crn"
country string Primary country of incorporation. Jurisdiction of registration. The country of the address. Two digit iso country code. e.g., US, CA, GB, DE.
naicsIndustries string[] List of applicable NAICS 2 digit NAICS codes that describe the companies industries.
naics string[] List of applicable NAICS 6 digit NAICS codes that described in more details applicable LOB.
founded string founded
domains string[] Company domain names, e.g., [www.google.com, abc.xyz]
website string The company's primary corporate website
status string The status of the company
headquarters any The headquarters address of the company - accepts full object, id string, or id number
employees number Approximate number of employees of the company
aliases string[] The aliases of the company
logos LogosDto[] The logos of the company
logo* string The logo of the company, maps to full GCS path.
status string status
description string description
start_date string start_date
end_date string end_date
socials SocialsDto[] The social media accounts of the company
type* string type
url string url
username string username
addresses AddressesDto[] The addresses of the company
type* string The type of address. e.g., office, branch, factory, etc.
address* any An address of the company - accepts full object, id string, or id number
metadata any Additional metadata about the company as key value pairs.
404 Not found

Product

Look up product profiles and related information.

GET /product/{id}

Get product by ID

Parameters

NameInTypeRequiredDescription
id path string<uuid> required
related query string[] optional Include related entities. Omit for all, "false" for none, or specify field names (repeatable, supports dot notation)

Responses

200 Found
ProductDto1
FieldTypeDescription
id* string Unique identifier for the product
name* string Name of the product
description string Detailed description of the product
retailPrice number Approximate, current price of the product, in minor currency units (e.g., cents)
retailPriceCurrency string Currency code for the retail price (e.g., USD, EUR)
manufacturerId* string FK to the @company that is the manufacturer of the product
unitType string Unit of measurement for the @product (e.g., piece, kilogram, liter)
status string Lifecycle status of the product
commoditized boolean Indicates if the product is classified as a commodity - very little differentiation between competitors
rawMaterial boolean Indicates if the product is considered a raw material used in manufacturing or production (e.g., steel, plastic, lumber)
parentProductId string FK to the parent @product, if applicable
countryOfOrigin string Country where the product is manufactured (ISO 3166 alpha-2 code, e.g., US, CN)
weightGrams number Product weight in grams
leadTimeDays number Typical lead time in days
minimumOrderQuantity number Minimum order quantity
metadata any Additional account specific metadata about the product
identifiers any Various identifiers associated with the product
urls any Various URLs associated with the product
404 Not found

Pipeline

Submit asynchronous analysis jobs such as cost-analysis pipelines.

POST /pipeline/cost-analysis

Submit a cost analysis pipeline request

Request Body

CostAnalysisRequestDto
FieldTypeDescription
id string Unique identifier for the pipeline request.
caVersion string The version of cost analysis generation process to use.
bomVersion string The version of bill of materials to use.
productName* string Name of the product.
manufacturerName* string Name of the manufacturer.
supplierNames string[] Supplier name(s).
productWebsite string Website of the product.
manufacturerWebsite string Website of the manufacturer.
productContext string Context about the product.
manufacturerContext string Context about the manufacturer.
supplierContext string Context about the supplier(s).
purchaserContext string Context about the purchaser.
countryOfOrigin string Country of origin for the product.
default: "US"
pricesPaid PricesPaidItemDto[] Historical prices paid.
date string Date when the price was paid.
price* number Price paid in minor currency units (e.g., cents).
currency* string Currency code (e.g., USD, EUR).

Responses

201 Job created
JobDto
FieldTypeDescription
id string Unique identifier for the job.
type* string The type of job to be executed, which can be used to determine the appropriate cost analysis generation process.
status* string The current status of the job (e.g., pending, in_progress, completed, failed).
payload any The input data for the job, which can be used by the cost analysis generation process.
result any The output data from the job, which can be used by the cost analysis generation process.
step string The current step of the job execution, which can be used to track progress through the cost analysis generation process.
started string Timestamp when the job was started.
completed string Timestamp when the job was completed.
errored string Timestamp when the job encountered an error, if applicable.
errorMessage string A message describing the error that occurred during job execution, if applicable.
GET /pipeline/cost-analysis/{id}

Get a cost analysis job by ID

Parameters

NameInTypeRequiredDescription
id path string<uuid> required

Responses

200 Found
CostAnalysisJobDto
FieldTypeDescription
id string Unique identifier for the job.
type* string The type of job to be executed, which can be used to determine the appropriate cost analysis generation process.
status* string The current status of the job (e.g., pending, in_progress, completed, failed).
payload any The input data for the job, which can be used by the cost analysis generation process.
step string The current step of the job execution, which can be used to track progress through the cost analysis generation process.
started string Timestamp when the job was started.
completed string Timestamp when the job was completed.
errored string Timestamp when the job encountered an error, if applicable.
errorMessage string A message describing the error that occurred during job execution, if applicable.
result CostAnalysisResultDto
id* string Unique identifier for the pipeline result.
costAnalysisId string The cost analysis ID.
bomId string The bill of materials ID.
productId string The product ID.
manufacturerId string The manufacturer ID.
404 Not found

Cost Analysis

Retrieve completed cost-analysis results and component-level details.

GET /cost-analysis/{id}

Get cost-analysis by ID

Parameters

NameInTypeRequiredDescription
id path string<uuid> required
related query string[] optional Include related entities. Omit for all, "false" for none, or specify field names (repeatable, supports dot notation)

Responses

200 Found
CostAnalysisDto
FieldTypeDescription
id* string Unique identifier for the cost analysis record
status* string Status of the cost analysis process (e.g., "pending", "completed", "failed")
analysisDate* string Date and time when the cost analysis was performed
method string Method used for the cost analysis
productId string FK to the @product for which the cost analysis is performed
purchaseId string FK to the @purchase associated with this cost analysis
currency string Currency code for the cost analysis (e.g., USD, EUR)
billOfMaterialsId string ID that references the bill of materials used for this cost analysis.
countryOfOrigin string The country of origin for the product. This may impact the cost analysis due to factors like tariffs, shipping costs, and local market conditions.
shouldCostAmount number Theoretical cost to produce the product, in minor currency units (e.g., cents)
shouldCostStdErr number Approximation of the standard error of the should-cost estimate, in minor currency units (e.g., cents)
components CostAnalysisComponentDto[] List of components and their costs that make up the product - accepts array of full objects, id strings, or id numbers
id* string Unique identifier for the cost analysis component record
name* string Name of the cost component (e.g., "direct materials", "production wages", etc.)
costAnalysis* any The parent cost analysis - accepts full object, id string, or id number
currency* string Currency code for the cost analysis (e.g., USD, EUR)
cost* number Cost amount for this component in minor currency units (e.g., cents)
costMin* number Minimum estimated cost for this component in minor currency units (e.g., cents)
costMax* number Maximum estimated cost for this component in minor currency units (e.g., cents)
supportingData any Key value pairs of additional supporting data for this cost component, e.g. datasets used
404 Not found