Skip to main content
POST
/
production_batches
Post Production Batch
curl --request POST \
  --url https://api.sandbox.isometric.com/mrv/v0/production_batches \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-client-secret: <x-client-secret>' \
  --data '
{
  "ended_at": "2023-11-07T05:31:56Z",
  "facility_id": "fcl_1G8QT5ZAB1S0XSDW",
  "feedstock_type_ids": [
    "ftt_1D7KZ1P761S0G7BN"
  ],
  "kind": "biochar",
  "mass": {
    "magnitude": 123,
    "unit": "<string>",
    "standard_deviation": 123
  },
  "started_at": "2023-11-07T05:31:56Z",
  "supplier_reference_id": "<string>",
  "display_name": "<string>"
}
'
import requests

url = "https://api.sandbox.isometric.com/mrv/v0/production_batches"

payload = {
"ended_at": "2023-11-07T05:31:56Z",
"facility_id": "fcl_1G8QT5ZAB1S0XSDW",
"feedstock_type_ids": ["ftt_1D7KZ1P761S0G7BN"],
"kind": "biochar",
"mass": {
"magnitude": 123,
"unit": "<string>",
"standard_deviation": 123
},
"started_at": "2023-11-07T05:31:56Z",
"supplier_reference_id": "<string>",
"display_name": "<string>"
}
headers = {
"x-client-secret": "<x-client-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'x-client-secret': '<x-client-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ended_at: '2023-11-07T05:31:56Z',
facility_id: 'fcl_1G8QT5ZAB1S0XSDW',
feedstock_type_ids: ['ftt_1D7KZ1P761S0G7BN'],
kind: 'biochar',
mass: {magnitude: 123, unit: '<string>', standard_deviation: 123},
started_at: '2023-11-07T05:31:56Z',
supplier_reference_id: '<string>',
display_name: '<string>'
})
};

fetch('https://api.sandbox.isometric.com/mrv/v0/production_batches', 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.sandbox.isometric.com/mrv/v0/production_batches",
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([
'ended_at' => '2023-11-07T05:31:56Z',
'facility_id' => 'fcl_1G8QT5ZAB1S0XSDW',
'feedstock_type_ids' => [
'ftt_1D7KZ1P761S0G7BN'
],
'kind' => 'biochar',
'mass' => [
'magnitude' => 123,
'unit' => '<string>',
'standard_deviation' => 123
],
'started_at' => '2023-11-07T05:31:56Z',
'supplier_reference_id' => '<string>',
'display_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-client-secret: <x-client-secret>"
],
]);

$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.sandbox.isometric.com/mrv/v0/production_batches"

payload := strings.NewReader("{\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"facility_id\": \"fcl_1G8QT5ZAB1S0XSDW\",\n \"feedstock_type_ids\": [\n \"ftt_1D7KZ1P761S0G7BN\"\n ],\n \"kind\": \"biochar\",\n \"mass\": {\n \"magnitude\": 123,\n \"unit\": \"<string>\",\n \"standard_deviation\": 123\n },\n \"started_at\": \"2023-11-07T05:31:56Z\",\n \"supplier_reference_id\": \"<string>\",\n \"display_name\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-client-secret", "<x-client-secret>")
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("https://api.sandbox.isometric.com/mrv/v0/production_batches")
.header("x-client-secret", "<x-client-secret>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"facility_id\": \"fcl_1G8QT5ZAB1S0XSDW\",\n \"feedstock_type_ids\": [\n \"ftt_1D7KZ1P761S0G7BN\"\n ],\n \"kind\": \"biochar\",\n \"mass\": {\n \"magnitude\": 123,\n \"unit\": \"<string>\",\n \"standard_deviation\": 123\n },\n \"started_at\": \"2023-11-07T05:31:56Z\",\n \"supplier_reference_id\": \"<string>\",\n \"display_name\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.isometric.com/mrv/v0/production_batches")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-client-secret"] = '<x-client-secret>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"facility_id\": \"fcl_1G8QT5ZAB1S0XSDW\",\n \"feedstock_type_ids\": [\n \"ftt_1D7KZ1P761S0G7BN\"\n ],\n \"kind\": \"biochar\",\n \"mass\": {\n \"magnitude\": 123,\n \"unit\": \"<string>\",\n \"standard_deviation\": 123\n },\n \"started_at\": \"2023-11-07T05:31:56Z\",\n \"supplier_reference_id\": \"<string>\",\n \"display_name\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "display_name": "<string>",
  "ended_at": "2023-11-07T05:31:56Z",
  "facility_id": "fcl_1G8QT5ZAB1S0XSDW",
  "feedstock_type_ids": [
    "ftt_1D7KZ1P761S0G7BN"
  ],
  "id": "ptb_1GAFJ4C051S06E0Z",
  "kind": "biochar",
  "mass": {
    "magnitude": 123,
    "unit": "<string>",
    "standard_deviation": 123
  },
  "started_at": "2023-11-07T05:31:56Z",
  "supplier_reference_id": "<string>",
  "uploaded_at": "2023-11-07T05:31:56Z"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}

Authorizations

Authorization
string
header
required

A JWT Bearer token header for authentication and authorization, in the format Authorization: Bearer <token>

Headers

x-client-secret
string
required

A secret token identifying the client connecting to the API

Example:

"Syou3EZiO5vuMEgNyBeA8cjEMYOnQDwP"

Body

application/json
ended_at
string<date-time>
required

The date and time at which production of this production batch was completed

facility_id
string
required

The facility where the production batch was created

Required string length: 20 - 37
Examples:

"fcl_1G8QT5ZAB1S0XSDW"

"fcl_1E384BDCGSBXNNZZ"

feedstock_type_ids
string[]
required

The kinds of feedstock used to create this production batch

Required string length: 20 - 37
kind
enum<string>
required

The kind of production batch

Available options:
biochar
mass
ScalarQuantity · object
required
started_at
string<date-time>
required

The date and time at which production of this production batch was started

supplier_reference_id
string
required

A string that must be unique for all resources created by a specific supplier. It can be used by a client to identify the correct objects in their system.

Required string length: 1 - 200
display_name
string | null

The display name for this production batch. If not provided, one will be auto-generated from the facility name

Required string length: 1 - 150

Response

Successful Response

display_name
string
required
ended_at
string<date-time>
required
facility_id
string
required
Required string length: 20 - 37
Examples:

"fcl_1G8QT5ZAB1S0XSDW"

"fcl_1E384BDCGSBXNNZZ"

feedstock_type_ids
string[]
required
Required string length: 20 - 37
id
string
required
Required string length: 20 - 37
Examples:

"ptb_1GAFJ4C051S06E0Z"

"ptb_1FQVMJYTASBXSZT8"

kind
enum<string>
required
Available options:
biochar
mass
ScalarQuantity · object
required
started_at
string<date-time>
required
supplier_reference_id
string | null
required

A string that must be unique for all resources created by a specific supplier. It can be used by a client to identify the correct objects in their system.

Required string length: 1 - 200
uploaded_at
string<date-time>
required