Discard a reserved run
curl --request POST \
--url https://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/ \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"mode": "burn",
"reason": "Contaminated batch"
}
'import requests
url = "https://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/"
payload = {
"mode": "burn",
"reason": "Contaminated batch"
}
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({mode: 'burn', reason: 'Contaminated batch'})
};
fetch('https://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/', 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://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/",
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([
'mode' => 'burn',
'reason' => 'Contaminated batch'
]),
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://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/"
payload := strings.NewReader("{\n \"mode\": \"burn\",\n \"reason\": \"Contaminated batch\"\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://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"burn\",\n \"reason\": \"Contaminated batch\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/")
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 \"mode\": \"burn\",\n \"reason\": \"Contaminated batch\"\n}"
response = http.request(request)
puts response.read_body{
"chunks_done": 1,
"chunks_total": 1,
"counter_state_after": 5,
"counter_state_before": 0,
"created": "2026-05-02T10:00:00Z",
"created_by_id": "UsAbCdEfGhIjKlMnOpQrSt",
"discard_reason": "",
"first_id": "LOT-2026123-0001",
"generated_ids": [
"LOT-2026123-0001",
"LOT-2026123-0002",
"LOT-2026123-0003",
"LOT-2026123-0004",
"LOT-2026123-0005"
],
"gtin": "00012345678905",
"hard_collisions": [],
"id": "RnAbCdEfGhIjKlMnOpQrSt",
"last_id": "LOT-2026123-0005",
"quantity": 5,
"scope_key": "00012345678905",
"soft_collision_count": 0,
"status": "reserved",
"template_id": "AbCdEfGhIjKlMnOpQrStUv",
"template_version": 1
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}Lots
Discard a reserved run
Discard a reserved run. rollback deletes the lots and rewinds the counter when safe (else silently burns); burn retires the lots and keeps the counter advanced (a reason is required). 409 if the run is not reserved.
POST
/
products
/
api
/
v1
/
lots
/
runs
/
{run_id}
/
discard
/
Discard a reserved run
curl --request POST \
--url https://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/ \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"mode": "burn",
"reason": "Contaminated batch"
}
'import requests
url = "https://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/"
payload = {
"mode": "burn",
"reason": "Contaminated batch"
}
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({mode: 'burn', reason: 'Contaminated batch'})
};
fetch('https://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/', 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://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/",
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([
'mode' => 'burn',
'reason' => 'Contaminated batch'
]),
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://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/"
payload := strings.NewReader("{\n \"mode\": \"burn\",\n \"reason\": \"Contaminated batch\"\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://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"burn\",\n \"reason\": \"Contaminated batch\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/products/api/v1/lots/runs/{run_id}/discard/")
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 \"mode\": \"burn\",\n \"reason\": \"Contaminated batch\"\n}"
response = http.request(request)
puts response.read_body{
"chunks_done": 1,
"chunks_total": 1,
"counter_state_after": 5,
"counter_state_before": 0,
"created": "2026-05-02T10:00:00Z",
"created_by_id": "UsAbCdEfGhIjKlMnOpQrSt",
"discard_reason": "",
"first_id": "LOT-2026123-0001",
"generated_ids": [
"LOT-2026123-0001",
"LOT-2026123-0002",
"LOT-2026123-0003",
"LOT-2026123-0004",
"LOT-2026123-0005"
],
"gtin": "00012345678905",
"hard_collisions": [],
"id": "RnAbCdEfGhIjKlMnOpQrSt",
"last_id": "LOT-2026123-0005",
"quantity": 5,
"scope_key": "00012345678905",
"soft_collision_count": 0,
"status": "reserved",
"template_id": "AbCdEfGhIjKlMnOpQrStUv",
"template_version": 1
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}Body
application/json
Request body for POST /lots/runs/{id}/discard/.
Response
OK
A generation run and its outcome.