curl --request PATCH \
--url https://www.closient.com/products/api/v1/lots/templates/{template_id}/ \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"format_string": "LOT-{YYYY}-{####}",
"name": "Renamed template"
}
'import requests
url = "https://www.closient.com/products/api/v1/lots/templates/{template_id}/"
payload = {
"format_string": "LOT-{YYYY}-{####}",
"name": "Renamed template"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({format_string: 'LOT-{YYYY}-{####}', name: 'Renamed template'})
};
fetch('https://www.closient.com/products/api/v1/lots/templates/{template_id}/', 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/templates/{template_id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'format_string' => 'LOT-{YYYY}-{####}',
'name' => 'Renamed template'
]),
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/templates/{template_id}/"
payload := strings.NewReader("{\n \"format_string\": \"LOT-{YYYY}-{####}\",\n \"name\": \"Renamed template\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://www.closient.com/products/api/v1/lots/templates/{template_id}/")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"format_string\": \"LOT-{YYYY}-{####}\",\n \"name\": \"Renamed template\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/products/api/v1/lots/templates/{template_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"format_string\": \"LOT-{YYYY}-{####}\",\n \"name\": \"Renamed template\"\n}"
response = http.request(request)
puts response.read_body{
"character_set": "GS1_AI82",
"check_digit_algorithm": "none",
"created": "2026-05-02T10:00:00Z",
"description": "Daily lot codes for the Tomato Sauce line.",
"format_string": "LOT-{YYYY}{JJJ}-{####}",
"id": "AbCdEfGhIjKlMnOpQrStUv",
"is_archived": false,
"max_collision_retries": 5,
"modified": "2026-05-02T10:00:00Z",
"name": "Default Lot",
"reset_condition": "daily",
"scope_kind": "per_product",
"starting_value": 1,
"target_field": "lot",
"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"
}Update a lot template
Update template fields. A format-affecting change (format_string, character_set, check_digit_algorithm, target_field) on an in-use template bumps the version and migrates the counter forward, preserving the current sequence value. An unused template updates in place.
curl --request PATCH \
--url https://www.closient.com/products/api/v1/lots/templates/{template_id}/ \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"format_string": "LOT-{YYYY}-{####}",
"name": "Renamed template"
}
'import requests
url = "https://www.closient.com/products/api/v1/lots/templates/{template_id}/"
payload = {
"format_string": "LOT-{YYYY}-{####}",
"name": "Renamed template"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({format_string: 'LOT-{YYYY}-{####}', name: 'Renamed template'})
};
fetch('https://www.closient.com/products/api/v1/lots/templates/{template_id}/', 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/templates/{template_id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'format_string' => 'LOT-{YYYY}-{####}',
'name' => 'Renamed template'
]),
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/templates/{template_id}/"
payload := strings.NewReader("{\n \"format_string\": \"LOT-{YYYY}-{####}\",\n \"name\": \"Renamed template\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://www.closient.com/products/api/v1/lots/templates/{template_id}/")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"format_string\": \"LOT-{YYYY}-{####}\",\n \"name\": \"Renamed template\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/products/api/v1/lots/templates/{template_id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"format_string\": \"LOT-{YYYY}-{####}\",\n \"name\": \"Renamed template\"\n}"
response = http.request(request)
puts response.read_body{
"character_set": "GS1_AI82",
"check_digit_algorithm": "none",
"created": "2026-05-02T10:00:00Z",
"description": "Daily lot codes for the Tomato Sauce line.",
"format_string": "LOT-{YYYY}{JJJ}-{####}",
"id": "AbCdEfGhIjKlMnOpQrStUv",
"is_archived": false,
"max_collision_retries": 5,
"modified": "2026-05-02T10:00:00Z",
"name": "Default Lot",
"reset_condition": "daily",
"scope_kind": "per_product",
"starting_value": 1,
"target_field": "lot",
"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"
}Authorizations
Path Parameters
Template id (UUID or 22-char shortuuid).
Body
Request body for PATCH /lots/templates/{id}/. All fields optional; a
format-affecting change to an in-use template bumps the version and migrates
the counter forward.
New name.
128New token format (revalidated).
256New notes.
2000New alphabet identifier.
64New check-digit algorithm.
none, mod10, iso7064_11_2 New reset condition.
never, daily, weekly, monthly, on_product_change, on_count_reached, manual New on_count_reached threshold.
x >= 1New scope partitioning.
global, per_product, per_product_per_date_bucket, tag New post-reset starting value.
x >= 1New soft-retry budget.
0 <= x <= 50Response
OK
A saved generation recipe (latest version).
Template id (22-char shortuuid). Use in /lots/templates/{id}/ paths.
Human-readable template name.
Which GS1 field the identifiers populate.
lot, serial Token format, e.g. LOT-{YYYY}{JJJ}-{####} renders as LOT-2026123-0001.
Alphabet identifier or literal characters. Defaults to GS1 AI 82.
Optional check character appended after token expansion.
none, mod10, iso7064_11_2 When the counter resets to its starting value.
never, daily, weekly, monthly, on_product_change, on_count_reached, manual How the counter is partitioned (the scope_key shape).
global, per_product, per_product_per_date_bucket, tag Counter value used after a reset (first sequence emitted).
Soft-retry budget per identifier for random-source tokens before a hard collision.
Current template version. Bumps on a format-affecting edit while in use.
Archived templates cannot generate until unarchived.
Creation timestamp (ISO-8601).
Last-modified timestamp (ISO-8601).
Optional free-text notes.
Counter value that triggers a reset when reset_condition=on_count_reached.
Reserved for row-per-version chains; null in the current in-place versioning scheme.