curl --request PUT \
--url https://api.emidat.com/v2/product-instances/{id}/bom \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"bom": [
{
"type": "supplier_product",
"ref": "33333333-3333-3333-3333-333333333333",
"mass_kg": 0.18
},
{
"type": "silo",
"ref": "88888888-8888-8888-8888-888888888888",
"mass_kg": 0.62
},
{
"type": "prechain_product",
"ref": "99999999-9999-9999-9999-999999999999",
"mass_kg": 0.2
}
]
}
'import requests
url = "https://api.emidat.com/v2/product-instances/{id}/bom"
payload = { "bom": [
{
"type": "supplier_product",
"ref": "33333333-3333-3333-3333-333333333333",
"mass_kg": 0.18
},
{
"type": "silo",
"ref": "88888888-8888-8888-8888-888888888888",
"mass_kg": 0.62
},
{
"type": "prechain_product",
"ref": "99999999-9999-9999-9999-999999999999",
"mass_kg": 0.2
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bom: [
{
type: 'supplier_product',
ref: '33333333-3333-3333-3333-333333333333',
mass_kg: 0.18
},
{type: 'silo', ref: '88888888-8888-8888-8888-888888888888', mass_kg: 0.62},
{
type: 'prechain_product',
ref: '99999999-9999-9999-9999-999999999999',
mass_kg: 0.2
}
]
})
};
fetch('https://api.emidat.com/v2/product-instances/{id}/bom', 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.emidat.com/v2/product-instances/{id}/bom",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bom' => [
[
'type' => 'supplier_product',
'ref' => '33333333-3333-3333-3333-333333333333',
'mass_kg' => 0.18
],
[
'type' => 'silo',
'ref' => '88888888-8888-8888-8888-888888888888',
'mass_kg' => 0.62
],
[
'type' => 'prechain_product',
'ref' => '99999999-9999-9999-9999-999999999999',
'mass_kg' => 0.2
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.emidat.com/v2/product-instances/{id}/bom"
payload := strings.NewReader("{\n \"bom\": [\n {\n \"type\": \"supplier_product\",\n \"ref\": \"33333333-3333-3333-3333-333333333333\",\n \"mass_kg\": 0.18\n },\n {\n \"type\": \"silo\",\n \"ref\": \"88888888-8888-8888-8888-888888888888\",\n \"mass_kg\": 0.62\n },\n {\n \"type\": \"prechain_product\",\n \"ref\": \"99999999-9999-9999-9999-999999999999\",\n \"mass_kg\": 0.2\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.emidat.com/v2/product-instances/{id}/bom")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"bom\": [\n {\n \"type\": \"supplier_product\",\n \"ref\": \"33333333-3333-3333-3333-333333333333\",\n \"mass_kg\": 0.18\n },\n {\n \"type\": \"silo\",\n \"ref\": \"88888888-8888-8888-8888-888888888888\",\n \"mass_kg\": 0.62\n },\n {\n \"type\": \"prechain_product\",\n \"ref\": \"99999999-9999-9999-9999-999999999999\",\n \"mass_kg\": 0.2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emidat.com/v2/product-instances/{id}/bom")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bom\": [\n {\n \"type\": \"supplier_product\",\n \"ref\": \"33333333-3333-3333-3333-333333333333\",\n \"mass_kg\": 0.18\n },\n {\n \"type\": \"silo\",\n \"ref\": \"88888888-8888-8888-8888-888888888888\",\n \"mass_kg\": 0.62\n },\n {\n \"type\": \"prechain_product\",\n \"ref\": \"99999999-9999-9999-9999-999999999999\",\n \"mass_kg\": 0.2\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"bom": [
{
"type": "supplier_product",
"ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mass_kg": 0.18
}
]
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant"
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant"
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant"
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant"
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant"
}Replace BOM
Replaces the instance’s entire BOM. Re-sending the same components is a no-op (idempotent).
Requires edit:recipes. Keys issued before that scope existed carry it
wherever they carry edit:products.
Every component must sit at a plant your key can reach — access to the instance does not extend to what its BOM points at.
curl --request PUT \
--url https://api.emidat.com/v2/product-instances/{id}/bom \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"bom": [
{
"type": "supplier_product",
"ref": "33333333-3333-3333-3333-333333333333",
"mass_kg": 0.18
},
{
"type": "silo",
"ref": "88888888-8888-8888-8888-888888888888",
"mass_kg": 0.62
},
{
"type": "prechain_product",
"ref": "99999999-9999-9999-9999-999999999999",
"mass_kg": 0.2
}
]
}
'import requests
url = "https://api.emidat.com/v2/product-instances/{id}/bom"
payload = { "bom": [
{
"type": "supplier_product",
"ref": "33333333-3333-3333-3333-333333333333",
"mass_kg": 0.18
},
{
"type": "silo",
"ref": "88888888-8888-8888-8888-888888888888",
"mass_kg": 0.62
},
{
"type": "prechain_product",
"ref": "99999999-9999-9999-9999-999999999999",
"mass_kg": 0.2
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bom: [
{
type: 'supplier_product',
ref: '33333333-3333-3333-3333-333333333333',
mass_kg: 0.18
},
{type: 'silo', ref: '88888888-8888-8888-8888-888888888888', mass_kg: 0.62},
{
type: 'prechain_product',
ref: '99999999-9999-9999-9999-999999999999',
mass_kg: 0.2
}
]
})
};
fetch('https://api.emidat.com/v2/product-instances/{id}/bom', 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.emidat.com/v2/product-instances/{id}/bom",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bom' => [
[
'type' => 'supplier_product',
'ref' => '33333333-3333-3333-3333-333333333333',
'mass_kg' => 0.18
],
[
'type' => 'silo',
'ref' => '88888888-8888-8888-8888-888888888888',
'mass_kg' => 0.62
],
[
'type' => 'prechain_product',
'ref' => '99999999-9999-9999-9999-999999999999',
'mass_kg' => 0.2
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.emidat.com/v2/product-instances/{id}/bom"
payload := strings.NewReader("{\n \"bom\": [\n {\n \"type\": \"supplier_product\",\n \"ref\": \"33333333-3333-3333-3333-333333333333\",\n \"mass_kg\": 0.18\n },\n {\n \"type\": \"silo\",\n \"ref\": \"88888888-8888-8888-8888-888888888888\",\n \"mass_kg\": 0.62\n },\n {\n \"type\": \"prechain_product\",\n \"ref\": \"99999999-9999-9999-9999-999999999999\",\n \"mass_kg\": 0.2\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.emidat.com/v2/product-instances/{id}/bom")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"bom\": [\n {\n \"type\": \"supplier_product\",\n \"ref\": \"33333333-3333-3333-3333-333333333333\",\n \"mass_kg\": 0.18\n },\n {\n \"type\": \"silo\",\n \"ref\": \"88888888-8888-8888-8888-888888888888\",\n \"mass_kg\": 0.62\n },\n {\n \"type\": \"prechain_product\",\n \"ref\": \"99999999-9999-9999-9999-999999999999\",\n \"mass_kg\": 0.2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emidat.com/v2/product-instances/{id}/bom")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bom\": [\n {\n \"type\": \"supplier_product\",\n \"ref\": \"33333333-3333-3333-3333-333333333333\",\n \"mass_kg\": 0.18\n },\n {\n \"type\": \"silo\",\n \"ref\": \"88888888-8888-8888-8888-888888888888\",\n \"mass_kg\": 0.62\n },\n {\n \"type\": \"prechain_product\",\n \"ref\": \"99999999-9999-9999-9999-999999999999\",\n \"mass_kg\": 0.2\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"bom": [
{
"type": "supplier_product",
"ref": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mass_kg": 0.18
}
]
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant"
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant"
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant"
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant"
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant"
}Authorizations
Per-manufacturer API key in the X-API-Key header, format
emidat-{key_id}-{secret} where key_id is a random public handle.
Issued by an owner in the Emidat
dashboard; carries its own permission scopes, optional plant
restrictions, and optional expiry. A revoked, expired, or unknown key
returns 401. See the Authentication guide for details.
Path Parameters
The instance's Emidat UUID.
Body
The instance's full set of components. Each (type, ref) pair may
appear at most once — duplicate components are rejected (422).
The order is stable across reads but is not the order you sent:
compare BOMs by (type, ref), not position.
Show child attributes
Show child attributes
Response
The instance's BOM after the replace (the components you just wrote).
The instance's full set of components. Each (type, ref) pair may
appear at most once — duplicate components are rejected (422).
The order is stable across reads but is not the order you sent:
compare BOMs by (type, ref), not position.
Show child attributes
Show child attributes