Single cost rule
curl --request GET \
--url https://{companyName}.api.joinluminous.com/external/api/v1/cost-rules/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/cost-rules/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/cost-rules/{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://{companyName}.api.joinluminous.com/external/api/v1/cost-rules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/cost-rules/{id}"
req, _ := http.NewRequest("GET", 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.get("https://{companyName}.api.joinluminous.com/external/api/v1/cost-rules/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/cost-rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"vendor_id": 123,
"vendor_name": "<string>",
"name": "<string>",
"description": "<string>",
"document_types": [],
"priority": 123,
"is_active": true,
"effective_from": "2023-12-25",
"effective_to": "2023-12-25",
"moq": 123,
"order_multiple": 123,
"extra_cost_item_name": "<string>",
"cost_basis_amount": 123,
"shipment_type": "<string>",
"options": {
"auto_apply": true,
"add_as_additional_fee": true
},
"scopes": [
{
"id": 123,
"cost_rule_id": 123,
"scope_value": "<string>",
"scope_extra": {}
}
],
"conditions": [
{
"id": 123,
"cost_rule_id": 123,
"values": [
"<string>"
]
}
],
"tiers": [
{
"id": 123,
"cost_rule_id": 123,
"min_quantity": 123,
"max_quantity": 123,
"effects": [
{
"id": 123,
"cost_rule_id": 123,
"cost_rule_tier_id": 123,
"amount": 123,
"order": 123,
"description": "<string>"
}
]
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}Cost Rules
Single cost rule
Get a single cost rule by ID, including nested scopes, conditions,
tiers (with effects), and vendor_name. Requires the tenant
Cost Rules feature flag.
GET
/
cost-rules
/
{id}
Single cost rule
curl --request GET \
--url https://{companyName}.api.joinluminous.com/external/api/v1/cost-rules/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/cost-rules/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/cost-rules/{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://{companyName}.api.joinluminous.com/external/api/v1/cost-rules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/cost-rules/{id}"
req, _ := http.NewRequest("GET", 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.get("https://{companyName}.api.joinluminous.com/external/api/v1/cost-rules/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/cost-rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"vendor_id": 123,
"vendor_name": "<string>",
"name": "<string>",
"description": "<string>",
"document_types": [],
"priority": 123,
"is_active": true,
"effective_from": "2023-12-25",
"effective_to": "2023-12-25",
"moq": 123,
"order_multiple": 123,
"extra_cost_item_name": "<string>",
"cost_basis_amount": 123,
"shipment_type": "<string>",
"options": {
"auto_apply": true,
"add_as_additional_fee": true
},
"scopes": [
{
"id": 123,
"cost_rule_id": 123,
"scope_value": "<string>",
"scope_extra": {}
}
],
"conditions": [
{
"id": 123,
"cost_rule_id": 123,
"values": [
"<string>"
]
}
],
"tiers": [
{
"id": 123,
"cost_rule_id": 123,
"min_quantity": 123,
"max_quantity": 123,
"effects": [
{
"id": 123,
"cost_rule_id": 123,
"cost_rule_tier_id": 123,
"amount": 123,
"order": 123,
"description": "<string>"
}
]
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"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
Cost rule ID.
Response
Successful response
A cost rule — vendor-scoped tiered pricing or extra-cost rule applied to
purchase orders, work orders, and shipments. Nested scopes, conditions,
and tiers (with effects) are only present when the relation is loaded
(always on GET /cost-rules/{id}).
Show child attributes
Show child attributes
⌘I