Create an order
curl --request POST \
--url https://api.autoprintfarm.com/public/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_name": "<string>",
"items": [
{
"sku": "<string>",
"product_name": "<string>",
"quantity": 2,
"unit_price": 1,
"product_sku_id": "<string>",
"notes": "<string>"
}
],
"order_number": "<string>",
"platform": "manual",
"customer_email": "jsmith@example.com",
"customer_phone": "<string>",
"order_date": "2023-11-07T05:31:56Z",
"total_revenue": 1,
"shipping_cost": 0,
"tax_amount": 0,
"discount_amount": 0,
"shipping_street": "<string>",
"shipping_city": "<string>",
"shipping_state": "<string>",
"shipping_zip": "<string>",
"shipping_country": "USA",
"external_id": "<string>",
"notes": "<string>"
}
'import requests
url = "https://api.autoprintfarm.com/public/v1/orders"
payload = {
"customer_name": "<string>",
"items": [
{
"sku": "<string>",
"product_name": "<string>",
"quantity": 2,
"unit_price": 1,
"product_sku_id": "<string>",
"notes": "<string>"
}
],
"order_number": "<string>",
"platform": "manual",
"customer_email": "jsmith@example.com",
"customer_phone": "<string>",
"order_date": "2023-11-07T05:31:56Z",
"total_revenue": 1,
"shipping_cost": 0,
"tax_amount": 0,
"discount_amount": 0,
"shipping_street": "<string>",
"shipping_city": "<string>",
"shipping_state": "<string>",
"shipping_zip": "<string>",
"shipping_country": "USA",
"external_id": "<string>",
"notes": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_name: '<string>',
items: [
{
sku: '<string>',
product_name: '<string>',
quantity: 2,
unit_price: 1,
product_sku_id: '<string>',
notes: '<string>'
}
],
order_number: '<string>',
platform: 'manual',
customer_email: 'jsmith@example.com',
customer_phone: '<string>',
order_date: '2023-11-07T05:31:56Z',
total_revenue: 1,
shipping_cost: 0,
tax_amount: 0,
discount_amount: 0,
shipping_street: '<string>',
shipping_city: '<string>',
shipping_state: '<string>',
shipping_zip: '<string>',
shipping_country: 'USA',
external_id: '<string>',
notes: '<string>'
})
};
fetch('https://api.autoprintfarm.com/public/v1/orders', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_name' => '<string>',
'items' => [
[
'sku' => '<string>',
'product_name' => '<string>',
'quantity' => 2,
'unit_price' => 1,
'product_sku_id' => '<string>',
'notes' => '<string>'
]
],
'order_number' => '<string>',
'platform' => 'manual',
'customer_email' => 'jsmith@example.com',
'customer_phone' => '<string>',
'order_date' => '2023-11-07T05:31:56Z',
'total_revenue' => 1,
'shipping_cost' => 0,
'tax_amount' => 0,
'discount_amount' => 0,
'shipping_street' => '<string>',
'shipping_city' => '<string>',
'shipping_state' => '<string>',
'shipping_zip' => '<string>',
'shipping_country' => 'USA',
'external_id' => '<string>',
'notes' => '<string>'
]),
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/orders"
payload := strings.NewReader("{\n \"customer_name\": \"<string>\",\n \"items\": [\n {\n \"sku\": \"<string>\",\n \"product_name\": \"<string>\",\n \"quantity\": 2,\n \"unit_price\": 1,\n \"product_sku_id\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"order_number\": \"<string>\",\n \"platform\": \"manual\",\n \"customer_email\": \"jsmith@example.com\",\n \"customer_phone\": \"<string>\",\n \"order_date\": \"2023-11-07T05:31:56Z\",\n \"total_revenue\": 1,\n \"shipping_cost\": 0,\n \"tax_amount\": 0,\n \"discount_amount\": 0,\n \"shipping_street\": \"<string>\",\n \"shipping_city\": \"<string>\",\n \"shipping_state\": \"<string>\",\n \"shipping_zip\": \"<string>\",\n \"shipping_country\": \"USA\",\n \"external_id\": \"<string>\",\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.autoprintfarm.com/public/v1/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_name\": \"<string>\",\n \"items\": [\n {\n \"sku\": \"<string>\",\n \"product_name\": \"<string>\",\n \"quantity\": 2,\n \"unit_price\": 1,\n \"product_sku_id\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"order_number\": \"<string>\",\n \"platform\": \"manual\",\n \"customer_email\": \"jsmith@example.com\",\n \"customer_phone\": \"<string>\",\n \"order_date\": \"2023-11-07T05:31:56Z\",\n \"total_revenue\": 1,\n \"shipping_cost\": 0,\n \"tax_amount\": 0,\n \"discount_amount\": 0,\n \"shipping_street\": \"<string>\",\n \"shipping_city\": \"<string>\",\n \"shipping_state\": \"<string>\",\n \"shipping_zip\": \"<string>\",\n \"shipping_country\": \"USA\",\n \"external_id\": \"<string>\",\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autoprintfarm.com/public/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_name\": \"<string>\",\n \"items\": [\n {\n \"sku\": \"<string>\",\n \"product_name\": \"<string>\",\n \"quantity\": 2,\n \"unit_price\": 1,\n \"product_sku_id\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"order_number\": \"<string>\",\n \"platform\": \"manual\",\n \"customer_email\": \"jsmith@example.com\",\n \"customer_phone\": \"<string>\",\n \"order_date\": \"2023-11-07T05:31:56Z\",\n \"total_revenue\": 1,\n \"shipping_cost\": 0,\n \"tax_amount\": 0,\n \"discount_amount\": 0,\n \"shipping_street\": \"<string>\",\n \"shipping_city\": \"<string>\",\n \"shipping_state\": \"<string>\",\n \"shipping_zip\": \"<string>\",\n \"shipping_country\": \"USA\",\n \"external_id\": \"<string>\",\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"order_number": "<string>",
"platform": "<string>",
"customer_name": "<string>",
"customer_email": "<string>",
"customer_phone": "<string>",
"order_date": "<string>",
"status": "<string>",
"total_revenue": 123,
"shipping_cost": 123,
"tax_amount": 123,
"discount_amount": 123,
"shipping_street": "<string>",
"shipping_city": "<string>",
"shipping_state": "<string>",
"shipping_zip": "<string>",
"shipping_country": "<string>",
"tracking_number": "<string>",
"tracking_url": "<string>",
"shipped_at": "<string>",
"external_id": "<string>",
"notes": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"items": [
{
"id": "<string>",
"product_sku_id": "<string>",
"sku": "<string>",
"product_name": "<string>",
"quantity": 123,
"unit_price": 123,
"total_price": 123,
"quantity_fulfilled": 123,
"fulfillment_status": "<string>",
"notes": "<string>",
"created_at": "<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
Create an order
Creates an order with line items and returns it. Rejects unknown product SKUs (400 INVALID_PRODUCT_SKU) and duplicate order numbers (409 DUPLICATE_ORDER_NUMBER). Raw integration payloads (external_data) cannot be set via the public API.
POST
/
orders
Create an order
curl --request POST \
--url https://api.autoprintfarm.com/public/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_name": "<string>",
"items": [
{
"sku": "<string>",
"product_name": "<string>",
"quantity": 2,
"unit_price": 1,
"product_sku_id": "<string>",
"notes": "<string>"
}
],
"order_number": "<string>",
"platform": "manual",
"customer_email": "jsmith@example.com",
"customer_phone": "<string>",
"order_date": "2023-11-07T05:31:56Z",
"total_revenue": 1,
"shipping_cost": 0,
"tax_amount": 0,
"discount_amount": 0,
"shipping_street": "<string>",
"shipping_city": "<string>",
"shipping_state": "<string>",
"shipping_zip": "<string>",
"shipping_country": "USA",
"external_id": "<string>",
"notes": "<string>"
}
'import requests
url = "https://api.autoprintfarm.com/public/v1/orders"
payload = {
"customer_name": "<string>",
"items": [
{
"sku": "<string>",
"product_name": "<string>",
"quantity": 2,
"unit_price": 1,
"product_sku_id": "<string>",
"notes": "<string>"
}
],
"order_number": "<string>",
"platform": "manual",
"customer_email": "jsmith@example.com",
"customer_phone": "<string>",
"order_date": "2023-11-07T05:31:56Z",
"total_revenue": 1,
"shipping_cost": 0,
"tax_amount": 0,
"discount_amount": 0,
"shipping_street": "<string>",
"shipping_city": "<string>",
"shipping_state": "<string>",
"shipping_zip": "<string>",
"shipping_country": "USA",
"external_id": "<string>",
"notes": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_name: '<string>',
items: [
{
sku: '<string>',
product_name: '<string>',
quantity: 2,
unit_price: 1,
product_sku_id: '<string>',
notes: '<string>'
}
],
order_number: '<string>',
platform: 'manual',
customer_email: 'jsmith@example.com',
customer_phone: '<string>',
order_date: '2023-11-07T05:31:56Z',
total_revenue: 1,
shipping_cost: 0,
tax_amount: 0,
discount_amount: 0,
shipping_street: '<string>',
shipping_city: '<string>',
shipping_state: '<string>',
shipping_zip: '<string>',
shipping_country: 'USA',
external_id: '<string>',
notes: '<string>'
})
};
fetch('https://api.autoprintfarm.com/public/v1/orders', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_name' => '<string>',
'items' => [
[
'sku' => '<string>',
'product_name' => '<string>',
'quantity' => 2,
'unit_price' => 1,
'product_sku_id' => '<string>',
'notes' => '<string>'
]
],
'order_number' => '<string>',
'platform' => 'manual',
'customer_email' => 'jsmith@example.com',
'customer_phone' => '<string>',
'order_date' => '2023-11-07T05:31:56Z',
'total_revenue' => 1,
'shipping_cost' => 0,
'tax_amount' => 0,
'discount_amount' => 0,
'shipping_street' => '<string>',
'shipping_city' => '<string>',
'shipping_state' => '<string>',
'shipping_zip' => '<string>',
'shipping_country' => 'USA',
'external_id' => '<string>',
'notes' => '<string>'
]),
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/orders"
payload := strings.NewReader("{\n \"customer_name\": \"<string>\",\n \"items\": [\n {\n \"sku\": \"<string>\",\n \"product_name\": \"<string>\",\n \"quantity\": 2,\n \"unit_price\": 1,\n \"product_sku_id\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"order_number\": \"<string>\",\n \"platform\": \"manual\",\n \"customer_email\": \"jsmith@example.com\",\n \"customer_phone\": \"<string>\",\n \"order_date\": \"2023-11-07T05:31:56Z\",\n \"total_revenue\": 1,\n \"shipping_cost\": 0,\n \"tax_amount\": 0,\n \"discount_amount\": 0,\n \"shipping_street\": \"<string>\",\n \"shipping_city\": \"<string>\",\n \"shipping_state\": \"<string>\",\n \"shipping_zip\": \"<string>\",\n \"shipping_country\": \"USA\",\n \"external_id\": \"<string>\",\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.autoprintfarm.com/public/v1/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_name\": \"<string>\",\n \"items\": [\n {\n \"sku\": \"<string>\",\n \"product_name\": \"<string>\",\n \"quantity\": 2,\n \"unit_price\": 1,\n \"product_sku_id\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"order_number\": \"<string>\",\n \"platform\": \"manual\",\n \"customer_email\": \"jsmith@example.com\",\n \"customer_phone\": \"<string>\",\n \"order_date\": \"2023-11-07T05:31:56Z\",\n \"total_revenue\": 1,\n \"shipping_cost\": 0,\n \"tax_amount\": 0,\n \"discount_amount\": 0,\n \"shipping_street\": \"<string>\",\n \"shipping_city\": \"<string>\",\n \"shipping_state\": \"<string>\",\n \"shipping_zip\": \"<string>\",\n \"shipping_country\": \"USA\",\n \"external_id\": \"<string>\",\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autoprintfarm.com/public/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_name\": \"<string>\",\n \"items\": [\n {\n \"sku\": \"<string>\",\n \"product_name\": \"<string>\",\n \"quantity\": 2,\n \"unit_price\": 1,\n \"product_sku_id\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"order_number\": \"<string>\",\n \"platform\": \"manual\",\n \"customer_email\": \"jsmith@example.com\",\n \"customer_phone\": \"<string>\",\n \"order_date\": \"2023-11-07T05:31:56Z\",\n \"total_revenue\": 1,\n \"shipping_cost\": 0,\n \"tax_amount\": 0,\n \"discount_amount\": 0,\n \"shipping_street\": \"<string>\",\n \"shipping_city\": \"<string>\",\n \"shipping_state\": \"<string>\",\n \"shipping_zip\": \"<string>\",\n \"shipping_country\": \"USA\",\n \"external_id\": \"<string>\",\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"order_number": "<string>",
"platform": "<string>",
"customer_name": "<string>",
"customer_email": "<string>",
"customer_phone": "<string>",
"order_date": "<string>",
"status": "<string>",
"total_revenue": 123,
"shipping_cost": 123,
"tax_amount": 123,
"discount_amount": 123,
"shipping_street": "<string>",
"shipping_city": "<string>",
"shipping_state": "<string>",
"shipping_zip": "<string>",
"shipping_country": "<string>",
"tracking_number": "<string>",
"tracking_url": "<string>",
"shipped_at": "<string>",
"external_id": "<string>",
"notes": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"items": [
{
"id": "<string>",
"product_sku_id": "<string>",
"sku": "<string>",
"product_name": "<string>",
"quantity": 123,
"unit_price": 123,
"total_price": 123,
"quantity_fulfilled": 123,
"fulfillment_status": "<string>",
"notes": "<string>",
"created_at": "<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.
Body
application/json
Minimum array length:
1Show child attributes
Show child attributes
Available options:
shopify, etsy, manual, woocommerce, wix, other Total in cents. Calculated from items if omitted.
Required range:
x >= 0Shipping cost in cents
Required range:
x >= 0Tax amount in cents
Required range:
x >= 0Discount applied in cents
Required range:
x >= 0Was this page helpful?
⌘I