Record weight and feed metrics for a flock Calculates daily rates and perform...
curl --request POST \
--url http://localhost:3000/api/v1/inventory/metrics/weight-and-feed \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"flockId": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/inventory/metrics/weight-and-feed"
payload = { "flockId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({flockId: '<string>'})
};
fetch('http://localhost:3000/api/v1/inventory/metrics/weight-and-feed', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/inventory/metrics/weight-and-feed",
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([
'flockId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:3000/api/v1/inventory/metrics/weight-and-feed"
payload := strings.NewReader("{\n \"flockId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost:3000/api/v1/inventory/metrics/weight-and-feed")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"flockId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/inventory/metrics/weight-and-feed")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"flockId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {}
}{
"error": "<string>",
"details": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Inventory
Record weight and feed metrics for a flock Calculates daily rates and perform...
Record weight and feed metrics for a flock Calculates daily rates and performance indicators IMPORTANT: Automatically accounts for mortality - feed per bird calculated only for living birds Body: { flockId: string, startWeightGrams: number, endWeightGrams: number, totalFeedConsumedKg: number, birdCount: number (optional, initial bird count), mortality: array of {date: ISO datetime, count: number} (optional, birds lost each day), feedType: string (optional), supplier: string (optional), measurementDate: ISO datetime (optional), notes: string (optional) } Example with mortality: { "flockId": "...", "startWeightGrams": 1200, "endWeightGrams": 1700, "totalFeedConsumedKg": 37000, "birdCount": 34000, "mortality": [ {"date": "2024-01-05T00:00:00Z", "count": 5}, {"date": "2024-01-10T00:00:00Z", "count": 2} ], "supplier": "Supplier A" } Result: Feed per bird calculated for 33,993 birds (34000 - 5 - 2), not 34000
**Required capabilities:** `create_movement`.
POST
/
api
/
v1
/
inventory
/
metrics
/
weight-and-feed
Record weight and feed metrics for a flock Calculates daily rates and perform...
curl --request POST \
--url http://localhost:3000/api/v1/inventory/metrics/weight-and-feed \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"flockId": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/inventory/metrics/weight-and-feed"
payload = { "flockId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({flockId: '<string>'})
};
fetch('http://localhost:3000/api/v1/inventory/metrics/weight-and-feed', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/inventory/metrics/weight-and-feed",
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([
'flockId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:3000/api/v1/inventory/metrics/weight-and-feed"
payload := strings.NewReader("{\n \"flockId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost:3000/api/v1/inventory/metrics/weight-and-feed")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"flockId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/inventory/metrics/weight-and-feed")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"flockId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {}
}{
"error": "<string>",
"details": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Was this page helpful?