Replace a kit's composition
curl --request PUT \
--url https://api.autoprintfarm.com/public/v1/products/{id}/kit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"variants": [
{
"color": "<string>",
"sku_id": "<string>",
"filament_type": "<string>",
"hex_code": "<string>",
"low_stock_threshold": 0,
"bundle_extras": [
{
"inventory_item_id": "<string>",
"quantity_required": 123
}
]
}
],
"parts": [
{
"name": "<string>",
"quantity_per_kit": 2,
"part_id": "<string>",
"print_file_id": "<string>",
"fixed_color": "<string>",
"fixed_hex_code": "<string>",
"requires_assembly": false,
"components": []
}
],
"description": "<string>",
"requires_post_processing": true,
"wiki_id": "<string>",
"bundle_extras": []
}
'import requests
url = "https://api.autoprintfarm.com/public/v1/products/{id}/kit"
payload = {
"name": "<string>",
"variants": [
{
"color": "<string>",
"sku_id": "<string>",
"filament_type": "<string>",
"hex_code": "<string>",
"low_stock_threshold": 0,
"bundle_extras": [
{
"inventory_item_id": "<string>",
"quantity_required": 123
}
]
}
],
"parts": [
{
"name": "<string>",
"quantity_per_kit": 2,
"part_id": "<string>",
"print_file_id": "<string>",
"fixed_color": "<string>",
"fixed_hex_code": "<string>",
"requires_assembly": False,
"components": []
}
],
"description": "<string>",
"requires_post_processing": True,
"wiki_id": "<string>",
"bundle_extras": []
}
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>',
variants: [
{
color: '<string>',
sku_id: '<string>',
filament_type: '<string>',
hex_code: '<string>',
low_stock_threshold: 0,
bundle_extras: [{inventory_item_id: '<string>', quantity_required: 123}]
}
],
parts: [
{
name: '<string>',
quantity_per_kit: 2,
part_id: '<string>',
print_file_id: '<string>',
fixed_color: '<string>',
fixed_hex_code: '<string>',
requires_assembly: false,
components: []
}
],
description: '<string>',
requires_post_processing: true,
wiki_id: '<string>',
bundle_extras: []
})
};
fetch('https://api.autoprintfarm.com/public/v1/products/{id}/kit', 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.autoprintfarm.com/public/v1/products/{id}/kit",
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>',
'variants' => [
[
'color' => '<string>',
'sku_id' => '<string>',
'filament_type' => '<string>',
'hex_code' => '<string>',
'low_stock_threshold' => 0,
'bundle_extras' => [
[
'inventory_item_id' => '<string>',
'quantity_required' => 123
]
]
]
],
'parts' => [
[
'name' => '<string>',
'quantity_per_kit' => 2,
'part_id' => '<string>',
'print_file_id' => '<string>',
'fixed_color' => '<string>',
'fixed_hex_code' => '<string>',
'requires_assembly' => false,
'components' => [
]
]
],
'description' => '<string>',
'requires_post_processing' => true,
'wiki_id' => '<string>',
'bundle_extras' => [
]
]),
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.autoprintfarm.com/public/v1/products/{id}/kit"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"color\": \"<string>\",\n \"sku_id\": \"<string>\",\n \"filament_type\": \"<string>\",\n \"hex_code\": \"<string>\",\n \"low_stock_threshold\": 0,\n \"bundle_extras\": [\n {\n \"inventory_item_id\": \"<string>\",\n \"quantity_required\": 123\n }\n ]\n }\n ],\n \"parts\": [\n {\n \"name\": \"<string>\",\n \"quantity_per_kit\": 2,\n \"part_id\": \"<string>\",\n \"print_file_id\": \"<string>\",\n \"fixed_color\": \"<string>\",\n \"fixed_hex_code\": \"<string>\",\n \"requires_assembly\": false,\n \"components\": []\n }\n ],\n \"description\": \"<string>\",\n \"requires_post_processing\": true,\n \"wiki_id\": \"<string>\",\n \"bundle_extras\": []\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.autoprintfarm.com/public/v1/products/{id}/kit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"color\": \"<string>\",\n \"sku_id\": \"<string>\",\n \"filament_type\": \"<string>\",\n \"hex_code\": \"<string>\",\n \"low_stock_threshold\": 0,\n \"bundle_extras\": [\n {\n \"inventory_item_id\": \"<string>\",\n \"quantity_required\": 123\n }\n ]\n }\n ],\n \"parts\": [\n {\n \"name\": \"<string>\",\n \"quantity_per_kit\": 2,\n \"part_id\": \"<string>\",\n \"print_file_id\": \"<string>\",\n \"fixed_color\": \"<string>\",\n \"fixed_hex_code\": \"<string>\",\n \"requires_assembly\": false,\n \"components\": []\n }\n ],\n \"description\": \"<string>\",\n \"requires_post_processing\": true,\n \"wiki_id\": \"<string>\",\n \"bundle_extras\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autoprintfarm.com/public/v1/products/{id}/kit")
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 \"variants\": [\n {\n \"color\": \"<string>\",\n \"sku_id\": \"<string>\",\n \"filament_type\": \"<string>\",\n \"hex_code\": \"<string>\",\n \"low_stock_threshold\": 0,\n \"bundle_extras\": [\n {\n \"inventory_item_id\": \"<string>\",\n \"quantity_required\": 123\n }\n ]\n }\n ],\n \"parts\": [\n {\n \"name\": \"<string>\",\n \"quantity_per_kit\": 2,\n \"part_id\": \"<string>\",\n \"print_file_id\": \"<string>\",\n \"fixed_color\": \"<string>\",\n \"fixed_hex_code\": \"<string>\",\n \"requires_assembly\": false,\n \"components\": []\n }\n ],\n \"description\": \"<string>\",\n \"requires_post_processing\": true,\n \"wiki_id\": \"<string>\",\n \"bundle_extras\": []\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"requires_assembly": true,
"requires_post_processing": true,
"image_url": "<string>",
"images": [
{
"id": "<string>",
"sort_order": 123,
"url": "<string>",
"thumb_url": "<string>"
}
],
"is_active": true,
"created_at": "<string>",
"updated_at": "<string>",
"skus": [
{
"id": "<string>",
"sku": "<string>",
"color": "<string>",
"filament_type": "<string>",
"hex_code": "<string>",
"quantity": 123,
"stock_level": 123,
"low_stock_threshold": 123,
"is_composite": true,
"is_active": true,
"created_at": "<string>",
"updated_at": "<string>"
}
],
"components": [
{
"id": "<string>",
"component_name": "<string>",
"component_type": "<string>",
"quantity_required": 123,
"notes": "<string>"
}
],
"kit": {
"parts": [
{
"part_id": "<string>",
"name": "<string>",
"print_file_id": "<string>",
"file_name": "<string>",
"quantity_per_kit": 123,
"color_mode": "match_kit",
"fixed_color": "<string>",
"requires_assembly": true,
"components": [
{
"id": "<string>",
"component_name": "<string>",
"component_type": "<string>",
"quantity_required": 123,
"notes": "<string>"
}
],
"variants": [
{
"kit_sku_id": "<string>",
"kit_color": "<string>",
"child_sku_id": "<string>",
"child_sku": "<string>",
"child_color": "<string>",
"child_on_hand": 123
}
]
}
],
"bundle_extras": [
{
"id": "<string>",
"sku_id": "<string>",
"inventory_type": "filament",
"inventory_item_id": "<string>",
"quantity_required": 123,
"created_at": "<string>",
"item_name": "<string>",
"remaining": 123,
"unit": "grams"
}
],
"bundle_extras_by_variant": {}
}
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}Products
Replace a kit's composition
Updates the kit’s variants/parts/bundle extras atomically. Existing SKUs that survive the update keep their finished_goods stock. 409 PART_IN_EXTERNAL_BOM if a removed part is referenced by another composite SKU; 409 SKU_IN_USE_BY_ORDER if a removed variant SKU has open order lines.
PUT
/
products
/
{id}
/
kit
Replace a kit's composition
curl --request PUT \
--url https://api.autoprintfarm.com/public/v1/products/{id}/kit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"variants": [
{
"color": "<string>",
"sku_id": "<string>",
"filament_type": "<string>",
"hex_code": "<string>",
"low_stock_threshold": 0,
"bundle_extras": [
{
"inventory_item_id": "<string>",
"quantity_required": 123
}
]
}
],
"parts": [
{
"name": "<string>",
"quantity_per_kit": 2,
"part_id": "<string>",
"print_file_id": "<string>",
"fixed_color": "<string>",
"fixed_hex_code": "<string>",
"requires_assembly": false,
"components": []
}
],
"description": "<string>",
"requires_post_processing": true,
"wiki_id": "<string>",
"bundle_extras": []
}
'import requests
url = "https://api.autoprintfarm.com/public/v1/products/{id}/kit"
payload = {
"name": "<string>",
"variants": [
{
"color": "<string>",
"sku_id": "<string>",
"filament_type": "<string>",
"hex_code": "<string>",
"low_stock_threshold": 0,
"bundle_extras": [
{
"inventory_item_id": "<string>",
"quantity_required": 123
}
]
}
],
"parts": [
{
"name": "<string>",
"quantity_per_kit": 2,
"part_id": "<string>",
"print_file_id": "<string>",
"fixed_color": "<string>",
"fixed_hex_code": "<string>",
"requires_assembly": False,
"components": []
}
],
"description": "<string>",
"requires_post_processing": True,
"wiki_id": "<string>",
"bundle_extras": []
}
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>',
variants: [
{
color: '<string>',
sku_id: '<string>',
filament_type: '<string>',
hex_code: '<string>',
low_stock_threshold: 0,
bundle_extras: [{inventory_item_id: '<string>', quantity_required: 123}]
}
],
parts: [
{
name: '<string>',
quantity_per_kit: 2,
part_id: '<string>',
print_file_id: '<string>',
fixed_color: '<string>',
fixed_hex_code: '<string>',
requires_assembly: false,
components: []
}
],
description: '<string>',
requires_post_processing: true,
wiki_id: '<string>',
bundle_extras: []
})
};
fetch('https://api.autoprintfarm.com/public/v1/products/{id}/kit', 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.autoprintfarm.com/public/v1/products/{id}/kit",
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>',
'variants' => [
[
'color' => '<string>',
'sku_id' => '<string>',
'filament_type' => '<string>',
'hex_code' => '<string>',
'low_stock_threshold' => 0,
'bundle_extras' => [
[
'inventory_item_id' => '<string>',
'quantity_required' => 123
]
]
]
],
'parts' => [
[
'name' => '<string>',
'quantity_per_kit' => 2,
'part_id' => '<string>',
'print_file_id' => '<string>',
'fixed_color' => '<string>',
'fixed_hex_code' => '<string>',
'requires_assembly' => false,
'components' => [
]
]
],
'description' => '<string>',
'requires_post_processing' => true,
'wiki_id' => '<string>',
'bundle_extras' => [
]
]),
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.autoprintfarm.com/public/v1/products/{id}/kit"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"color\": \"<string>\",\n \"sku_id\": \"<string>\",\n \"filament_type\": \"<string>\",\n \"hex_code\": \"<string>\",\n \"low_stock_threshold\": 0,\n \"bundle_extras\": [\n {\n \"inventory_item_id\": \"<string>\",\n \"quantity_required\": 123\n }\n ]\n }\n ],\n \"parts\": [\n {\n \"name\": \"<string>\",\n \"quantity_per_kit\": 2,\n \"part_id\": \"<string>\",\n \"print_file_id\": \"<string>\",\n \"fixed_color\": \"<string>\",\n \"fixed_hex_code\": \"<string>\",\n \"requires_assembly\": false,\n \"components\": []\n }\n ],\n \"description\": \"<string>\",\n \"requires_post_processing\": true,\n \"wiki_id\": \"<string>\",\n \"bundle_extras\": []\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.autoprintfarm.com/public/v1/products/{id}/kit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"color\": \"<string>\",\n \"sku_id\": \"<string>\",\n \"filament_type\": \"<string>\",\n \"hex_code\": \"<string>\",\n \"low_stock_threshold\": 0,\n \"bundle_extras\": [\n {\n \"inventory_item_id\": \"<string>\",\n \"quantity_required\": 123\n }\n ]\n }\n ],\n \"parts\": [\n {\n \"name\": \"<string>\",\n \"quantity_per_kit\": 2,\n \"part_id\": \"<string>\",\n \"print_file_id\": \"<string>\",\n \"fixed_color\": \"<string>\",\n \"fixed_hex_code\": \"<string>\",\n \"requires_assembly\": false,\n \"components\": []\n }\n ],\n \"description\": \"<string>\",\n \"requires_post_processing\": true,\n \"wiki_id\": \"<string>\",\n \"bundle_extras\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autoprintfarm.com/public/v1/products/{id}/kit")
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 \"variants\": [\n {\n \"color\": \"<string>\",\n \"sku_id\": \"<string>\",\n \"filament_type\": \"<string>\",\n \"hex_code\": \"<string>\",\n \"low_stock_threshold\": 0,\n \"bundle_extras\": [\n {\n \"inventory_item_id\": \"<string>\",\n \"quantity_required\": 123\n }\n ]\n }\n ],\n \"parts\": [\n {\n \"name\": \"<string>\",\n \"quantity_per_kit\": 2,\n \"part_id\": \"<string>\",\n \"print_file_id\": \"<string>\",\n \"fixed_color\": \"<string>\",\n \"fixed_hex_code\": \"<string>\",\n \"requires_assembly\": false,\n \"components\": []\n }\n ],\n \"description\": \"<string>\",\n \"requires_post_processing\": true,\n \"wiki_id\": \"<string>\",\n \"bundle_extras\": []\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"requires_assembly": true,
"requires_post_processing": true,
"image_url": "<string>",
"images": [
{
"id": "<string>",
"sort_order": 123,
"url": "<string>",
"thumb_url": "<string>"
}
],
"is_active": true,
"created_at": "<string>",
"updated_at": "<string>",
"skus": [
{
"id": "<string>",
"sku": "<string>",
"color": "<string>",
"filament_type": "<string>",
"hex_code": "<string>",
"quantity": 123,
"stock_level": 123,
"low_stock_threshold": 123,
"is_composite": true,
"is_active": true,
"created_at": "<string>",
"updated_at": "<string>"
}
],
"components": [
{
"id": "<string>",
"component_name": "<string>",
"component_type": "<string>",
"quantity_required": 123,
"notes": "<string>"
}
],
"kit": {
"parts": [
{
"part_id": "<string>",
"name": "<string>",
"print_file_id": "<string>",
"file_name": "<string>",
"quantity_per_kit": 123,
"color_mode": "match_kit",
"fixed_color": "<string>",
"requires_assembly": true,
"components": [
{
"id": "<string>",
"component_name": "<string>",
"component_type": "<string>",
"quantity_required": 123,
"notes": "<string>"
}
],
"variants": [
{
"kit_sku_id": "<string>",
"kit_color": "<string>",
"child_sku_id": "<string>",
"child_sku": "<string>",
"child_color": "<string>",
"child_on_hand": 123
}
]
}
],
"bundle_extras": [
{
"id": "<string>",
"sku_id": "<string>",
"inventory_type": "filament",
"inventory_item_id": "<string>",
"quantity_required": 123,
"created_at": "<string>",
"item_name": "<string>",
"remaining": 123,
"unit": "grams"
}
],
"bundle_extras_by_variant": {}
}
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}Authorizations
API keys are minted in the AutoPrintFarm web app under Settings → API Keys. Send as Authorization: Bearer apf_live_.... Keys are shown exactly once at creation and can be revoked at any time.
Path Parameters
Body
application/json
Required string length:
1 - 200Minimum array length:
1Show child attributes
Show child attributes
Minimum array length:
1Show child attributes
Show child attributes
Maximum string length:
2000Show child attributes
Show child attributes
Was this page helpful?
⌘I