Assign a distribution template to a product
curl --request PUT \
--url https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"distribution_template_id": 12
}
'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template"
payload = { "distribution_template_id": 12 }
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({distribution_template_id: 12})
};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template', 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",
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([
'distribution_template_id' => 12
]),
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"
payload := strings.NewReader("{\n \"distribution_template_id\": 12\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"distribution_template_id\": 12\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template")
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 \"distribution_template_id\": 12\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 12,
"name": "Women's Tops - Standard",
"source": "assigned"
},
"message": "Distribution template assigned."
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Distribution Templates
Assign a distribution template to a product
Assigns a distribution template (size curve) to a master SKU. The template
must be compatible with the product’s variant axes — use
GET /products/{productId}/distribution-template/candidates to find valid
options. Only master SKUs with variant axes defined can be assigned a template.
The assigned template is returned in the distribution_template field on
the product response and overrides the tenant default when resolving for
production-run drafting.
PUT
/
products
/
{productId}
/
distribution-template
Assign a distribution template to a product
curl --request PUT \
--url https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"distribution_template_id": 12
}
'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template"
payload = { "distribution_template_id": 12 }
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({distribution_template_id: 12})
};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template', 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",
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([
'distribution_template_id' => 12
]),
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"
payload := strings.NewReader("{\n \"distribution_template_id\": 12\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"distribution_template_id\": 12\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/products/{productId}/distribution-template")
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 \"distribution_template_id\": 12\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 12,
"name": "Women's Tops - Standard",
"source": "assigned"
},
"message": "Distribution template 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 distribution template to assign