Materialize production artifacts for an order
curl --request POST \
--url https://api.autoprintfarm.com/public/v1/orders/{id}/produce \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.autoprintfarm.com/public/v1/orders/{id}/produce"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.autoprintfarm.com/public/v1/orders/{id}/produce', 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/orders/{id}/produce",
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://api.autoprintfarm.com/public/v1/orders/{id}/produce"
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://api.autoprintfarm.com/public/v1/orders/{id}/produce")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autoprintfarm.com/public/v1/orders/{id}/produce")
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{
"success": true,
"data": {
"order_status": "<string>",
"created_assembly_tasks": [
{
"order_item_id": "<string>",
"assembly_task_id": "<string>",
"worklist_task_id": "<string>",
"sku": "<string>",
"quantity": 123
}
],
"created_print_jobs": [
{
"order_item_id": "<string>",
"print_job_id": "<string>",
"sku": "<string>",
"number_of_units": 123,
"part_name": "<string>"
}
],
"shortages": [
{
"order_item_id": "<string>",
"sku": "<string>",
"shortages": [
"<unknown>"
]
}
],
"unmatched_items": [
{
"order_item_id": "<string>",
"sku": "<string>",
"reason": "<string>"
}
]
}
}{
"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>"
}
}Orders
Materialize production artifacts for an order
Side effect: creates kit_assembly tasks and queued print_job rows for every unfulfilled line item that does not already have live production artifacts. Idempotent — running it twice on the same order is a no-op for items already in production. Composite SKUs get one assembly task plus one print job per kit part. Per-item failures (BOM shortages, missing print files) are returned in shortages / unmatched_items and never abort the rest of the order.
POST
/
orders
/
{id}
/
produce
Materialize production artifacts for an order
curl --request POST \
--url https://api.autoprintfarm.com/public/v1/orders/{id}/produce \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.autoprintfarm.com/public/v1/orders/{id}/produce"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.autoprintfarm.com/public/v1/orders/{id}/produce', 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/orders/{id}/produce",
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://api.autoprintfarm.com/public/v1/orders/{id}/produce"
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://api.autoprintfarm.com/public/v1/orders/{id}/produce")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autoprintfarm.com/public/v1/orders/{id}/produce")
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{
"success": true,
"data": {
"order_status": "<string>",
"created_assembly_tasks": [
{
"order_item_id": "<string>",
"assembly_task_id": "<string>",
"worklist_task_id": "<string>",
"sku": "<string>",
"quantity": 123
}
],
"created_print_jobs": [
{
"order_item_id": "<string>",
"print_job_id": "<string>",
"sku": "<string>",
"number_of_units": 123,
"part_name": "<string>"
}
],
"shortages": [
{
"order_item_id": "<string>",
"sku": "<string>",
"shortages": [
"<unknown>"
]
}
],
"unmatched_items": [
{
"order_item_id": "<string>",
"sku": "<string>",
"reason": "<string>"
}
]
}
}{
"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
Was this page helpful?
⌘I