curl --request PUT \
--url https://api.exowpee.com/v1/catalog/uom-categories/{uom_category}/units/{unit} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/catalog/uom-categories/{uom_category}/units/{unit}"
payload = {
"name": "<string>",
"code": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', code: '<string>'})
};
fetch('https://api.exowpee.com/v1/catalog/uom-categories/{uom_category}/units/{unit}', 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/{uom_category}/units/{unit}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'code' => '<string>'
]),
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/{uom_category}/units/{unit}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.exowpee.com/v1/catalog/uom-categories/{uom_category}/units/{unit}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/uom-categories/{uom_category}/units/{unit}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"category_id": "<string>",
"name": "<string>",
"code": "<string>",
"conversion_factor": 123,
"is_reference": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}Edit a unit of measure
Changes a custom unit of measure.
curl --request PUT \
--url https://api.exowpee.com/v1/catalog/uom-categories/{uom_category}/units/{unit} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/catalog/uom-categories/{uom_category}/units/{unit}"
payload = {
"name": "<string>",
"code": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', code: '<string>'})
};
fetch('https://api.exowpee.com/v1/catalog/uom-categories/{uom_category}/units/{unit}', 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/{uom_category}/units/{unit}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'code' => '<string>'
]),
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/{uom_category}/units/{unit}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.exowpee.com/v1/catalog/uom-categories/{uom_category}/units/{unit}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/uom-categories/{uom_category}/units/{unit}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"category_id": "<string>",
"name": "<string>",
"code": "<string>",
"conversion_factor": 123,
"is_reference": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}uom_units.update
Conditions
- Built-in units cannot be changed.
- The name is lowercased and must stay unique within the category; the code must be unique in the organization (case-insensitive).
- Only the name and the code can change; the conversion factor and the reference flag cannot.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the category that owns the unit (27-character KSUID).
Identifier of the unit to update (27-character KSUID). It must belong to the category.
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, category_id, name, code, conversion_factor, is_reference, 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: .
Body
New unit name, lowercased; at most 120 characters and unique within the category. Omit to keep the current name.
120New short symbol, at most 10 characters, unique among the organization's units ignoring case. Omit to keep the current code.
10Response
Resource (only with response=resource).
Identifier of the unit (27-character KSUID).
Identifier of the category that owns the unit (27-character KSUID).
Lowercase name of the unit, unique within its category.
Short symbol of the unit, unique among the organization's units ignoring case.
Whole number of reference units in one of this unit; 1 for the reference unit.
True when this unit is the base unit of its category.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).