Assign a size-curve category to a product
curl --request PUT \
--url https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template-category \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"category_id": 3
}
'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template-category"
payload = { "category_id": 3 }
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({category_id: 3})
};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template-category', 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/products/{productId}/distribution-template-category",
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([
'category_id' => 3
]),
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://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template-category"
payload := strings.NewReader("{\n \"category_id\": 3\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://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template-category")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"category_id\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template-category")
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 \"category_id\": 3\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 3,
"name": "Women's Tops"
},
"message": "Size-curve category assigned."
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Distribution Templates
Assign a size-curve category to a product
Assigns a size-curve category to a master SKU. When a category is assigned (and no distribution template is directly pinned), the category is used for category × warehouse resolution of a distribution template at production-run drafting time. A directly pinned template always wins over category × warehouse resolution.
Only master SKUs can be assigned a size-curve category, and the category
must be active. The assigned category is returned in the
distribution_template_category field on the product response.
PUT
/
products
/
{productId}
/
distribution-template-category
Assign a size-curve category to a product
curl --request PUT \
--url https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template-category \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"category_id": 3
}
'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template-category"
payload = { "category_id": 3 }
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({category_id: 3})
};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template-category', 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/products/{productId}/distribution-template-category",
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([
'category_id' => 3
]),
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://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template-category"
payload := strings.NewReader("{\n \"category_id\": 3\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://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template-category")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"category_id\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template-category")
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 \"category_id\": 3\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 3,
"name": "Women's Tops"
},
"message": "Size-curve category assigned."
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Authorizations
Authenticate using a bearer token. To create a token, navigate to /settings/api-tokens and click Create API Token.
Path Parameters
Product ID (must be a master SKU)
Body
application/json
ID of the size-curve category to assign
Required range:
x >= 1