Bill of Materials
List Bill of Materials
Section titled “List Bill of Materials”Returns the BOM recipe for each finished good SKU — which raw materials compose it and in what quantities.
GET
/api/v1/bill-of-materialsQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
format | string | json | Response format: json or excel |
limit | integer | 1000 | Max items per page (JSON only, 1–5000) |
offset | integer | 0 | Pagination offset (JSON only) |
sku_ids | array | - | Filter by parent finished good SKU IDs (Excel format only) |
Example Request
Section titled “Example Request”curl -X GET "https://api.prediko.io/api/v1/bill-of-materials?limit=100" \ -H "Authorization: Bearer YOUR_API_KEY"import requests
response = requests.get( "https://api.prediko.io/api/v1/bill-of-materials", headers={"Authorization": "Bearer YOUR_API_KEY"}, params={"limit": 100})bom_data = response.json()const response = await fetch( "https://api.prediko.io/api/v1/bill-of-materials?limit=100", { headers: { "Authorization": "Bearer YOUR_API_KEY" } });const bomData = await response.json();Response (JSON)
Section titled “Response (JSON)”{ "data": [ { "sku_name": "KingsF-Con", "unit_cost": 2.45, "production_time": 3, "bom": [ { "raw_material_name": "DB-GD-DST", "raw_material_quantity": 0.00034 }, { "raw_material_name": "BT-240ML-SQ", "raw_material_quantity": 1.0 } ] } ], "pagination": { "total": 234, "limit": 1000, "offset": 0, "has_more": false }}Response Fields
Section titled “Response Fields”| Field | Type | Description |
|---|---|---|
data | array | List of BOM entries |
pagination | object | Pagination metadata |
BOM Entry Object
Section titled “BOM Entry Object”| Field | Type | Description |
|---|---|---|
sku_name | string | Name of the finished good SKU |
unit_cost | number | null | Unit cost of the finished good (BOM cost or unit cost) |
production_time | integer | null | Production lead time in days |
bom | array | List of raw material components in the recipe |
BOM Component Object
Section titled “BOM Component Object”| Field | Type | Description |
|---|---|---|
raw_material_name | string | Name of the raw material SKU |
raw_material_quantity | number | Quantity of this raw material required per unit of finished good |
Excel Export
Section titled “Excel Export”To download the BOM as an Excel spreadsheet:
curl -X GET "https://api.prediko.io/api/v1/bill-of-materials?format=excel" \ -H "Authorization: Bearer YOUR_API_KEY" \ -o bill_of_materials.xlsximport requests
response = requests.get( "https://api.prediko.io/api/v1/bill-of-materials", headers={"Authorization": "Bearer YOUR_API_KEY"}, params={"format": "excel"})with open("bill_of_materials.xlsx", "wb") as f: f.write(response.content)Error Responses
Section titled “Error Responses”| Status | Description |
|---|---|
| 401 | Invalid or missing API key |
| 500 | Internal server error |