curl --request POST \
--url https://api.exowpee.com/v1/catalog/uom-categories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"units": [
{
"name": "<string>",
"code": "<string>",
"conversion_factor": 123,
"is_reference": true
}
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/uom-categories"
payload = {
"name": "<string>",
"units": [
{
"name": "<string>",
"code": "<string>",
"conversion_factor": 123,
"is_reference": True
}
]
}
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({
name: '<string>',
units: [
{name: '<string>', code: '<string>', conversion_factor: 123, is_reference: true}
]
})
};
fetch('https://api.exowpee.com/v1/catalog/uom-categories', 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.exowpee.com/v1/catalog/uom-categories",
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([
'name' => '<string>',
'units' => [
[
'name' => '<string>',
'code' => '<string>',
'conversion_factor' => 123,
'is_reference' => true
]
]
]),
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://api.exowpee.com/v1/catalog/uom-categories"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"units\": [\n {\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"conversion_factor\": 123,\n \"is_reference\": true\n }\n ]\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://api.exowpee.com/v1/catalog/uom-categories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"units\": [\n {\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"conversion_factor\": 123,\n \"is_reference\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/uom-categories")
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 \"name\": \"<string>\",\n \"units\": [\n {\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"conversion_factor\": 123,\n \"is_reference\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"units": "<array>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}Create a measurement category
Creates a new family of units of measure together with its units.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/uom-categories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"units": [
{
"name": "<string>",
"code": "<string>",
"conversion_factor": 123,
"is_reference": true
}
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/uom-categories"
payload = {
"name": "<string>",
"units": [
{
"name": "<string>",
"code": "<string>",
"conversion_factor": 123,
"is_reference": True
}
]
}
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({
name: '<string>',
units: [
{name: '<string>', code: '<string>', conversion_factor: 123, is_reference: true}
]
})
};
fetch('https://api.exowpee.com/v1/catalog/uom-categories', 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.exowpee.com/v1/catalog/uom-categories",
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([
'name' => '<string>',
'units' => [
[
'name' => '<string>',
'code' => '<string>',
'conversion_factor' => 123,
'is_reference' => true
]
]
]),
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://api.exowpee.com/v1/catalog/uom-categories"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"units\": [\n {\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"conversion_factor\": 123,\n \"is_reference\": true\n }\n ]\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://api.exowpee.com/v1/catalog/uom-categories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"units\": [\n {\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"conversion_factor\": 123,\n \"is_reference\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/uom-categories")
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 \"name\": \"<string>\",\n \"units\": [\n {\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"conversion_factor\": 123,\n \"is_reference\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"units": "<array>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}uom_categories.create
Conditions
- The name is trimmed and lowercased, required, at most 120 characters, unique among the organization’s categories and cannot be the reserved name exowpee_bundle_count.
- At least one unit is required; unit names must be distinct and unit codes distinct (case-insensitive) and not already used by any unit of the organization.
- Exactly one unit must be the reference unit and its conversion factor must be 1; every other unit needs a conversion factor greater than 1.
- Conversion factors are integers.
- Creates the category (custom, not built-in) and inserts all its units in the same transaction; unit names are stored lowercased.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, name, created_at, updated_at.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: units.
Body
Name of the category. Trimmed and lowercased; required, at most 120 characters, unique in the organization and not the reserved exowpee_bundle_count.
120Units of the category. Required, at least one; exactly one must be the reference unit.
1Show child attributes
Show child attributes
Response
Resource (only with response=resource).
Identifier of the category (27-character KSUID).
Lowercase name of the category, unique within the organization.
Units of the category of the current organization. Present only when requested with include=units.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).