Print orders
Validate a provider-neutral prepared-media print order
Accepts exactly one JSON object up to 2 MiB and rejects unknown fields. This endpoint does not quote, create, pay for, upload media for, or submit an order. Clients must fetch the catalog and use the selected product revision’s asset requirements and options.
POST
/
v1
/
print-orders
/
validate
Validate a provider-neutral prepared-media print order
curl --request POST \
--url https://api.batchrelay.com/v1/print-orders/validate \
--header 'Content-Type: application/json' \
--data '
{
"schema_version": 123,
"external_order_id": "<string>",
"ship_to": {
"name": "<string>",
"address_1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>",
"address_2": "<string>"
},
"ship_from": {
"name": "<string>",
"address_1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>",
"address_2": "<string>"
},
"items": [
{
"product": {
"id": "<string>",
"revision": 2
},
"quantity": 2,
"assets": [
{
"url": "<string>",
"pixel_width": 2,
"pixel_height": 2,
"hash": "<string>",
"printed_file_name": "<string>"
}
],
"options": [
{
"option_id": "<string>",
"value": "<string>"
}
]
}
]
}
'import requests
url = "https://api.batchrelay.com/v1/print-orders/validate"
payload = {
"schema_version": 123,
"external_order_id": "<string>",
"ship_to": {
"name": "<string>",
"address_1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>",
"address_2": "<string>"
},
"ship_from": {
"name": "<string>",
"address_1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>",
"address_2": "<string>"
},
"items": [
{
"product": {
"id": "<string>",
"revision": 2
},
"quantity": 2,
"assets": [
{
"url": "<string>",
"pixel_width": 2,
"pixel_height": 2,
"hash": "<string>",
"printed_file_name": "<string>"
}
],
"options": [
{
"option_id": "<string>",
"value": "<string>"
}
]
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
schema_version: 123,
external_order_id: '<string>',
ship_to: {
name: '<string>',
address_1: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>',
phone: '<string>',
address_2: '<string>'
},
ship_from: {
name: '<string>',
address_1: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>',
phone: '<string>',
address_2: '<string>'
},
items: [
{
product: {id: '<string>', revision: 2},
quantity: 2,
assets: [
{
url: '<string>',
pixel_width: 2,
pixel_height: 2,
hash: '<string>',
printed_file_name: '<string>'
}
],
options: [{option_id: '<string>', value: '<string>'}]
}
]
})
};
fetch('https://api.batchrelay.com/v1/print-orders/validate', 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.batchrelay.com/v1/print-orders/validate",
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([
'schema_version' => 123,
'external_order_id' => '<string>',
'ship_to' => [
'name' => '<string>',
'address_1' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<string>',
'phone' => '<string>',
'address_2' => '<string>'
],
'ship_from' => [
'name' => '<string>',
'address_1' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<string>',
'phone' => '<string>',
'address_2' => '<string>'
],
'items' => [
[
'product' => [
'id' => '<string>',
'revision' => 2
],
'quantity' => 2,
'assets' => [
[
'url' => '<string>',
'pixel_width' => 2,
'pixel_height' => 2,
'hash' => '<string>',
'printed_file_name' => '<string>'
]
],
'options' => [
[
'option_id' => '<string>',
'value' => '<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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.batchrelay.com/v1/print-orders/validate"
payload := strings.NewReader("{\n \"schema_version\": 123,\n \"external_order_id\": \"<string>\",\n \"ship_to\": {\n \"name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_2\": \"<string>\"\n },\n \"ship_from\": {\n \"name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_2\": \"<string>\"\n },\n \"items\": [\n {\n \"product\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"quantity\": 2,\n \"assets\": [\n {\n \"url\": \"<string>\",\n \"pixel_width\": 2,\n \"pixel_height\": 2,\n \"hash\": \"<string>\",\n \"printed_file_name\": \"<string>\"\n }\n ],\n \"options\": [\n {\n \"option_id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.batchrelay.com/v1/print-orders/validate")
.header("Content-Type", "application/json")
.body("{\n \"schema_version\": 123,\n \"external_order_id\": \"<string>\",\n \"ship_to\": {\n \"name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_2\": \"<string>\"\n },\n \"ship_from\": {\n \"name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_2\": \"<string>\"\n },\n \"items\": [\n {\n \"product\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"quantity\": 2,\n \"assets\": [\n {\n \"url\": \"<string>\",\n \"pixel_width\": 2,\n \"pixel_height\": 2,\n \"hash\": \"<string>\",\n \"printed_file_name\": \"<string>\"\n }\n ],\n \"options\": [\n {\n \"option_id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.batchrelay.com/v1/print-orders/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"schema_version\": 123,\n \"external_order_id\": \"<string>\",\n \"ship_to\": {\n \"name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_2\": \"<string>\"\n },\n \"ship_from\": {\n \"name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_2\": \"<string>\"\n },\n \"items\": [\n {\n \"product\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"quantity\": 2,\n \"assets\": [\n {\n \"url\": \"<string>\",\n \"pixel_width\": 2,\n \"pixel_height\": 2,\n \"hash\": \"<string>\",\n \"printed_file_name\": \"<string>\"\n }\n ],\n \"options\": [\n {\n \"option_id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"plan": {
"schema_version": 123,
"external_order_id": "<string>",
"ship_to": {
"name": "<string>",
"address_1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>",
"address_2": "<string>"
},
"ship_from": {
"name": "<string>",
"address_1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>",
"address_2": "<string>"
},
"lines": [
{
"request": {
"product": {
"id": "<string>",
"revision": 2
},
"quantity": 2,
"assets": [
{
"url": "<string>",
"pixel_width": 2,
"pixel_height": 2,
"hash": "<string>",
"printed_file_name": "<string>"
}
],
"options": [
{
"option_id": "<string>",
"value": "<string>"
}
]
},
"product": {
"id": "<string>",
"revision": 2,
"name": "<string>",
"description": "<string>",
"fulfillment_type": "<string>",
"tax_category": "<string>",
"physical_output": {
"width": 123,
"height": 123,
"unit": "<string>"
},
"units_per_quantity": 2,
"options": [
{
"id": "<string>",
"name": "<string>",
"values": [
"<string>"
],
"default_value": "<string>"
}
],
"unit_costs": [
{
"option_values": [
{
"option_id": "<string>",
"value": "<string>"
}
],
"unit_cost_cents": 1
}
],
"asset_requirements": [
{
"aspect_ratio": {
"width": 2,
"height": 2
},
"required": true
}
]
}
}
]
}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}Body
application/json
Available options:
sandbox, production Minimum string length:
1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Minimum array length:
1Show child attributes
Show child attributes
Response
Validated, immutable fulfillment plan
Show child attributes
Show child attributes
⌘I
Validate a provider-neutral prepared-media print order
curl --request POST \
--url https://api.batchrelay.com/v1/print-orders/validate \
--header 'Content-Type: application/json' \
--data '
{
"schema_version": 123,
"external_order_id": "<string>",
"ship_to": {
"name": "<string>",
"address_1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>",
"address_2": "<string>"
},
"ship_from": {
"name": "<string>",
"address_1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>",
"address_2": "<string>"
},
"items": [
{
"product": {
"id": "<string>",
"revision": 2
},
"quantity": 2,
"assets": [
{
"url": "<string>",
"pixel_width": 2,
"pixel_height": 2,
"hash": "<string>",
"printed_file_name": "<string>"
}
],
"options": [
{
"option_id": "<string>",
"value": "<string>"
}
]
}
]
}
'import requests
url = "https://api.batchrelay.com/v1/print-orders/validate"
payload = {
"schema_version": 123,
"external_order_id": "<string>",
"ship_to": {
"name": "<string>",
"address_1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>",
"address_2": "<string>"
},
"ship_from": {
"name": "<string>",
"address_1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>",
"address_2": "<string>"
},
"items": [
{
"product": {
"id": "<string>",
"revision": 2
},
"quantity": 2,
"assets": [
{
"url": "<string>",
"pixel_width": 2,
"pixel_height": 2,
"hash": "<string>",
"printed_file_name": "<string>"
}
],
"options": [
{
"option_id": "<string>",
"value": "<string>"
}
]
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
schema_version: 123,
external_order_id: '<string>',
ship_to: {
name: '<string>',
address_1: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>',
phone: '<string>',
address_2: '<string>'
},
ship_from: {
name: '<string>',
address_1: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>',
phone: '<string>',
address_2: '<string>'
},
items: [
{
product: {id: '<string>', revision: 2},
quantity: 2,
assets: [
{
url: '<string>',
pixel_width: 2,
pixel_height: 2,
hash: '<string>',
printed_file_name: '<string>'
}
],
options: [{option_id: '<string>', value: '<string>'}]
}
]
})
};
fetch('https://api.batchrelay.com/v1/print-orders/validate', 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.batchrelay.com/v1/print-orders/validate",
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([
'schema_version' => 123,
'external_order_id' => '<string>',
'ship_to' => [
'name' => '<string>',
'address_1' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<string>',
'phone' => '<string>',
'address_2' => '<string>'
],
'ship_from' => [
'name' => '<string>',
'address_1' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<string>',
'phone' => '<string>',
'address_2' => '<string>'
],
'items' => [
[
'product' => [
'id' => '<string>',
'revision' => 2
],
'quantity' => 2,
'assets' => [
[
'url' => '<string>',
'pixel_width' => 2,
'pixel_height' => 2,
'hash' => '<string>',
'printed_file_name' => '<string>'
]
],
'options' => [
[
'option_id' => '<string>',
'value' => '<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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.batchrelay.com/v1/print-orders/validate"
payload := strings.NewReader("{\n \"schema_version\": 123,\n \"external_order_id\": \"<string>\",\n \"ship_to\": {\n \"name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_2\": \"<string>\"\n },\n \"ship_from\": {\n \"name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_2\": \"<string>\"\n },\n \"items\": [\n {\n \"product\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"quantity\": 2,\n \"assets\": [\n {\n \"url\": \"<string>\",\n \"pixel_width\": 2,\n \"pixel_height\": 2,\n \"hash\": \"<string>\",\n \"printed_file_name\": \"<string>\"\n }\n ],\n \"options\": [\n {\n \"option_id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.batchrelay.com/v1/print-orders/validate")
.header("Content-Type", "application/json")
.body("{\n \"schema_version\": 123,\n \"external_order_id\": \"<string>\",\n \"ship_to\": {\n \"name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_2\": \"<string>\"\n },\n \"ship_from\": {\n \"name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_2\": \"<string>\"\n },\n \"items\": [\n {\n \"product\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"quantity\": 2,\n \"assets\": [\n {\n \"url\": \"<string>\",\n \"pixel_width\": 2,\n \"pixel_height\": 2,\n \"hash\": \"<string>\",\n \"printed_file_name\": \"<string>\"\n }\n ],\n \"options\": [\n {\n \"option_id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.batchrelay.com/v1/print-orders/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"schema_version\": 123,\n \"external_order_id\": \"<string>\",\n \"ship_to\": {\n \"name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_2\": \"<string>\"\n },\n \"ship_from\": {\n \"name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_2\": \"<string>\"\n },\n \"items\": [\n {\n \"product\": {\n \"id\": \"<string>\",\n \"revision\": 2\n },\n \"quantity\": 2,\n \"assets\": [\n {\n \"url\": \"<string>\",\n \"pixel_width\": 2,\n \"pixel_height\": 2,\n \"hash\": \"<string>\",\n \"printed_file_name\": \"<string>\"\n }\n ],\n \"options\": [\n {\n \"option_id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"plan": {
"schema_version": 123,
"external_order_id": "<string>",
"ship_to": {
"name": "<string>",
"address_1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>",
"address_2": "<string>"
},
"ship_from": {
"name": "<string>",
"address_1": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>",
"address_2": "<string>"
},
"lines": [
{
"request": {
"product": {
"id": "<string>",
"revision": 2
},
"quantity": 2,
"assets": [
{
"url": "<string>",
"pixel_width": 2,
"pixel_height": 2,
"hash": "<string>",
"printed_file_name": "<string>"
}
],
"options": [
{
"option_id": "<string>",
"value": "<string>"
}
]
},
"product": {
"id": "<string>",
"revision": 2,
"name": "<string>",
"description": "<string>",
"fulfillment_type": "<string>",
"tax_category": "<string>",
"physical_output": {
"width": 123,
"height": 123,
"unit": "<string>"
},
"units_per_quantity": 2,
"options": [
{
"id": "<string>",
"name": "<string>",
"values": [
"<string>"
],
"default_value": "<string>"
}
],
"unit_costs": [
{
"option_values": [
{
"option_id": "<string>",
"value": "<string>"
}
],
"unit_cost_cents": 1
}
],
"asset_requirements": [
{
"aspect_ratio": {
"width": 2,
"height": 2
},
"required": true
}
]
}
}
]
}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"docs_url": "<string>",
"request_id": "<string>"
}