curl --request POST \
--url https://api2.endstate.io/v1/units \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "unit-001",
"name": "Example Unit",
"attributes": {
"custom_attribute": "value"
},
"collection_id": "8e1a7f50-90ab-4cde-8012-3456789abcde"
}
'import requests
url = "https://api2.endstate.io/v1/units"
payload = {
"external_id": "unit-001",
"name": "Example Unit",
"attributes": { "custom_attribute": "value" },
"collection_id": "8e1a7f50-90ab-4cde-8012-3456789abcde"
}
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({
external_id: 'unit-001',
name: 'Example Unit',
attributes: {custom_attribute: 'value'},
collection_id: '8e1a7f50-90ab-4cde-8012-3456789abcde'
})
};
fetch('https://api2.endstate.io/v1/units', 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://api2.endstate.io/v1/units",
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([
'external_id' => 'unit-001',
'name' => 'Example Unit',
'attributes' => [
'custom_attribute' => 'value'
],
'collection_id' => '8e1a7f50-90ab-4cde-8012-3456789abcde'
]),
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 := "https://api2.endstate.io/v1/units"
payload := strings.NewReader("{\n \"external_id\": \"unit-001\",\n \"name\": \"Example Unit\",\n \"attributes\": {\n \"custom_attribute\": \"value\"\n },\n \"collection_id\": \"8e1a7f50-90ab-4cde-8012-3456789abcde\"\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("https://api2.endstate.io/v1/units")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"unit-001\",\n \"name\": \"Example Unit\",\n \"attributes\": {\n \"custom_attribute\": \"value\"\n },\n \"collection_id\": \"8e1a7f50-90ab-4cde-8012-3456789abcde\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api2.endstate.io/v1/units")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"unit-001\",\n \"name\": \"Example Unit\",\n \"attributes\": {\n \"custom_attribute\": \"value\"\n },\n \"collection_id\": \"8e1a7f50-90ab-4cde-8012-3456789abcde\"\n}"
response = http.request(request)
puts response.read_body{
"id": "33333333-3333-3333-3333-333333333333",
"external_id": "unit-001",
"name": "Example Unit",
"attributes": {
"custom_attribute": "value"
},
"created_at": "2026-05-16T12:00:00.000Z",
"redirect_url": null,
"collection": {
"id": "8e1a7f50-90ab-4cde-8012-3456789abcde",
"name": "Example Collection",
"external_id": "collection-001",
"contract": {
"address": "0x1111111111111111111111111111111111111111",
"chain_id": 84532,
"status": "active"
},
"token": {
"status": "pending",
"serial": null
}
},
"chips": []
}Create a unit
Creates a unit in your organization, inside the given collection.
curl --request POST \
--url https://api2.endstate.io/v1/units \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_id": "unit-001",
"name": "Example Unit",
"attributes": {
"custom_attribute": "value"
},
"collection_id": "8e1a7f50-90ab-4cde-8012-3456789abcde"
}
'import requests
url = "https://api2.endstate.io/v1/units"
payload = {
"external_id": "unit-001",
"name": "Example Unit",
"attributes": { "custom_attribute": "value" },
"collection_id": "8e1a7f50-90ab-4cde-8012-3456789abcde"
}
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({
external_id: 'unit-001',
name: 'Example Unit',
attributes: {custom_attribute: 'value'},
collection_id: '8e1a7f50-90ab-4cde-8012-3456789abcde'
})
};
fetch('https://api2.endstate.io/v1/units', 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://api2.endstate.io/v1/units",
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([
'external_id' => 'unit-001',
'name' => 'Example Unit',
'attributes' => [
'custom_attribute' => 'value'
],
'collection_id' => '8e1a7f50-90ab-4cde-8012-3456789abcde'
]),
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 := "https://api2.endstate.io/v1/units"
payload := strings.NewReader("{\n \"external_id\": \"unit-001\",\n \"name\": \"Example Unit\",\n \"attributes\": {\n \"custom_attribute\": \"value\"\n },\n \"collection_id\": \"8e1a7f50-90ab-4cde-8012-3456789abcde\"\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("https://api2.endstate.io/v1/units")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"unit-001\",\n \"name\": \"Example Unit\",\n \"attributes\": {\n \"custom_attribute\": \"value\"\n },\n \"collection_id\": \"8e1a7f50-90ab-4cde-8012-3456789abcde\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api2.endstate.io/v1/units")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"unit-001\",\n \"name\": \"Example Unit\",\n \"attributes\": {\n \"custom_attribute\": \"value\"\n },\n \"collection_id\": \"8e1a7f50-90ab-4cde-8012-3456789abcde\"\n}"
response = http.request(request)
puts response.read_body{
"id": "33333333-3333-3333-3333-333333333333",
"external_id": "unit-001",
"name": "Example Unit",
"attributes": {
"custom_attribute": "value"
},
"created_at": "2026-05-16T12:00:00.000Z",
"redirect_url": null,
"collection": {
"id": "8e1a7f50-90ab-4cde-8012-3456789abcde",
"name": "Example Collection",
"external_id": "collection-001",
"contract": {
"address": "0x1111111111111111111111111111111111111111",
"chain_id": 84532,
"status": "active"
},
"token": {
"status": "pending",
"serial": null
}
},
"chips": []
}Authorizations
Use Authorization: Bearer end_sk_* for partner API keys (e.g. end_sk_AbCd_example_api_key).
Body
Collection this unit belongs to.
"8e1a7f50-90ab-4cde-8012-3456789abcde"
Unique identifier for the unit within your organization.
1 - 256"unit-001"
Human-readable name for the unit.
1 - 256"Example Unit"
Free-form JSON attributes for the unit.
Show child attributes
Show child attributes
{ "custom_attribute": "value" }
Tap redirect URL for this unit. Omit or null for none.
"https://brand.example/p"
Response
Created unit.
Show child attributes
Show child attributes
Tap redirect URL for this unit; takes precedence over product/collection/org defaults.
"https://brand.example/p"
The unit's collection. Null only for units created before collections existed.
Show child attributes
Show child attributes
Chips paired to this unit.
Show child attributes
Show child attributes

