Create or Update Asset Batch Data

Use this endpoint to create or update asset batch data. An asset batch represents a product (asset class) along with a batch or lot number. The data and documents contained on an asset batch record can be accessed regardless of where batches are located.


The result of the API is to create or update an asset batch.



Fields/Parameter Value
auth_key Your api key "blockchain address:secret key" assigned for the location receiving the product Required
gtin The globally unique item number of the product. Usually GTIN or UPC code. Required
lot Lot number, batch number, or serial number of the product. Required
data Optional data related to the item, purchase order, shipment that will be returned in a trace if included. Data must be formatted as a JSON object. Optional

Test it

Sample Code - PHP/Curl



//URL of the endpoint.
$url = '';

//Create an array of POST data to be sent to the endpoint.
$fields = array(
'auth_key' => $auth_key,
'gtin' => $gtin,
'lot' => $lot,
'data' => $data,
'documents' => $documents);

//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);

//execute post
$result = curl_exec($ch);

//echo the result
echo $result;

//close connection