curl --request POST \
--url https://api.emidat.com/v2/supplier-plants \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"external_id": "SUPPLIER-PLANT-DE-001",
"supplier_company_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"name": "Acme Materials — Munich",
"address": {
"country": "DE",
"city": "Munich",
"street": "Musterstraße",
"house_number": "12",
"postal_code": "80331",
"state": "Bavaria",
"latitude": 48.1351,
"longitude": 11.575
}
}
'import requests
url = "https://api.emidat.com/v2/supplier-plants"
payload = {
"external_id": "SUPPLIER-PLANT-DE-001",
"supplier_company_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"name": "Acme Materials — Munich",
"address": {
"country": "DE",
"city": "Munich",
"street": "Musterstraße",
"house_number": "12",
"postal_code": "80331",
"state": "Bavaria",
"latitude": 48.1351,
"longitude": 11.575
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: 'SUPPLIER-PLANT-DE-001',
supplier_company_id: 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
name: 'Acme Materials — Munich',
address: {
country: 'DE',
city: 'Munich',
street: 'Musterstraße',
house_number: '12',
postal_code: '80331',
state: 'Bavaria',
latitude: 48.1351,
longitude: 11.575
}
})
};
fetch('https://api.emidat.com/v2/supplier-plants', 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/supplier-plants",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'external_id' => 'SUPPLIER-PLANT-DE-001',
'supplier_company_id' => 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
'name' => 'Acme Materials — Munich',
'address' => [
'country' => 'DE',
'city' => 'Munich',
'street' => 'Musterstraße',
'house_number' => '12',
'postal_code' => '80331',
'state' => 'Bavaria',
'latitude' => 48.1351,
'longitude' => 11.575
]
]),
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/supplier-plants"
payload := strings.NewReader("{\n \"external_id\": \"SUPPLIER-PLANT-DE-001\",\n \"supplier_company_id\": \"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa\",\n \"name\": \"Acme Materials — Munich\",\n \"address\": {\n \"country\": \"DE\",\n \"city\": \"Munich\",\n \"street\": \"Musterstraße\",\n \"house_number\": \"12\",\n \"postal_code\": \"80331\",\n \"state\": \"Bavaria\",\n \"latitude\": 48.1351,\n \"longitude\": 11.575\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.emidat.com/v2/supplier-plants")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"SUPPLIER-PLANT-DE-001\",\n \"supplier_company_id\": \"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa\",\n \"name\": \"Acme Materials — Munich\",\n \"address\": {\n \"country\": \"DE\",\n \"city\": \"Munich\",\n \"street\": \"Musterstraße\",\n \"house_number\": \"12\",\n \"postal_code\": \"80331\",\n \"state\": \"Bavaria\",\n \"latitude\": 48.1351,\n \"longitude\": 11.575\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emidat.com/v2/supplier-plants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"SUPPLIER-PLANT-DE-001\",\n \"supplier_company_id\": \"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa\",\n \"name\": \"Acme Materials — Munich\",\n \"address\": {\n \"country\": \"DE\",\n \"city\": \"Munich\",\n \"street\": \"Musterstraße\",\n \"house_number\": \"12\",\n \"postal_code\": \"80331\",\n \"state\": \"Bavaria\",\n \"latitude\": 48.1351,\n \"longitude\": 11.575\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"supplier_company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Acme Materials — Munich",
"address": {
"country": "DE",
"city": "Munich",
"latitude": 48.1351,
"longitude": 11.575,
"street": "Musterstraße",
"house_number": "12",
"postal_code": "80331",
"state": "Bavaria",
"formatted_address": "Musterstraße 12, 80331 Munich, Germany"
},
"created_at": "2023-11-07T05:31:56Z"
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"supplier_company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Acme Materials — Munich",
"address": {
"country": "DE",
"city": "Munich",
"latitude": 48.1351,
"longitude": 11.575,
"street": "Musterstraße",
"house_number": "12",
"postal_code": "80331",
"state": "Bavaria",
"formatted_address": "Musterstraße 12, 80331 Munich, Germany"
},
"created_at": "2023-11-07T05:31:56Z"
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
}
}Create supplier plant
The returned id is used as supplier_plant_id when creating supplier
products.
Idempotent create — a replay of the same Idempotency-Key returns the
original response (200); otherwise a new supplier plant is created
(201). Your external_id must be unique: reusing one returns 409. See
External IDs.
name must also be unique among that supplier company’s active plants,
compared case- and surrounding-whitespace-insensitively; a name already
held returns 409. Two different supplier companies may each have a
plant of the same name.
curl --request POST \
--url https://api.emidat.com/v2/supplier-plants \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"external_id": "SUPPLIER-PLANT-DE-001",
"supplier_company_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"name": "Acme Materials — Munich",
"address": {
"country": "DE",
"city": "Munich",
"street": "Musterstraße",
"house_number": "12",
"postal_code": "80331",
"state": "Bavaria",
"latitude": 48.1351,
"longitude": 11.575
}
}
'import requests
url = "https://api.emidat.com/v2/supplier-plants"
payload = {
"external_id": "SUPPLIER-PLANT-DE-001",
"supplier_company_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"name": "Acme Materials — Munich",
"address": {
"country": "DE",
"city": "Munich",
"street": "Musterstraße",
"house_number": "12",
"postal_code": "80331",
"state": "Bavaria",
"latitude": 48.1351,
"longitude": 11.575
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: 'SUPPLIER-PLANT-DE-001',
supplier_company_id: 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
name: 'Acme Materials — Munich',
address: {
country: 'DE',
city: 'Munich',
street: 'Musterstraße',
house_number: '12',
postal_code: '80331',
state: 'Bavaria',
latitude: 48.1351,
longitude: 11.575
}
})
};
fetch('https://api.emidat.com/v2/supplier-plants', 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/supplier-plants",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'external_id' => 'SUPPLIER-PLANT-DE-001',
'supplier_company_id' => 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
'name' => 'Acme Materials — Munich',
'address' => [
'country' => 'DE',
'city' => 'Munich',
'street' => 'Musterstraße',
'house_number' => '12',
'postal_code' => '80331',
'state' => 'Bavaria',
'latitude' => 48.1351,
'longitude' => 11.575
]
]),
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/supplier-plants"
payload := strings.NewReader("{\n \"external_id\": \"SUPPLIER-PLANT-DE-001\",\n \"supplier_company_id\": \"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa\",\n \"name\": \"Acme Materials — Munich\",\n \"address\": {\n \"country\": \"DE\",\n \"city\": \"Munich\",\n \"street\": \"Musterstraße\",\n \"house_number\": \"12\",\n \"postal_code\": \"80331\",\n \"state\": \"Bavaria\",\n \"latitude\": 48.1351,\n \"longitude\": 11.575\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.emidat.com/v2/supplier-plants")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"SUPPLIER-PLANT-DE-001\",\n \"supplier_company_id\": \"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa\",\n \"name\": \"Acme Materials — Munich\",\n \"address\": {\n \"country\": \"DE\",\n \"city\": \"Munich\",\n \"street\": \"Musterstraße\",\n \"house_number\": \"12\",\n \"postal_code\": \"80331\",\n \"state\": \"Bavaria\",\n \"latitude\": 48.1351,\n \"longitude\": 11.575\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emidat.com/v2/supplier-plants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"SUPPLIER-PLANT-DE-001\",\n \"supplier_company_id\": \"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa\",\n \"name\": \"Acme Materials — Munich\",\n \"address\": {\n \"country\": \"DE\",\n \"city\": \"Munich\",\n \"street\": \"Musterstraße\",\n \"house_number\": \"12\",\n \"postal_code\": \"80331\",\n \"state\": \"Bavaria\",\n \"latitude\": 48.1351,\n \"longitude\": 11.575\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"supplier_company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Acme Materials — Munich",
"address": {
"country": "DE",
"city": "Munich",
"latitude": 48.1351,
"longitude": 11.575,
"street": "Musterstraße",
"house_number": "12",
"postal_code": "80331",
"state": "Bavaria",
"formatted_address": "Musterstraße 12, 80331 Munich, Germany"
},
"created_at": "2023-11-07T05:31:56Z"
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"supplier_company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Acme Materials — Munich",
"address": {
"country": "DE",
"city": "Munich",
"latitude": 48.1351,
"longitude": 11.575,
"street": "Musterstraße",
"house_number": "12",
"postal_code": "80331",
"state": "Bavaria",
"formatted_address": "Musterstraße 12, 80331 Munich, Germany"
},
"created_at": "2023-11-07T05:31:56Z"
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
}
}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.
Headers
Optional client-generated key (e.g. a UUID) that makes a create
idempotent — the only mechanism that does so. A replay carrying the same
key returns the original response unchanged (200); reusing a key with a
different request body is rejected with 409. Keys are scoped to your
manufacturer and retained for 6h. See External IDs.
Body
UUID of the parent supplier company. Create via
POST /v2/supplier-companies, or resolve your code with
GET /v2/supplier-companies?plant_id=…&external_id=….
Name of the supplier plant. Unique among that supplier company's
active plants, compared ignoring case and surrounding whitespace —
a name already held returns 409 (err_supplier_plant_name_exists).
Two different supplier companies may each have a plant of the same
name.
"Acme Materials — Munich"
A postal address to store. Only country is required; every other field
is optional and stored as null when omitted. Do not send a country
beside this object — this is where it belongs.
Show child attributes
Show child attributes
Your own code for this supplier plant. Optional. When provided it is
unique among your active supplier plants — creating another with the
same code returns 409 (see External IDs).
"SUPPLIER-PLANT-DE-001"
Response
Returned unchanged — an Idempotency-Key replay.
Use this UUID as supplier_plant_id when creating supplier products.
Your own code for this supplier plant. null when none is set.
UUID of the parent supplier company.
"Acme Materials — Munich"
A postal address. country is the only field always present; the rest
are null when they were never captured. This object holds the country
— the resources carrying an address do not repeat it alongside.
Show child attributes
Show child attributes