Price an order
curl --request POST \
--url https://partners.dekhq.com/api/partners/v1/order-submissions/preview \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"orderName": "Spring team order",
"purchaseOrderNumber": "PO-10042",
"shippingMethod": "ship",
"shipTo": {
"company": "Example Co",
"firstName": "Sam",
"lastName": "Sample",
"address1": "200 Sample St",
"city": "Riverton",
"region": "WY",
"postalCode": "82501",
"country": "US"
},
"requestedInHandsDate": "2026-03-02",
"inboundTracking": [
"1Z999AA10123456784"
],
"lines": [
{
"ref": "L1",
"garment": {
"styleId": "0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70",
"colorId": "7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "M",
"quantity": 24
},
{
"size": "L",
"quantity": 12
}
],
"clientSku": "TEE-BLK"
},
{
"ref": "L2",
"garment": {
"brand": "Patagonia",
"styleNumber": "25528",
"colorName": "Stone Grey",
"productName": "Better Sweater Jacket"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "L",
"quantity": 6
}
]
}
],
"decorations": [
{
"method": "SP",
"locationCode": "FF",
"size": {
"width": 10,
"height": 12
},
"inks": [
{
"name": "White",
"pms": "WHITE"
}
],
"artUploadId": "upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F",
"lineRefs": [
"L1",
"L2"
]
}
]
}
'import requests
url = "https://partners.dekhq.com/api/partners/v1/order-submissions/preview"
payload = {
"orderName": "Spring team order",
"purchaseOrderNumber": "PO-10042",
"shippingMethod": "ship",
"shipTo": {
"company": "Example Co",
"firstName": "Sam",
"lastName": "Sample",
"address1": "200 Sample St",
"city": "Riverton",
"region": "WY",
"postalCode": "82501",
"country": "US"
},
"requestedInHandsDate": "2026-03-02",
"inboundTracking": ["1Z999AA10123456784"],
"lines": [
{
"ref": "L1",
"garment": {
"styleId": "0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70",
"colorId": "7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "M",
"quantity": 24
},
{
"size": "L",
"quantity": 12
}
],
"clientSku": "TEE-BLK"
},
{
"ref": "L2",
"garment": {
"brand": "Patagonia",
"styleNumber": "25528",
"colorName": "Stone Grey",
"productName": "Better Sweater Jacket"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "L",
"quantity": 6
}
]
}
],
"decorations": [
{
"method": "SP",
"locationCode": "FF",
"size": {
"width": 10,
"height": 12
},
"inks": [
{
"name": "White",
"pms": "WHITE"
}
],
"artUploadId": "upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F",
"lineRefs": ["L1", "L2"]
}
]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orderName: 'Spring team order',
purchaseOrderNumber: 'PO-10042',
shippingMethod: 'ship',
shipTo: {
company: 'Example Co',
firstName: 'Sam',
lastName: 'Sample',
address1: '200 Sample St',
city: 'Riverton',
region: 'WY',
postalCode: '82501',
country: 'US'
},
requestedInHandsDate: '2026-03-02',
inboundTracking: ['1Z999AA10123456784'],
lines: [
{
ref: 'L1',
garment: {
styleId: '0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70',
colorId: '7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d'
},
suppliedBy: 'customer',
sizes: [{size: 'M', quantity: 24}, {size: 'L', quantity: 12}],
clientSku: 'TEE-BLK'
},
{
ref: 'L2',
garment: {
brand: 'Patagonia',
styleNumber: '25528',
colorName: 'Stone Grey',
productName: 'Better Sweater Jacket'
},
suppliedBy: 'customer',
sizes: [{size: 'L', quantity: 6}]
}
],
decorations: [
{
method: 'SP',
locationCode: 'FF',
size: {width: 10, height: 12},
inks: [{name: 'White', pms: 'WHITE'}],
artUploadId: 'upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F',
lineRefs: ['L1', 'L2']
}
]
})
};
fetch('https://partners.dekhq.com/api/partners/v1/order-submissions/preview', 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://partners.dekhq.com/api/partners/v1/order-submissions/preview",
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([
'orderName' => 'Spring team order',
'purchaseOrderNumber' => 'PO-10042',
'shippingMethod' => 'ship',
'shipTo' => [
'company' => 'Example Co',
'firstName' => 'Sam',
'lastName' => 'Sample',
'address1' => '200 Sample St',
'city' => 'Riverton',
'region' => 'WY',
'postalCode' => '82501',
'country' => 'US'
],
'requestedInHandsDate' => '2026-03-02',
'inboundTracking' => [
'1Z999AA10123456784'
],
'lines' => [
[
'ref' => 'L1',
'garment' => [
'styleId' => '0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70',
'colorId' => '7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d'
],
'suppliedBy' => 'customer',
'sizes' => [
[
'size' => 'M',
'quantity' => 24
],
[
'size' => 'L',
'quantity' => 12
]
],
'clientSku' => 'TEE-BLK'
],
[
'ref' => 'L2',
'garment' => [
'brand' => 'Patagonia',
'styleNumber' => '25528',
'colorName' => 'Stone Grey',
'productName' => 'Better Sweater Jacket'
],
'suppliedBy' => 'customer',
'sizes' => [
[
'size' => 'L',
'quantity' => 6
]
]
]
],
'decorations' => [
[
'method' => 'SP',
'locationCode' => 'FF',
'size' => [
'width' => 10,
'height' => 12
],
'inks' => [
[
'name' => 'White',
'pms' => 'WHITE'
]
],
'artUploadId' => 'upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F',
'lineRefs' => [
'L1',
'L2'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://partners.dekhq.com/api/partners/v1/order-submissions/preview"
payload := strings.NewReader("{\n \"orderName\": \"Spring team order\",\n \"purchaseOrderNumber\": \"PO-10042\",\n \"shippingMethod\": \"ship\",\n \"shipTo\": {\n \"company\": \"Example Co\",\n \"firstName\": \"Sam\",\n \"lastName\": \"Sample\",\n \"address1\": \"200 Sample St\",\n \"city\": \"Riverton\",\n \"region\": \"WY\",\n \"postalCode\": \"82501\",\n \"country\": \"US\"\n },\n \"requestedInHandsDate\": \"2026-03-02\",\n \"inboundTracking\": [\n \"1Z999AA10123456784\"\n ],\n \"lines\": [\n {\n \"ref\": \"L1\",\n \"garment\": {\n \"styleId\": \"0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70\",\n \"colorId\": \"7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"M\",\n \"quantity\": 24\n },\n {\n \"size\": \"L\",\n \"quantity\": 12\n }\n ],\n \"clientSku\": \"TEE-BLK\"\n },\n {\n \"ref\": \"L2\",\n \"garment\": {\n \"brand\": \"Patagonia\",\n \"styleNumber\": \"25528\",\n \"colorName\": \"Stone Grey\",\n \"productName\": \"Better Sweater Jacket\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"L\",\n \"quantity\": 6\n }\n ]\n }\n ],\n \"decorations\": [\n {\n \"method\": \"SP\",\n \"locationCode\": \"FF\",\n \"size\": {\n \"width\": 10,\n \"height\": 12\n },\n \"inks\": [\n {\n \"name\": \"White\",\n \"pms\": \"WHITE\"\n }\n ],\n \"artUploadId\": \"upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F\",\n \"lineRefs\": [\n \"L1\",\n \"L2\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://partners.dekhq.com/api/partners/v1/order-submissions/preview")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"orderName\": \"Spring team order\",\n \"purchaseOrderNumber\": \"PO-10042\",\n \"shippingMethod\": \"ship\",\n \"shipTo\": {\n \"company\": \"Example Co\",\n \"firstName\": \"Sam\",\n \"lastName\": \"Sample\",\n \"address1\": \"200 Sample St\",\n \"city\": \"Riverton\",\n \"region\": \"WY\",\n \"postalCode\": \"82501\",\n \"country\": \"US\"\n },\n \"requestedInHandsDate\": \"2026-03-02\",\n \"inboundTracking\": [\n \"1Z999AA10123456784\"\n ],\n \"lines\": [\n {\n \"ref\": \"L1\",\n \"garment\": {\n \"styleId\": \"0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70\",\n \"colorId\": \"7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"M\",\n \"quantity\": 24\n },\n {\n \"size\": \"L\",\n \"quantity\": 12\n }\n ],\n \"clientSku\": \"TEE-BLK\"\n },\n {\n \"ref\": \"L2\",\n \"garment\": {\n \"brand\": \"Patagonia\",\n \"styleNumber\": \"25528\",\n \"colorName\": \"Stone Grey\",\n \"productName\": \"Better Sweater Jacket\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"L\",\n \"quantity\": 6\n }\n ]\n }\n ],\n \"decorations\": [\n {\n \"method\": \"SP\",\n \"locationCode\": \"FF\",\n \"size\": {\n \"width\": 10,\n \"height\": 12\n },\n \"inks\": [\n {\n \"name\": \"White\",\n \"pms\": \"WHITE\"\n }\n ],\n \"artUploadId\": \"upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F\",\n \"lineRefs\": [\n \"L1\",\n \"L2\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partners.dekhq.com/api/partners/v1/order-submissions/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderName\": \"Spring team order\",\n \"purchaseOrderNumber\": \"PO-10042\",\n \"shippingMethod\": \"ship\",\n \"shipTo\": {\n \"company\": \"Example Co\",\n \"firstName\": \"Sam\",\n \"lastName\": \"Sample\",\n \"address1\": \"200 Sample St\",\n \"city\": \"Riverton\",\n \"region\": \"WY\",\n \"postalCode\": \"82501\",\n \"country\": \"US\"\n },\n \"requestedInHandsDate\": \"2026-03-02\",\n \"inboundTracking\": [\n \"1Z999AA10123456784\"\n ],\n \"lines\": [\n {\n \"ref\": \"L1\",\n \"garment\": {\n \"styleId\": \"0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70\",\n \"colorId\": \"7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"M\",\n \"quantity\": 24\n },\n {\n \"size\": \"L\",\n \"quantity\": 12\n }\n ],\n \"clientSku\": \"TEE-BLK\"\n },\n {\n \"ref\": \"L2\",\n \"garment\": {\n \"brand\": \"Patagonia\",\n \"styleNumber\": \"25528\",\n \"colorName\": \"Stone Grey\",\n \"productName\": \"Better Sweater Jacket\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"L\",\n \"quantity\": 6\n }\n ]\n }\n ],\n \"decorations\": [\n {\n \"method\": \"SP\",\n \"locationCode\": \"FF\",\n \"size\": {\n \"width\": 10,\n \"height\": 12\n },\n \"inks\": [\n {\n \"name\": \"White\",\n \"pms\": \"WHITE\"\n }\n ],\n \"artUploadId\": \"upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F\",\n \"lineRefs\": [\n \"L1\",\n \"L2\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"total": "412.50",
"currency": "USD"
}{
"type": "https://docs.dekhq.com/api/partners/errors#invalid_request",
"title": "Invalid request",
"status": 400,
"detail": "A query parameter or body field is missing or invalid. `errors[]` lists each field.",
"code": "invalid_request",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#unauthenticated",
"title": "Unauthenticated",
"status": 401,
"detail": "Missing or invalid credentials.",
"code": "unauthenticated",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Your credential is not enabled for the scope this endpoint needs.",
"code": "forbidden",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#payload_too_large",
"title": "Payload too large",
"status": 413,
"detail": "The request body is larger than this endpoint accepts.",
"code": "payload_too_large",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#order_refused",
"title": "Order refused",
"status": 422,
"detail": "The request is well formed but the order cannot be placed as sent. `errors[]` names each field and why: `not_supported_yet` for something this API does not take yet, `total_changed` when `expectedTotal` is not the current total (`currentTotal` carries it). `detail` says what to change.",
"code": "order_refused",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#rate_limited",
"title": "Rate limited",
"status": 429,
"detail": "More than the allowed requests per minute.",
"code": "rate_limited",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#internal",
"title": "Internal error",
"status": 500,
"detail": "An unexpected error on our side. It is logged; retry later.",
"code": "internal",
"requestId": "req_0123456789abcdef"
}Place orders
Price an order
What an order would cost, priced exactly as placing it would be. Nothing is created. Send its total as expectedTotal when you place the order. A body that can’t be placed is 422 order_refused naming each field. Some checks (a size we don’t recognise, a print location that doesn’t fit the garment) run only when the order is placed, so a priced preview can still be refused then.
POST
/
api
/
partners
/
v1
/
order-submissions
/
preview
Price an order
curl --request POST \
--url https://partners.dekhq.com/api/partners/v1/order-submissions/preview \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"orderName": "Spring team order",
"purchaseOrderNumber": "PO-10042",
"shippingMethod": "ship",
"shipTo": {
"company": "Example Co",
"firstName": "Sam",
"lastName": "Sample",
"address1": "200 Sample St",
"city": "Riverton",
"region": "WY",
"postalCode": "82501",
"country": "US"
},
"requestedInHandsDate": "2026-03-02",
"inboundTracking": [
"1Z999AA10123456784"
],
"lines": [
{
"ref": "L1",
"garment": {
"styleId": "0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70",
"colorId": "7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "M",
"quantity": 24
},
{
"size": "L",
"quantity": 12
}
],
"clientSku": "TEE-BLK"
},
{
"ref": "L2",
"garment": {
"brand": "Patagonia",
"styleNumber": "25528",
"colorName": "Stone Grey",
"productName": "Better Sweater Jacket"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "L",
"quantity": 6
}
]
}
],
"decorations": [
{
"method": "SP",
"locationCode": "FF",
"size": {
"width": 10,
"height": 12
},
"inks": [
{
"name": "White",
"pms": "WHITE"
}
],
"artUploadId": "upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F",
"lineRefs": [
"L1",
"L2"
]
}
]
}
'import requests
url = "https://partners.dekhq.com/api/partners/v1/order-submissions/preview"
payload = {
"orderName": "Spring team order",
"purchaseOrderNumber": "PO-10042",
"shippingMethod": "ship",
"shipTo": {
"company": "Example Co",
"firstName": "Sam",
"lastName": "Sample",
"address1": "200 Sample St",
"city": "Riverton",
"region": "WY",
"postalCode": "82501",
"country": "US"
},
"requestedInHandsDate": "2026-03-02",
"inboundTracking": ["1Z999AA10123456784"],
"lines": [
{
"ref": "L1",
"garment": {
"styleId": "0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70",
"colorId": "7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "M",
"quantity": 24
},
{
"size": "L",
"quantity": 12
}
],
"clientSku": "TEE-BLK"
},
{
"ref": "L2",
"garment": {
"brand": "Patagonia",
"styleNumber": "25528",
"colorName": "Stone Grey",
"productName": "Better Sweater Jacket"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "L",
"quantity": 6
}
]
}
],
"decorations": [
{
"method": "SP",
"locationCode": "FF",
"size": {
"width": 10,
"height": 12
},
"inks": [
{
"name": "White",
"pms": "WHITE"
}
],
"artUploadId": "upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F",
"lineRefs": ["L1", "L2"]
}
]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orderName: 'Spring team order',
purchaseOrderNumber: 'PO-10042',
shippingMethod: 'ship',
shipTo: {
company: 'Example Co',
firstName: 'Sam',
lastName: 'Sample',
address1: '200 Sample St',
city: 'Riverton',
region: 'WY',
postalCode: '82501',
country: 'US'
},
requestedInHandsDate: '2026-03-02',
inboundTracking: ['1Z999AA10123456784'],
lines: [
{
ref: 'L1',
garment: {
styleId: '0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70',
colorId: '7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d'
},
suppliedBy: 'customer',
sizes: [{size: 'M', quantity: 24}, {size: 'L', quantity: 12}],
clientSku: 'TEE-BLK'
},
{
ref: 'L2',
garment: {
brand: 'Patagonia',
styleNumber: '25528',
colorName: 'Stone Grey',
productName: 'Better Sweater Jacket'
},
suppliedBy: 'customer',
sizes: [{size: 'L', quantity: 6}]
}
],
decorations: [
{
method: 'SP',
locationCode: 'FF',
size: {width: 10, height: 12},
inks: [{name: 'White', pms: 'WHITE'}],
artUploadId: 'upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F',
lineRefs: ['L1', 'L2']
}
]
})
};
fetch('https://partners.dekhq.com/api/partners/v1/order-submissions/preview', 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://partners.dekhq.com/api/partners/v1/order-submissions/preview",
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([
'orderName' => 'Spring team order',
'purchaseOrderNumber' => 'PO-10042',
'shippingMethod' => 'ship',
'shipTo' => [
'company' => 'Example Co',
'firstName' => 'Sam',
'lastName' => 'Sample',
'address1' => '200 Sample St',
'city' => 'Riverton',
'region' => 'WY',
'postalCode' => '82501',
'country' => 'US'
],
'requestedInHandsDate' => '2026-03-02',
'inboundTracking' => [
'1Z999AA10123456784'
],
'lines' => [
[
'ref' => 'L1',
'garment' => [
'styleId' => '0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70',
'colorId' => '7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d'
],
'suppliedBy' => 'customer',
'sizes' => [
[
'size' => 'M',
'quantity' => 24
],
[
'size' => 'L',
'quantity' => 12
]
],
'clientSku' => 'TEE-BLK'
],
[
'ref' => 'L2',
'garment' => [
'brand' => 'Patagonia',
'styleNumber' => '25528',
'colorName' => 'Stone Grey',
'productName' => 'Better Sweater Jacket'
],
'suppliedBy' => 'customer',
'sizes' => [
[
'size' => 'L',
'quantity' => 6
]
]
]
],
'decorations' => [
[
'method' => 'SP',
'locationCode' => 'FF',
'size' => [
'width' => 10,
'height' => 12
],
'inks' => [
[
'name' => 'White',
'pms' => 'WHITE'
]
],
'artUploadId' => 'upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F',
'lineRefs' => [
'L1',
'L2'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://partners.dekhq.com/api/partners/v1/order-submissions/preview"
payload := strings.NewReader("{\n \"orderName\": \"Spring team order\",\n \"purchaseOrderNumber\": \"PO-10042\",\n \"shippingMethod\": \"ship\",\n \"shipTo\": {\n \"company\": \"Example Co\",\n \"firstName\": \"Sam\",\n \"lastName\": \"Sample\",\n \"address1\": \"200 Sample St\",\n \"city\": \"Riverton\",\n \"region\": \"WY\",\n \"postalCode\": \"82501\",\n \"country\": \"US\"\n },\n \"requestedInHandsDate\": \"2026-03-02\",\n \"inboundTracking\": [\n \"1Z999AA10123456784\"\n ],\n \"lines\": [\n {\n \"ref\": \"L1\",\n \"garment\": {\n \"styleId\": \"0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70\",\n \"colorId\": \"7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"M\",\n \"quantity\": 24\n },\n {\n \"size\": \"L\",\n \"quantity\": 12\n }\n ],\n \"clientSku\": \"TEE-BLK\"\n },\n {\n \"ref\": \"L2\",\n \"garment\": {\n \"brand\": \"Patagonia\",\n \"styleNumber\": \"25528\",\n \"colorName\": \"Stone Grey\",\n \"productName\": \"Better Sweater Jacket\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"L\",\n \"quantity\": 6\n }\n ]\n }\n ],\n \"decorations\": [\n {\n \"method\": \"SP\",\n \"locationCode\": \"FF\",\n \"size\": {\n \"width\": 10,\n \"height\": 12\n },\n \"inks\": [\n {\n \"name\": \"White\",\n \"pms\": \"WHITE\"\n }\n ],\n \"artUploadId\": \"upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F\",\n \"lineRefs\": [\n \"L1\",\n \"L2\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://partners.dekhq.com/api/partners/v1/order-submissions/preview")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"orderName\": \"Spring team order\",\n \"purchaseOrderNumber\": \"PO-10042\",\n \"shippingMethod\": \"ship\",\n \"shipTo\": {\n \"company\": \"Example Co\",\n \"firstName\": \"Sam\",\n \"lastName\": \"Sample\",\n \"address1\": \"200 Sample St\",\n \"city\": \"Riverton\",\n \"region\": \"WY\",\n \"postalCode\": \"82501\",\n \"country\": \"US\"\n },\n \"requestedInHandsDate\": \"2026-03-02\",\n \"inboundTracking\": [\n \"1Z999AA10123456784\"\n ],\n \"lines\": [\n {\n \"ref\": \"L1\",\n \"garment\": {\n \"styleId\": \"0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70\",\n \"colorId\": \"7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"M\",\n \"quantity\": 24\n },\n {\n \"size\": \"L\",\n \"quantity\": 12\n }\n ],\n \"clientSku\": \"TEE-BLK\"\n },\n {\n \"ref\": \"L2\",\n \"garment\": {\n \"brand\": \"Patagonia\",\n \"styleNumber\": \"25528\",\n \"colorName\": \"Stone Grey\",\n \"productName\": \"Better Sweater Jacket\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"L\",\n \"quantity\": 6\n }\n ]\n }\n ],\n \"decorations\": [\n {\n \"method\": \"SP\",\n \"locationCode\": \"FF\",\n \"size\": {\n \"width\": 10,\n \"height\": 12\n },\n \"inks\": [\n {\n \"name\": \"White\",\n \"pms\": \"WHITE\"\n }\n ],\n \"artUploadId\": \"upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F\",\n \"lineRefs\": [\n \"L1\",\n \"L2\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partners.dekhq.com/api/partners/v1/order-submissions/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderName\": \"Spring team order\",\n \"purchaseOrderNumber\": \"PO-10042\",\n \"shippingMethod\": \"ship\",\n \"shipTo\": {\n \"company\": \"Example Co\",\n \"firstName\": \"Sam\",\n \"lastName\": \"Sample\",\n \"address1\": \"200 Sample St\",\n \"city\": \"Riverton\",\n \"region\": \"WY\",\n \"postalCode\": \"82501\",\n \"country\": \"US\"\n },\n \"requestedInHandsDate\": \"2026-03-02\",\n \"inboundTracking\": [\n \"1Z999AA10123456784\"\n ],\n \"lines\": [\n {\n \"ref\": \"L1\",\n \"garment\": {\n \"styleId\": \"0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70\",\n \"colorId\": \"7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"M\",\n \"quantity\": 24\n },\n {\n \"size\": \"L\",\n \"quantity\": 12\n }\n ],\n \"clientSku\": \"TEE-BLK\"\n },\n {\n \"ref\": \"L2\",\n \"garment\": {\n \"brand\": \"Patagonia\",\n \"styleNumber\": \"25528\",\n \"colorName\": \"Stone Grey\",\n \"productName\": \"Better Sweater Jacket\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"L\",\n \"quantity\": 6\n }\n ]\n }\n ],\n \"decorations\": [\n {\n \"method\": \"SP\",\n \"locationCode\": \"FF\",\n \"size\": {\n \"width\": 10,\n \"height\": 12\n },\n \"inks\": [\n {\n \"name\": \"White\",\n \"pms\": \"WHITE\"\n }\n ],\n \"artUploadId\": \"upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F\",\n \"lineRefs\": [\n \"L1\",\n \"L2\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"total": "412.50",
"currency": "USD"
}{
"type": "https://docs.dekhq.com/api/partners/errors#invalid_request",
"title": "Invalid request",
"status": 400,
"detail": "A query parameter or body field is missing or invalid. `errors[]` lists each field.",
"code": "invalid_request",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#unauthenticated",
"title": "Unauthenticated",
"status": 401,
"detail": "Missing or invalid credentials.",
"code": "unauthenticated",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Your credential is not enabled for the scope this endpoint needs.",
"code": "forbidden",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#payload_too_large",
"title": "Payload too large",
"status": 413,
"detail": "The request body is larger than this endpoint accepts.",
"code": "payload_too_large",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#order_refused",
"title": "Order refused",
"status": 422,
"detail": "The request is well formed but the order cannot be placed as sent. `errors[]` names each field and why: `not_supported_yet` for something this API does not take yet, `total_changed` when `expectedTotal` is not the current total (`currentTotal` carries it). `detail` says what to change.",
"code": "order_refused",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#rate_limited",
"title": "Rate limited",
"status": 429,
"detail": "More than the allowed requests per minute.",
"code": "rate_limited",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#internal",
"title": "Internal error",
"status": 500,
"detail": "An unexpected error on our side. It is logged; retry later.",
"code": "internal",
"requestId": "req_0123456789abcdef"
}Body
application/json
An order to price. Nothing is created.
Your PO number, stored exactly as you send it. Printable characters, no leading or trailing spaces, and no HTML tags or entities (422 order_refused). A PO you used before is accepted: retries are matched by Idempotency-Key, never by PO.
Required string length:
1 - 64Pattern:
^[\x21-\x7E](?:[\x20-\x7E]*[\x21-\x7E])?$