Set base UOM for a unit class
curl --request POST \
--url https://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId}', 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://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"name": "<string>",
"base_class": true,
"unit_of_measures": [
{
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"unit_class_id": 123,
"unit_class": {
"id": 123,
"name": "<string>",
"base_class": true
},
"name": "<string>",
"description": "<string>",
"base_unit": true,
"unit_conversion_rules": [
{
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"base_unit_of_measure_id": 123,
"base_unit_of_measure": {
"id": 123,
"name": "<string>",
"unit_class_id": 123,
"base_unit": true
},
"converted_unit_of_measure_id": 123,
"converted_unit_of_measure": {
"id": 123,
"name": "<string>",
"unit_class_id": 123,
"base_unit": true
},
"conversion_factor": 123,
"product_id": 123,
"product": {},
"product_alternate_skus": [
{}
]
}
]
}
],
"base_unit_of_measure": {
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"unit_class_id": 123,
"unit_class": {
"id": 123,
"name": "<string>",
"base_class": true
},
"name": "<string>",
"description": "<string>",
"base_unit": true,
"unit_conversion_rules": [
{
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"base_unit_of_measure_id": 123,
"base_unit_of_measure": {
"id": 123,
"name": "<string>",
"unit_class_id": 123,
"base_unit": true
},
"converted_unit_of_measure_id": 123,
"converted_unit_of_measure": {
"id": 123,
"name": "<string>",
"unit_class_id": 123,
"base_unit": true
},
"conversion_factor": 123,
"product_id": 123,
"product": {},
"product_alternate_skus": [
{}
]
}
]
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Units of Measure
Set base UOM for a unit class
Mark a UOM as the base unit for its parent unit class. The previous base UOM (if any) is unset, and conversion factors continue to be expressed relative to the new base.
POST
/
unit-classes
/
{unitClassId}
/
default-unit-of-measure
/
{unitOfMeasureId}
Set base UOM for a unit class
curl --request POST \
--url https://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId}', 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://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/unit-classes/{unitClassId}/default-unit-of-measure/{unitOfMeasureId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"name": "<string>",
"base_class": true,
"unit_of_measures": [
{
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"unit_class_id": 123,
"unit_class": {
"id": 123,
"name": "<string>",
"base_class": true
},
"name": "<string>",
"description": "<string>",
"base_unit": true,
"unit_conversion_rules": [
{
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"base_unit_of_measure_id": 123,
"base_unit_of_measure": {
"id": 123,
"name": "<string>",
"unit_class_id": 123,
"base_unit": true
},
"converted_unit_of_measure_id": 123,
"converted_unit_of_measure": {
"id": 123,
"name": "<string>",
"unit_class_id": 123,
"base_unit": true
},
"conversion_factor": 123,
"product_id": 123,
"product": {},
"product_alternate_skus": [
{}
]
}
]
}
],
"base_unit_of_measure": {
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"unit_class_id": 123,
"unit_class": {
"id": 123,
"name": "<string>",
"base_class": true
},
"name": "<string>",
"description": "<string>",
"base_unit": true,
"unit_conversion_rules": [
{
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"base_unit_of_measure_id": 123,
"base_unit_of_measure": {
"id": 123,
"name": "<string>",
"unit_class_id": 123,
"base_unit": true
},
"converted_unit_of_measure_id": 123,
"converted_unit_of_measure": {
"id": 123,
"name": "<string>",
"unit_class_id": 123,
"base_unit": true
},
"conversion_factor": 123,
"product_id": 123,
"product": {},
"product_alternate_skus": [
{}
]
}
]
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Authenticate using a bearer token. To create a token, navigate to /settings/api-tokens and click Create API Token.
Path Parameters
Unit class ID
ID of the UOM to mark as base
Response
Base UOM updated
A grouping of related units of measure (e.g. "Length", "Weight"). Each class may have a base unit and a list of UOMs.
Show child attributes
Show child attributes
⌘I